com.jgraph.algebra
public class JGraphAlgebra extends Object
Object[] path = alg.getShortestPath(graph.getModel(), sourceVertex,
targetVertex, cf, v.length, true)
alg.getMinimumSpanningTree(graph.getModel(), v, cf, true))
alg.getMinimumSpanningTree(graph.getModel(), v, e, cf))
boolean connected = uf.differ(vertex1, vertex2)
.
See Also: JGraphCostFunction
Field Summary | |
---|---|
protected static JGraphAlgebra | sharedInstance
Holds the shared instance of this class. |
Constructor Summary | |
---|---|
protected | JGraphAlgebra()
Subclassers may override to provide special union find and priority queue
datastructures. |
Method Summary | |
---|---|
protected JGraphFibonacciHeap | createPriorityQueue()
Hook for subclassers to provide a custom fibonacci heap. |
protected JGraphUnionFind | createUnionFind(Object[] v)
Hook for subclassers to provide a custom union find structure.
|
JGraphUnionFind | getConnectionComponents(GraphModel model, Object[] v, Object[] e)
Returns a union find structure representing the connection components of
G=(E,V).
|
Object[] | getMinimumSpanningTree(GraphModel model, Object[] v, JGraphCostFunction cf, boolean directed)
Returns the minimum spanning tree (MST) for the graph defined by G=(E,V).
|
Object[] | getMinimumSpanningTree(GraphModel model, Object[] v, Object[] e, JGraphCostFunction cf)
Returns the minimum spanning tree (MST) for the graph defined by G=(E,V).
|
static JGraphAlgebra | getSharedInstance() |
Object[] | getShortestPath(GraphModel model, Object from, Object to, JGraphCostFunction cf, int steps, boolean directed)
Returns the shortest path between two cells or their descendants
represented as an array of edges in order of traversal. |
static void | setSharedInstance(JGraphAlgebra sharedInstance)
Sets the shared instance of this class.
|
List | sort(Object[] cells, JGraphCostFunction cf)
Returns a sorted set for cells with respect to
cf .
|
double | sum(Object[] cells, JGraphCostFunction cf)
Returns the sum of all cost for cells with respect to
cf .
|
Parameters: v the array of all elements
Returns: Returns a union find structure for v
Parameters: model the model that describes the graph v the vertices of the graph e the edges of the graph
Returns: Returns the connection components in G=(E,V)
See Also: (Object[])
Parameters: model the model that describes the graph v the vertices of the graph cf the cost function that defines the edge length
Returns: Returns the MST as an array of edges
See Also: createPriorityQueue
Parameters: model the model that describes the graph v the vertices of the graph e the edges of the graph cf the cost function that defines the edge length
Returns: Returns the MST as an array of edges
See Also: (GraphModel, Object[], JGraphCostFunction,
boolean)
(Object[])
Returns: Returns the sharedInstance.
Parameters: model the model that defines the graph structure from the source port or vertex to the target port or vertex (aka. sink) cf the cost function that defines the edge length steps the maximum number of edges to traverse directed if edge directions should be taken into account
Returns: Returns the shortest path as an array of edges
See Also: createPriorityQueue
Parameters: sharedInstance The sharedInstance to set.
cells
with respect to
cf
.
Parameters: cells the cells to sort cf the cost function that defines the order
Returns: Returns an ordered set of cells
wrt.
cf
cells
with respect to
cf
.
Parameters: cells the cells to use for the sum cf the cost function that defines the costs
Returns: Returns the sum of all cell cost