public class mxTraversal
extends java.lang.Object
| Constructor and Description |
|---|
mxTraversal() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<java.util.Map<java.lang.Object,java.lang.Object>> |
bellmanFord(mxAnalysisGraph aGraph,
java.lang.Object startVertex)
Implements the Bellman-Ford shortest path from startVertex to all vertices.
|
static void |
bfs(mxAnalysisGraph aGraph,
java.lang.Object startVertex,
mxGraph.mxICellVisitor visitor)
Implements a recursive breadth first search starting from the specified
cell.
|
static void |
dfs(mxAnalysisGraph aGraph,
java.lang.Object startVertex,
mxGraph.mxICellVisitor visitor)
Implements a recursive depth first search starting from the specified
cell.
|
static void |
dijkstra(mxAnalysisGraph aGraph,
java.lang.Object startVertex,
java.lang.Object endVertex,
mxGraph.mxICellVisitor visitor)
Implements the Dijkstra's shortest path from startVertex to endVertex.
|
static java.util.ArrayList<java.lang.Object[][]> |
floydRoyWarshall(mxAnalysisGraph aGraph)
Implements the Floyd-Roy-Warshall (aka WFI) shortest path algorithm between all vertices.
|
static java.lang.Object[] |
getWFIPath(mxAnalysisGraph aGraph,
java.util.ArrayList<java.lang.Object[][]> FWIresult,
java.lang.Object startVertex,
java.lang.Object targetVertex)
This method helps the user to get the desired data from the result of the Floyd-Roy-Warshall algorithm.
|
public static void dfs(mxAnalysisGraph aGraph, java.lang.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, java.lang.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, java.lang.Object startVertex, java.lang.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 java.util.List<java.util.Map<java.lang.Object,java.lang.Object>> bellmanFord(mxAnalysisGraph aGraph, java.lang.Object startVertex) throws StructuralException
aGraph - startVertex - StructuralException - - The Bellman-Ford algorithm only works for graphs without negative cyclespublic static java.util.ArrayList<java.lang.Object[][]> floydRoyWarshall(mxAnalysisGraph aGraph) throws StructuralException
aGraph - StructuralException - - The Floyd-Roy-Warshall algorithm only works for graphs without negative cyclespublic static java.lang.Object[] getWFIPath(mxAnalysisGraph aGraph, java.util.ArrayList<java.lang.Object[][]> FWIresult, java.lang.Object startVertex, java.lang.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