public class JGraphAlgebra
extends java.lang.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)
.JGraphCostFunction
Modifier and Type | Field and Description |
---|---|
protected static JGraphAlgebra |
sharedInstance
Holds the shared instance of this class.
|
Modifier | Constructor and Description |
---|---|
protected |
JGraphAlgebra()
Subclassers may override to provide special union find and priority queue
datastructures.
|
Modifier and Type | Method and Description |
---|---|
protected JGraphFibonacciHeap |
createPriorityQueue()
Hook for subclassers to provide a custom fibonacci heap.
|
protected JGraphUnionFind |
createUnionFind(java.lang.Object[] v)
Hook for subclassers to provide a custom union find structure.
|
JGraphUnionFind |
getConnectionComponents(GraphModel model,
java.lang.Object[] v,
java.lang.Object[] e)
Returns a union find structure representing the connection components of
G=(E,V).
|
java.lang.Object[] |
getMinimumSpanningTree(GraphModel model,
java.lang.Object[] v,
JGraphCostFunction cf,
boolean directed)
Returns the minimum spanning tree (MST) for the graph defined by G=(E,V).
|
java.lang.Object[] |
getMinimumSpanningTree(GraphModel model,
java.lang.Object[] v,
java.lang.Object[] e,
JGraphCostFunction cf)
Returns the minimum spanning tree (MST) for the graph defined by G=(E,V).
|
static JGraphAlgebra |
getSharedInstance() |
java.lang.Object[] |
getShortestPath(GraphModel model,
java.lang.Object from,
java.lang.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.
|
java.util.List |
sort(java.lang.Object[] cells,
JGraphCostFunction cf)
Returns a sorted set for
cells with respect to
cf . |
double |
sum(java.lang.Object[] cells,
JGraphCostFunction cf)
Returns the sum of all cost for
cells with respect to
cf . |
protected static JGraphAlgebra sharedInstance
protected JGraphAlgebra()
public static JGraphAlgebra getSharedInstance()
public static void setSharedInstance(JGraphAlgebra sharedInstance)
sharedInstance
- The sharedInstance to set.public java.lang.Object[] getShortestPath(GraphModel model, java.lang.Object from, java.lang.Object to, JGraphCostFunction cf, int steps, boolean directed)
model
- the model that defines the graph structurefrom
- the source port or vertexto
- the target port or vertex (aka. sink)cf
- the cost function that defines the edge lengthsteps
- the maximum number of edges to traversedirected
- if edge directions should be taken into accountcreatePriorityQueue()
public java.lang.Object[] getMinimumSpanningTree(GraphModel model, java.lang.Object[] v, JGraphCostFunction cf, boolean directed)
model
- the model that describes the graphv
- the vertices of the graphcf
- the cost function that defines the edge lengthcreatePriorityQueue()
public java.lang.Object[] getMinimumSpanningTree(GraphModel model, java.lang.Object[] v, java.lang.Object[] e, JGraphCostFunction cf)
model
- the model that describes the graphv
- the vertices of the graphe
- the edges of the graphcf
- the cost function that defines the edge lengthgetMinimumSpanningTree(GraphModel, Object[], JGraphCostFunction,
boolean)
,
createUnionFind(Object[])
public JGraphUnionFind getConnectionComponents(GraphModel model, java.lang.Object[] v, java.lang.Object[] e)
model
- the model that describes the graphv
- the vertices of the graphe
- the edges of the graphcreateUnionFind(Object[])
public java.util.List sort(java.lang.Object[] cells, JGraphCostFunction cf)
cells
with respect to
cf
.cells
- the cells to sortcf
- the cost function that defines the ordercells
wrt.
cf
public double sum(java.lang.Object[] cells, JGraphCostFunction cf)
cells
with respect to
cf
.cells
- the cells to use for the sumcf
- the cost function that defines the costsprotected JGraphUnionFind createUnionFind(java.lang.Object[] v)
v
- the array of all elementsv
protected JGraphFibonacciHeap createPriorityQueue()
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.