|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.algo.Paths
public class Paths
Reponsible for finding paths within a graph that have certain properties.
![]() |
![]() |
| Constructor Summary | |
|---|---|
Paths()
|
|
| Method Summary | |
|---|---|
static NodeList |
constructNodePath(EdgeList path)
Constructs a node path from a given edge path. |
static EdgeList[] |
findAllChains(Graph graph,
boolean directed)
Returns all chains present in the given graph. |
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)
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)
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 NodeList constructNodePath(EdgeList path)
path.size()+1, if the given path is not empty.
Otherwise the returned path will be empty. The i-th node in the
retured path will be either source or target node of the i-th edge
in the given path.
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.
public static EdgeList[] findAllChains(Graph graph,
boolean directed)
graph - the input graph
constructNodePath(EdgeList) can be used to convert an edge path
to a node path.
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||