G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.public class SpanningTree<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
get(G graph)
Construct a spanning tree for the given graph.
|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
get(G graph,
N startNode)
Construct a spanning tree for the given graph.
|
java.util.Set<E> |
getChords()
Get the chords of the spanning tree.
|
java.util.List<E> |
getEdgePathFromStart(N node)
Get the path from the start node.
|
G |
getGraph() |
java.util.List<N> |
getNodePathFromStart(N node)
Get the path from the start node.
|
N |
getPredecessor(N node)
Get the predecessor in the tree.
|
E |
getPredecessorEdge(N node)
Get the edge via which the given node is reached in the tree.
|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
getReversed(G graph)
Construct a spanning tree for the given graph with arcs reversed.
|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
getReversed(G graph,
N startNode)
Construct a spanning tree for the given graph with arcs reversed.
|
N |
getStartNode() |
java.util.Set<N> |
getUnreachableNodes()
Get all the nodes in the graph which are not reachable from the start node.
|
boolean |
isReachable(N node)
Check if the given node is reachable.
|
boolean |
isTotallyReachable()
Check if the underlying graph is totally reachable.
|
public static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SpanningTree<G,E,N> get(G graph)
G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.graph - The graph for which a spanning tree should be constructed.public static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SpanningTree<G,E,N> getReversed(G graph)
G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.graph - The graph for which a spanning tree should be constructed.public static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SpanningTree<G,E,N> get(G graph, N startNode)
G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.graph - The graph for which a spanning tree should be constructed.startNode - The start node for the spanning tree.public static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SpanningTree<G,E,N> getReversed(G graph, N startNode)
G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.graph - The graph for which a spanning tree should be constructed.startNode - The start node for the spanning tree.public boolean isReachable(N node)
node - The node to check.public boolean isTotallyReachable()
public java.util.Set<N> getUnreachableNodes()
public N getPredecessor(N node)
node - The node whose predecessor should be returned.public E getPredecessorEdge(N node)
node - The node whose predecessor edge should be returned.public java.util.List<E> getEdgePathFromStart(N node)
node - The node whose path to return.public java.util.List<N> getNodePathFromStart(N node)
node - The node whose path to return.public java.util.Set<E> getChords()
public N getStartNode()
public G getGraph()