V
- vertex typepublic abstract class TraversalFromRoots<V> extends Object implements GraphTraversal<V>
GraphTraversal.Node<V>
Modifier and Type | Field and Description |
---|---|
protected Graph<? extends V,? extends Edge<V>> |
g |
Constructor and Description |
---|
TraversalFromRoots(Graph<? extends V,? extends Edge<V>> g)
Constructs a traversal order of a graph.
|
Modifier and Type | Method and Description |
---|---|
List<? extends GraphTraversal.Node<V>> |
getOrderedNodes()
Gets the collection of visited nodes to build a spanning tree.
|
abstract List<? extends GraphTraversal.Node<V>> |
track(V root,
int time)
Runs the traversal algorithm on a graph from a designated root.
|
List<V> |
traverse(V root,
int time)
Runs the traversal algorithm on a graph from a designated root.
|
public abstract List<? extends GraphTraversal.Node<V>> track(V root, int time)
root
- a roottime
- the initial timepublic List<V> traverse(V root, int time)
root
- a roottime
- the initial timepublic List<? extends GraphTraversal.Node<V>> getOrderedNodes()
getOrderedNodes
in interface GraphTraversal<V>
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.