Constructor and Description |
---|
SparseDAGraph()
Construct an empty directed acyclic graph.
|
SparseDAGraph(boolean toCheckCyclicity)
Construct an empty directed acyclic graph.
|
SparseDAGraph(DAGraph<V,E> g)
(Copy) construct a directed acyclic graph from another directed acyclic graph.
|
Modifier and Type | Method and Description |
---|---|
SparseDAGraph<V,E> |
addEdge(E e)
Adds an edge to this graph.
|
boolean |
isAcyclic()
Runs validity check to ensure that this DA graph is indeed acyclic.
|
int |
topologicalOrder(V v)
Get the topological order of a vertex.
|
children, incomingArcs, outgoingArcs, parents, toString, vertices
addVertex, contains, edges, edges, removeEdge, removeVertex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
children, incomingArcs, outgoingArcs, parents
addVertex, edges, edges, removeEdge, removeVertex, vertices
public SparseDAGraph(boolean toCheckCyclicity)
toCheckCyclicity
- true
if to check cyclicity each time an edge is added (slow
performance)public SparseDAGraph()
public SparseDAGraph<V,E> addEdge(E e)
Graph
e
is already in the graph.
If the edge contains new vertices, those will be added to the graph.public int topologicalOrder(V v)
DAGraph
public boolean isAcyclic()
true
if this graph is acyclicCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.