public final class RankAssignments extends Object
G=(V,E)
be a directed acyclic graph. Let length(e)
denote the minimum length
and weight(e)
the weight of an edge e
.
The rank assignment problem is the problem of finding integer values rank(v)
for all v
in
V
, such that:
rank(v) - rank(w) >= length(v,w)
, for all (v,w)
in E
and,∑(weight(v,w) * (rank(v) - rank(w)))
over all (v,w)
in E
is minimized.Modifier and Type | Method and Description |
---|---|
static int |
simple(Graph graph,
INodeMap rank,
IEdgeMap minLength)
This method quickly calculates a tight tree given a maximum time duration for the algorithm.
|
static int |
simple(Graph graph,
INodeMap rank,
IEdgeMap minLength,
long maximalDuration)
This method quickly calculates a tight tree given a maximum time duration for the algorithm.
|
static int |
simple(Graph graph,
int[] rank,
int[] minLength)
Like
simple(Graph, INodeMap, IEdgeMap, long) , but arrays are used instead of INodeMap s and
IEdgeMap s. |
static int |
simple(Graph graph,
int[] rank,
int[] minLength,
long maximalDuration)
Like
simple(Graph, INodeMap, IEdgeMap, long) , but arrays are used instead of INodeMap s and
IEdgeMap s. |
static int |
simplex(Graph graph,
INodeMap layer,
IDataProvider w,
IDataProvider minLength)
Solves the rank assignment problem using the simplex method given a maximum time duration for the algorithm.
|
static int |
simplex(Graph graph,
INodeMap layer,
IDataProvider w,
IDataProvider minLength,
IEdgeMap tree,
Node _root,
boolean validRanking)
Similar to
simplex(Graph, INodeMap, IDataProvider, IDataProvider, long) but, additionally, it is possible to
provide a valid initial tree solution for the problem. |
static int |
simplex(Graph graph,
INodeMap layer,
IDataProvider w,
IDataProvider minLength,
IEdgeMap tree,
Node _root,
boolean validRanking,
long maximalDuration)
Similar to
simplex(Graph, INodeMap, IDataProvider, IDataProvider, long) but, additionally, it is possible to
provide a valid initial tree solution for the problem. |
static int |
simplex(Graph graph,
INodeMap layer,
IDataProvider w,
IDataProvider minLength,
long maximalDuration)
Solves the rank assignment problem using the simplex method given a maximum time duration for the algorithm.
|
public static final int simple(Graph graph, INodeMap rank, IEdgeMap minLength)
The algorithm is using a highly optimized version of Gansner's algorithm:
Minimum edge length and weights should be non-negative.
graph
- the input graph in which all the edges have directions, such that rank[source] < rank[target]
and
rank[target] - rank[source] >= minlength[edge]
rank
- the INodeMap
that will be filled during the execution and returns the integer ranking of each nodeminLength
- the IEdgeMap
that returns an integer value (minimum/tight length) of each edgesimple(Graph, int[], int[], long)
public static final int simple(Graph graph, INodeMap rank, IEdgeMap minLength, long maximalDuration)
The algorithm is using a highly optimized version of Gansner's algorithm:
Minimum edge length and weights should be non-negative.
graph
- the input graph in which all the edges have directions, such that rank[source] < rank[target]
and
rank[target] - rank[source] >= minlength[edge]
rank
- the INodeMap
that will be filled during the execution and returns the integer ranking of each nodeminLength
- the IEdgeMap
that returns an integer value (minimum/tight length) of each edgemaximalDuration
- a preferred time limit for the algorithm (in milliseconds)simple(Graph, int[], int[], long)
public static final int simple(Graph graph, int[] rank, int[] minLength)
simple(Graph, INodeMap, IEdgeMap, long)
, but arrays are used instead of INodeMap
s and
IEdgeMap
s.
Minimum edge length and weights should be non-negative.
graph
- the input graph in which all the edges have directions, such that rank[source] < rank[target]
and
rank[target] - rank[source] >= minlength[edge]
rank
- an array that will be filled with the ranking r
of each node v
such that rank[v.index] == r
minLength
- an array holding a non-negative value len
of each edge e
such that minLength[e.index] == len
simple(Graph, INodeMap, IEdgeMap, long)
public static final int simple(Graph graph, int[] rank, int[] minLength, long maximalDuration)
simple(Graph, INodeMap, IEdgeMap, long)
, but arrays are used instead of INodeMap
s and
IEdgeMap
s.
Minimum edge length and weights should be non-negative.
graph
- the input graph in which all the edges have directions, such that rank[source] < rank[target]
and
rank[target] - rank[source] >= minlength[edge]
rank
- an array that will be filled with the ranking r
of each node v
such that rank[v.index] == r
minLength
- an array holding a non-negative value len
of each edge e
such that minLength[e.index] == len
maximalDuration
- a preferred time limit for the algorithm (in milliseconds)simple(Graph, INodeMap, IEdgeMap, long)
public static final int simplex(Graph graph, INodeMap layer, IDataProvider w, IDataProvider minLength)
This method assigns a minimum rank to the nodes in a acyclic graph.
Although its time complexity has not been proven polynomial, in practice it takes few iterations and runs quickly.
The algorithm is based on:
Minimum edge length and weights should be non-negative.
graph
- the given graphlayer
- the INodeMap
that will be filled during the execution and returns the zero-based ranking index for each nodew
- the IDataProvider
that returns an integer value (weight) of each edgeminLength
- the IDataProvider
that returns an integer value (minimum length) of each edgesimplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
,
simplex(Graph, INodeMap, IDataProvider, IDataProvider, IEdgeMap, Node, boolean, long)
public static final int simplex(Graph graph, INodeMap layer, IDataProvider w, IDataProvider minLength, IEdgeMap tree, Node _root, boolean validRanking)
simplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
but, additionally, it is possible to
provide a valid initial tree solution for the problem.
Minimum edge length and weights should be non-negative.
graph
- the given graphlayer
- the INodeMap
that will be filled during the execution and returns the zero-based ranking index for each nodew
- the IDataProvider
that returns an integer value (weight) of each edgeminLength
- the IDataProvider
that returns an integer value (minimum length) of each edgetree
- the IEdgeMap
that returns a boolean value indicating whether or not an edge is a tree edge_root
- the given root node of the tree solutionvalidRanking
- true
if the argument layer
contains a valid ranking, false
otherwisesimplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
,
simplex(Graph, INodeMap, IDataProvider, IDataProvider, IEdgeMap, Node, boolean, long)
public static final int simplex(Graph graph, INodeMap layer, IDataProvider w, IDataProvider minLength, IEdgeMap tree, Node _root, boolean validRanking, long maximalDuration)
simplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
but, additionally, it is possible to
provide a valid initial tree solution for the problem.
Minimum edge length and weights should be non-negative.
graph
- the given graphlayer
- the INodeMap
that will be filled during the execution and returns the zero-based ranking index for each nodew
- the IDataProvider
that returns an integer value (weight) of each edgeminLength
- the IDataProvider
that returns an integer value (minimum length) of each edgetree
- the IEdgeMap
that returns a boolean value indicating whether or not an edge is a tree edge_root
- the given root node of the tree solutionvalidRanking
- true
if the argument layer
contains a valid ranking, false
otherwisemaximalDuration
- a preferred time limit for the algorithm (in milliseconds)simplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
,
simplex(Graph, INodeMap, IDataProvider, IDataProvider, IEdgeMap, Node, boolean, long)
public static final int simplex(Graph graph, INodeMap layer, IDataProvider w, IDataProvider minLength, long maximalDuration)
This method assigns a minimum rank to the nodes in a acyclic graph.
Although its time complexity has not been proven polynomial, in practice it takes few iterations and runs quickly.
The algorithm is based on:
Minimum edge length and weights should be non-negative.
graph
- the given graphlayer
- the INodeMap
that will be filled during the execution and returns the zero-based ranking index for each nodew
- the IDataProvider
that returns an integer value (weight) of each edgeminLength
- the IDataProvider
that returns an integer value (minimum length) of each edgemaximalDuration
- a preferred time limit for the algorithm (in milliseconds)simplex(Graph, INodeMap, IDataProvider, IDataProvider, long)
,
simplex(Graph, INodeMap, IDataProvider, IDataProvider, IEdgeMap, Node, boolean, long)