|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.algo.GraphConnectivity
Provides algorithms for determining certain connectivity components within a graph. Also provides conveniance method for working with these components.
Constructor Summary | |
GraphConnectivity()
|
Method Summary | |
static EdgeList[] |
biconnectedComponents(Graph graph)
Calculates the biconnected components of a given undirected graph. |
static int |
biconnectedComponents(Graph graph,
EdgeMap compNum)
Calculates the biconnected components of a given undirected graph. |
static int |
biconnectedComponents(Graph graph,
EdgeMap compNum,
NodeMap aPoint)
Like GraphConnectivity.biconnectedComponents(Graph, EdgeMap) . |
static NodeList[] |
connectedComponents(Graph graph)
Returns the connected components of a given graph. |
static int |
connectedComponents(Graph graph,
NodeMap compNum)
Returns the connected components of a given graph. |
static boolean |
isBiconnected(Graph graph)
Checks whether or not the given graph his biconnected. |
static boolean |
isConnected(Graph graph)
Checks whether or not the given graph his connected. |
static EdgeList |
makeBiconnected(Graph graph)
Makes the given graph biconnected by inserting a minimum number of edges in the graph. |
static EdgeList |
makeConnected(Graph graph)
Makes a graph connected by adding additional edges to the graph. |
static void |
reachable(Graph graph,
Node start,
boolean directed,
boolean[] reached)
Determines the set of nodes that can be reached in the given graph when starting from a given node. |
static void |
reachable(Graph graph,
Node start,
boolean directed,
boolean[] forbidden,
boolean[] reached)
Similar to GraphConnectivity.reachable(Graph,Node,boolean,boolean[]) . |
static EdgeList[] |
toEdgeListArray(Graph graph,
EdgeMap compNum,
int maxCompNum)
Transforms the return values of GraphConnectivity.biconnectedComponents(Graph, EdgeMap) to
an array of type EdgeList, like it is returned by
GraphConnectivity.biconnectedComponents(Graph) . |
static NodeList[] |
toNodeListArray(Graph graph,
NodeMap compNum,
int maxCompNum)
Transforms the return values of GraphConnectivity.connectedComponents(Graph, NodeMap) to
an array of type NodeList, like it is returned by
GraphConnectivity.connectedComponents(Graph) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphConnectivity()
Method Detail |
public static NodeList[] connectedComponents(Graph graph)
G
is called connected if there is an
undirected path between each pair of nodes belonging to G
.
The connected components of G
are connected
subgraphs that G
consists of.
graph
- the input graph
public static int connectedComponents(Graph graph, NodeMap compNum)
G
is called connected if there is an
undirected path between each pair of nodes belonging to G
.
The connected components of G
are connected
subgraphs that G
consists of.
graph
- the input graphcompNum
- return value that will hold the zero-based number
of the connected component that it belongs to. The component number of
Node v
is compNum.getInt()
.
public static EdgeList makeConnected(Graph graph)
graph
- the input graph
public static NodeList[] toNodeListArray(Graph graph, NodeMap compNum, int maxCompNum)
GraphConnectivity.connectedComponents(Graph, NodeMap)
to
an array of type NodeList, like it is returned by
GraphConnectivity.connectedComponents(Graph)
.
public static boolean isConnected(Graph graph)
public static EdgeList[] biconnectedComponents(Graph graph)
graph
- the input graphpublic static int biconnectedComponents(Graph graph, EdgeMap compNum)
graph
- the input graphcompNum
- return value that provides for each edge a zero-based index of the
biconnected component it belongs to.
public static int biconnectedComponents(Graph graph, EdgeMap compNum, NodeMap aPoint)
GraphConnectivity.biconnectedComponents(Graph, EdgeMap)
. Additionally this method
calculates the articulation points of the input graph. Articulation points are
returned in the form of a NodeMap that provides for each node a boolean value
indicating whether or not it is an articulation point.
aPoint
- return value that provides for each node a boolean value
indicating whether or not it is an articulation point.public static EdgeList[] toEdgeListArray(Graph graph, EdgeMap compNum, int maxCompNum)
GraphConnectivity.biconnectedComponents(Graph, EdgeMap)
to
an array of type EdgeList, like it is returned by
GraphConnectivity.biconnectedComponents(Graph)
.
public static EdgeList makeBiconnected(Graph graph)
graph
- the input graph
public static boolean isBiconnected(Graph graph)
public static void reachable(Graph graph, Node start, boolean directed, boolean[] reached)
graph
- the graph the search is performed onstart
- the node the search is started fromdirected
- traverses edges only from source to target if true
. Otherwise
traverses edges in both directions.reached
- the return value. a boolean array that has value true
at field
v.index()
iff node v can be reached by the dfs search.public static void reachable(Graph graph, Node start, boolean directed, boolean[] forbidden, boolean[] reached)
GraphConnectivity.reachable(Graph,Node,boolean,boolean[])
. Additionally
it is possible to specify a set of forbidden edges that will not be traversed
when performing the search.
graph
- the graph DFS is performed onstart
- the node DFS is started fromdirected
- traverses edges only from source to target if true
. Otherwise
traverses edges in both directions.forbidden
- marks edges that may not be traversed by DFS. An edge e
is marked as forbidden if forbidden[e.index()] == true
.reached
- the return value. a boolean array that has value true
at field
v.index()
iff node v can be reached by the dfs search.
|
© 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 |