Package dev.nm.graph.type
Class SparseDiGraph<V,E extends Arc<V>>
- java.lang.Object
-
- dev.nm.graph.type.SparseGraph<V,E>
-
- dev.nm.graph.type.SparseDiGraph<V,E>
-
- Type Parameters:
V
- vertex typeE
- edge type
- Direct Known Subclasses:
SparseDAGraph
public class SparseDiGraph<V,E extends Arc<V>> extends SparseGraph<V,E> implements DiGraph<V,E>
This class implements the sparse directed graph representation.
-
-
Constructor Summary
Constructors Constructor Description SparseDiGraph()
Construct an empty graph.SparseDiGraph(DiGraph<V,E> g)
(Copy) construct a graph from another graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<V>
children(V v)
Gets the set of all children of this vertex.Set<E>
incomingArcs(V v)
Gets the set of all incoming arcs associated with a vertex in this graph.Set<E>
outgoingArcs(V v)
Gets the set of all outgoing arcs associated with a vertex in this graph.Set<V>
parents(V v)
Gets the set of all parents of this vertex.String
toString()
SortedSet<V>
vertices()
Gets the set of all vertices in this graph, sorted by the number of parents.-
Methods inherited from class dev.nm.graph.type.SparseGraph
addEdge, addVertex, contains, edges, edges, removeEdge, removeVertex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface dev.nm.graph.Graph
addEdge, addVertex, edges, edges, removeEdge, removeVertex
-
-
-
-
Method Detail
-
outgoingArcs
public Set<E> outgoingArcs(V v)
Description copied from interface:DiGraph
Gets the set of all outgoing arcs associated with a vertex in this graph.
-
incomingArcs
public Set<E> incomingArcs(V v)
Description copied from interface:DiGraph
Gets the set of all incoming arcs associated with a vertex in this graph.
-
parents
public Set<V> parents(V v)
Description copied from interface:DiGraph
Gets the set of all parents of this vertex.
-
children
public Set<V> children(V v)
Description copied from interface:DiGraph
Gets the set of all children of this vertex.
-
vertices
public SortedSet<V> vertices()
Gets the set of all vertices in this graph, sorted by the number of parents. A root has no parents.
-
-