|
mxGraph 2.4.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mxgraph.analysis.mxTraversal
public class mxTraversal
Implements a collection of utility methods for traversing the graph structure. This does not include tree traversal methods.
Constructor Summary | |
---|---|
mxTraversal()
|
Method Summary | |
---|---|
static List<Map<Object,Object>> |
bellmanFord(mxAnalysisGraph aGraph,
Object startVertex)
Implements the Bellman-Ford shortest path from startVertex to all vertices. |
static void |
bfs(mxAnalysisGraph aGraph,
Object startVertex,
mxGraph.mxICellVisitor visitor)
Implements a recursive breadth first search starting from the specified cell. |
static void |
dfs(mxAnalysisGraph aGraph,
Object startVertex,
mxGraph.mxICellVisitor visitor)
Implements a recursive depth first search starting from the specified cell. |
static void |
dijkstra(mxAnalysisGraph aGraph,
Object startVertex,
Object endVertex,
mxGraph.mxICellVisitor visitor)
Implements the Dijkstra's shortest path from startVertex to endVertex. |
static ArrayList<Object[][]> |
floydRoyWarshall(mxAnalysisGraph aGraph)
Implements the Floyd-Roy-Warshall (aka WFI) shortest path algorithm between all vertices. |
static Object[] |
getWFIPath(mxAnalysisGraph aGraph,
ArrayList<Object[][]> FWIresult,
Object startVertex,
Object targetVertex)
This method helps the user to get the desired data from the result of the Floyd-Roy-Warshall algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public mxTraversal()
Method Detail |
---|
public static void dfs(mxAnalysisGraph aGraph, Object startVertex, mxGraph.mxICellVisitor visitor)
mxTraversal.bfs(analysisGraph, startVertex, new mxICellVisitor() { public boolean visit(Object vertex, Object edge) { // perform your processing on each cell here return false; } });
aGraph
- the graphstartVertex
- visitor
- public static void bfs(mxAnalysisGraph aGraph, Object startVertex, mxGraph.mxICellVisitor visitor)
mxTraversal.bfs(analysisGraph, startVertex, new mxICellVisitor() { public boolean visit(Object vertex, Object edge) { // perform your processing on each cell here return false; } });
aGraph
- the graphstartVertex
- visitor
- public static void dijkstra(mxAnalysisGraph aGraph, Object startVertex, Object endVertex, mxGraph.mxICellVisitor visitor) throws StructuralException
mxTraversal.dijkstra(analysisGraph, startVertex, endVertex, new mxICellVisitor() { public boolean visit(Object vertex, Object edge) { // perform your processing on each cell here return false; } });
aGraph
- startVertex
- endVertex
- visitor
-
StructuralException
- - The current Dijkstra algorithm only works for connected graphspublic static List<Map<Object,Object>> bellmanFord(mxAnalysisGraph aGraph, Object startVertex) throws StructuralException
aGraph
- startVertex
-
StructuralException
- - The Bellman-Ford algorithm only works for graphs without negative cyclespublic static ArrayList<Object[][]> floydRoyWarshall(mxAnalysisGraph aGraph) throws StructuralException
aGraph
-
StructuralException
- - The Floyd-Roy-Warshall algorithm only works for graphs without negative cyclespublic static Object[] getWFIPath(mxAnalysisGraph aGraph, ArrayList<Object[][]> FWIresult, Object startVertex, Object targetVertex) throws StructuralException
aGraph
- FWIresult
- - the result of the Floyd-Roy-Warhall algorithmstartVertex
- targetVertex
-
StructuralException
- - The Floyd-Roy-Warshall algorithm only works for graphs without negative cycles
|
mxGraph 2.4.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |