|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.PathFinder
public class PathFinder
PathFinder helps you find paths and cycles in a graph.
Constructor Summary | |
---|---|
PathFinder()
|
Method Summary | |
---|---|
static PathList |
findAllCycles(Diagram diagram)
Finds all cycles in the specified diagram. |
static PathList |
findAllPaths(Diagram diagram,
DiagramNode from,
DiagramNode to)
Finds and returns all paths starting from node from and
ending at node to . |
static Path |
findCycle(Diagram diagram)
Detects whether there is a cycle in a graph. |
static Path |
findCycle(Diagram diagram,
DiagramNode participant)
Detects whether the specified node participates in a cycle. |
static Path |
findLongestPath(Diagram diagram)
Finds the longest path in the graph. |
static Path |
findLongestPath(Diagram diagram,
DiagramNode from,
DiagramNode to)
Finds the longest path between two nodes. |
static Path |
findLongestPath(Diagram diagram,
long timeLimit)
Finds the longest path in the diagram. |
static Path |
findShortestPath(Diagram diagram,
DiagramNode from,
DiagramNode to)
Finds and returns the shortest path between from and
to . |
static Path |
findShortestPath(Diagram diagram,
DiagramNode from,
DiagramNode to,
boolean useNodeWeights,
boolean useLinkWeights)
Finds and returns the shortest path between from and
to , considering the weight of the nodes, the weight of the
links or both. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathFinder()
Method Detail |
---|
public static PathList findAllPaths(Diagram diagram, DiagramNode from, DiagramNode to)
from
and
ending at node to
.
diagram
- The Diagram
in which to look for paths.from
- The DiagramNode
where the paths should start.to
- The DiagramNode
where the paths should end.
PathList
containing the found paths. The list is empty
if there is no path found between the specified nodes.public static Path findShortestPath(Diagram diagram, DiagramNode from, DiagramNode to)
from
and
to
.
diagram
- The Diagram
in which to look for a path.from
- The DiagramNode
where the path should start.to
- The DiagramNode
where the path should end.
Path
object representing the found path, or null
if there isn't any path connecting the specified nodes.public static Path findShortestPath(Diagram diagram, DiagramNode from, DiagramNode to, boolean useNodeWeights, boolean useLinkWeights)
from
and
to
, considering the weight of the nodes, the weight of the
links or both.
diagram
- The Diagram
in which to look for a path.from
- The DiagramNode
where the path should start.to
- The DiagramNode
where the path should end.useNodeWeights
- true
if the Weight attribute
of nodes should be considered, otherwise false
.useLinkWeights
- true
if the Weight attribute
of links should be considered, otherwise false
.
Path
object representing the found path, or null
if there isn't any path connecting the specified nodes.public static Path findLongestPath(Diagram diagram, DiagramNode from, DiagramNode to)
diagram
- The Diagram
in which to look for a path.from
- The DiagramNode
where the path should start.to
- The DiagramNode
where the path should end.
Path
object representing the found path, or null
if there isn't any path connecting the specified nodes.public static Path findLongestPath(Diagram diagram)
diagram
- The Diagram
in which to look for a path.
Path
object representing the found path, or null
if there aren't any linked nodes in the graph.public static Path findLongestPath(Diagram diagram, long timeLimit)
diagram
- The Diagram
in which to look for a path.timeLimit
- Specifies the maximal amount of time
the algorithm is allowed to run.
Path
object representing the found path, or null
if there aren't any linked nodes in the graph.public static Path findCycle(Diagram diagram, DiagramNode participant)
diagram
- The Diagram
in which to look for a cycle.participant
- A DiagramNode
that should be in the cycle.
Path
object representing the cycle that contains
the specified node, or null if the node is not in a cycle.public static Path findCycle(Diagram diagram)
diagram
- The Diagram
in which to look for a cycle.
Path
object representing the first cycle found in the
graph, or null if the graph does not contain any cycles.public static PathList findAllCycles(Diagram diagram)
diagram
- The Diagram
in which to look for cycles.
PathList
containing the found cycles.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |