Graph<V, E> class
abstract
Abstract base class of graphs.
Constructors
- Graph()
- Generative constructor.
-
Graph.directed({StorageStrategy<
V> ? vertexStrategy}) -
Directed graph.
factory
-
Graph.undirected({StorageStrategy<
V> ? vertexStrategy}) -
Undirected graph.
factory
Properties
- defaultToStringPrinter → ObjectPrinter
-
Override to configure the empty ObjectPrinter.
no setterinherited
-
edges
→ Iterable<
Edge< V, E> > -
Returns the edges of this graph.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDirected → bool
-
Returns
true
if the graph is directed.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toStringPrinter → ObjectPrinter
-
Override and call super to add values to the ObjectPrinter.
no setteroverride
-
vertexStrategy
→ StorageStrategy<
V> -
Returns a strategy to store vertices.
no setter
-
vertices
→ Iterable<
V> -
Returns the vertices of this graph.
no setter
Methods
-
addEdge(
V source, V target, {E? data}) → void -
Adds an edge between
source
andtarget
vertex. Optionally associates the provideddata
with the edge. -
addVertex(
V vertex) → void -
Adds a
vertex
to this graph. -
edgesOf(
V vertex) → Iterable< Edge< V, E> > -
Returns the incoming and outgoing edges of
vertex
. -
getEdges(
V source, V target) → Iterable< Edge< V, E> > -
Returns the edges between
source
andtarget
. -
incomingEdgesOf(
V vertex) → Iterable< Edge< V, E> > -
Returns the incoming edges of
vertex
. -
neighboursOf(
V vertex) → Iterable< V> -
Returns the vertices that are adjacent to a
vertex
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
outgoingEdgesOf(
V vertex) → Iterable< Edge< V, E> > -
Returns the outgoing edges of
vertex
. -
predecessorsOf(
V vertex) → Iterable< V> -
Returns the vertices that come before a
vertex
. -
removeEdge(
V source, V target, {E? data}) → void -
Removes an edge between
source
andtarget
from this graph. -
removeVertex(
V vertex) → void -
Removes a
vertex
from this graph. -
successorsOf(
V vertex) → Iterable< V> -
Returns the vertices that come after a
vertex
. -
toString(
) → String -
Standard
toString
implementation. Do not override, instead implement toStringPrinter to customize.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited