|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.algo.Paths
Reponsible for finding paths within a graph that have certain properties.
Constructor Summary | |
Paths()
|
Method Summary | |
static void |
findAllPaths(Graph g,
Node start,
Node end,
EdgeMap pathEdges)
Marks all edges that belong to a directed path from start to end node. |
static EdgeList |
findLongestPath(Graph g)
Returns the longest directed path within the given acyclic graph. |
static EdgeList |
findLongestPath(Graph g,
DataProvider edgeLength)
Returns the longest directed path within a given acyclic weighted graph. |
static void |
findLongestPaths(Graph g,
Node startNode,
EdgeMap dist,
NodeMap maxDist,
EdgeMap predicate)
Calculates the longest path from one vertex to all other vertices in a given acyclic graph |
static EdgeList |
findLongPath(Graph graph)
Returns an edge list that contains the edges of a undirected simple path within the given graph. |
static boolean |
findPath(Graph g,
NodeList topSort,
Node startNode,
Node endNode,
EdgeMap predicate)
Returns whether or not there is a directed path from one node to another node in an acyclic graph |
static EdgeList |
findPath(Graph graph,
Node startNode,
Node endNode,
boolean directed)
Returns an edge list that contains the edges of a path from the given start node to the given end node, if such a path exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Paths()
Method Detail |
public static EdgeList findPath(Graph graph, Node startNode, Node endNode, boolean directed)
If the returned path is empty then no path between the given nodes was found.
graph
- the input graphstartNode
- the first node of the pathendNode
- the last node of the pathdirected
- whether to search for a directed or undirected pathpublic static EdgeList findLongPath(Graph graph)
A heuristic is used to find a path that is long. It is not guaranteed though that the returned path is actually the longest path within the given graph, since that is a well known hard to solve problem.
public static void findLongestPaths(Graph g, Node startNode, EdgeMap dist, NodeMap maxDist, EdgeMap predicate)
g
- a directed acyclic graph.startNode
- the node, for which the distances are calculated.dist
- the distances for the edges.maxDist
- here the result will be stored.predicate
- only edges for which predicate is true are considered.public static EdgeList findLongestPath(Graph g)
g
- a directed acyclic graph
public static EdgeList findLongestPath(Graph g, DataProvider edgeLength)
g
- a directed acyclic graphedgeLength
- a data provider that must provide the length of each
edge as an int value
public static boolean findPath(Graph g, NodeList topSort, Node startNode, Node endNode, EdgeMap predicate)
g
- the acyclic graph which contains the two nodes.topSort
- a topological sorting of the nodes of the graph.predicate
- only edges for which predicate is true are considered.public static final void findAllPaths(Graph g, Node start, Node end, EdgeMap pathEdges)
start
to end
node.
g
- the input graphstart
- the start nodeend
- the end nodepathEdges
- the result. For each edge a boolean value will indicate whether or not
it belongs to a path connecting the two nodes.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |