com.mindfusion.diagramming.jlayout
Class PathFinder

java.lang.Object
  extended by com.mindfusion.diagramming.jlayout.PathFinder

public class PathFinder
extends java.lang.Object


Constructor Summary
PathFinder()
           
 
Method Summary
static PathList findAllCycles(Graph graph)
           
static PathList findAllPaths(Graph graph, Node from, Node to)
          Finds and returns all paths starting from node 'from' and ending at node 'to'.
static Path findCycle(Graph graph)
          Detects whether there is a cycle in a graph.
static Path findCycle(Graph graph, Node participant)
          Detects whether the specified node participates in a cycle.
static Path findLongestPath(Graph graph)
          Finds the longest path in a graph.
static Path findLongestPath(Graph graph, long timeLimit)
          Finds the longest path in the graph.
static Path findLongestPath(Graph graph, Node from, Node to)
          Finds the longest path between two nodes.
static Path findShortestPath(Graph graph, Node from, Node to)
          Finds and returns the shortest path between from and to.
static Path findShortestPath(Graph graph, Node from, Node 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

PathFinder

public PathFinder()
Method Detail

findAllPaths

public static PathList findAllPaths(Graph graph,
                                    Node from,
                                    Node to)
Finds and returns all paths starting from node 'from' and ending at node 'to'. Returns empty collection if no path exists.


findShortestPath

public static Path findShortestPath(Graph graph,
                                    Node from,
                                    Node to)
Finds and returns the shortest path between from and to. Returns null if no path exists.


findShortestPath

public static Path findShortestPath(Graph graph,
                                    Node from,
                                    Node 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.


findLongestPath

public static Path findLongestPath(Graph graph,
                                   Node from,
                                   Node to)
Finds the longest path between two nodes. Returns null if no path exists.


findLongestPath

public static Path findLongestPath(Graph graph)
Finds the longest path in a graph. Returns null if path is not found.


findLongestPath

public static Path findLongestPath(Graph graph,
                                   long timeLimit)
Finds the longest path in the graph. The time limit specifies the maximum duration of the search process in milliseconds. Returns null if no path exists.


findCycle

public static Path findCycle(Graph graph,
                             Node participant)
Detects whether the specified node participates in a cycle.


findCycle

public static Path findCycle(Graph graph)
Detects whether there is a cycle in a graph.


findAllCycles

public static PathList findAllCycles(Graph graph)