| 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, verticesaddVertex, contains, edges, edges, removeEdge, removeVertexclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchildren, incomingArcs, outgoingArcs, parentsaddVertex, edges, edges, removeEdge, removeVertex, verticespublic 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)
Graphe is already in the graph.
If the edge contains new vertices, those will be added to the graph.public int topologicalOrder(V v)
DAGraphpublic boolean isAcyclic()
true if this graph is acyclicCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.