public class PathFinder
extends java.lang.Object
Constructor and Description |
---|
PathFinder() |
Modifier and Type | Method and Description |
---|---|
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 PathList |
findAllPaths(Graph graph,
Node from,
Node to,
int maxPaths)
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.
|
public static PathList findAllPaths(Graph graph, Node from, Node to)
public static PathList findAllPaths(Graph graph, Node from, Node to, int maxPaths)
public static Path findShortestPath(Graph graph, Node from, Node to)
null
if no path exists.public static Path findShortestPath(Graph graph, Node from, Node to, boolean useNodeWeights, boolean useLinkWeights)
public static Path findLongestPath(Graph graph, Node from, Node to)
public static Path findLongestPath(Graph graph)
null
if path is not found.public static Path findLongestPath(Graph graph, long timeLimit)
null
if no path exists.public static Path findCycle(Graph graph, Node participant)