GraphFactory<V, E> class
Factory methods to create common graphs types efficiently.
Constructors
-
GraphFactory.new({bool isDirected = true, bool isUnmodifiable = false, V vertexProvider(int index)?, E edgeProvider(V source, V target)?, Random? random, StorageStrategy<
V> ? vertexStrategy})
Properties
- edgeProvider → E Function(V source, V target)?
-
Optional provider of edge data.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDirected → bool
-
Flag indicating if the graph is directed.
final
- isUnmodifiable → bool
-
Flag indicating if the resulting graph can be further modified.
final
- random → Random
-
Random generator used when creating random graphs.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- vertexProvider → V Function(int index)?
-
Optional provider of vertex data.
final
-
vertexStrategy
→ StorageStrategy<
V> -
The strategy describing how vertices are stored.
final
Methods
-
atlas(
int number) → Graph< V, E> -
Available on GraphFactory<
Returns a graph from "An Atlas of Graphs" by Ronald C. Read and Robin J. Wilson, Oxford University Press, 1998.V, E> , provided by the AtlasGraphFactoryExtension extensionnumber
is a number between0
and1252
. -
atlasMatching(
{int? vertexCount, int? edgeCount}) → Iterable< Graph< V, E> > -
Available on GraphFactory<
Returns an iterable over all the graphs in the atlas with the providedV, E> , provided by the AtlasGraphFactoryExtension extensionvertexCount
(from0
to7
) andedgeCount
(from0
to21
), see atlas for details. -
complete(
{required int vertexCount}) → Graph< V, E> -
Available on GraphFactory<
Creates a complete Graph where all vertices are connected with each other.V, E> , provided by the CompleteGraphFactoryExtension extension -
completeTree(
{required int vertexCount, int arity = 2}) → Graph< V, E> -
Available on GraphFactory<
Creates a complete tree withV, E> , provided by the TreeGraphFactoryExtension extensionvertexCount
nodes and a branching factor ofarity
. By definition it is completely filled on every level except for the last one; where all the nodes are as far left as possible. -
empty(
) → Graph< V, E> -
Available on GraphFactory<
Creates an empty graph.V, E> , provided by the EmptyGraphFactoryExtension extension -
fromPath(
Iterable< V> chain, {E? value}) → Graph<V, E> -
Available on GraphFactory<
Creates a Graph from a Iterable of chains.V, E> , provided by the CollectionGraphFactoryExtension extension -
fromPaths(
Iterable< Iterable< chains, {E? value}) → Graph<V> >V, E> -
Available on GraphFactory<
Creates a Graph from a Iterable of chains.V, E> , provided by the CollectionGraphFactoryExtension extension -
fromPredecessorFunction(
Iterable< V> vertices, Iterable<V> predecessors(V vertex)) → Graph<V, E> -
Available on GraphFactory<
Creates a Graph from startV, E> , provided by the CollectionGraphFactoryExtension extensionvertices
and a functionpredecessors
returning its preceding vertices (incoming adjacency). -
fromPredecessors(
Map< V, Iterable< mapping) → Graph<V> ?>V, E> -
Available on GraphFactory<
Creates a Graph from a Map of vertices pointing to an Iterable of preceding vertices (incoming adjacency).V, E> , provided by the CollectionGraphFactoryExtension extension -
fromSuccessorFunction(
Iterable< V> vertices, Iterable<V> successors(V vertex)) → Graph<V, E> -
Available on GraphFactory<
Creates a Graph from startV, E> , provided by the CollectionGraphFactoryExtension extensionvertices
and a functionsuccessors
returning its succeeding vertices (outgoing adjacency). -
fromSuccessors(
Map< V, Iterable< mapping) → Graph<V> ?>V, E> -
Available on GraphFactory<
Creates a Graph from a Map of vertices pointing to an Iterable of succeeding vertices (outgoing adjacency).V, E> , provided by the CollectionGraphFactoryExtension extension -
newBuilder(
) → GraphBuilder< V, E> - Internal graph builder based on this configuration.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
partite(
{required Iterable< int> vertexCounts}) → Graph<V, E> -
Available on GraphFactory<
Creates a partite Graph with a number of vertices on each layer.V, E> , provided by the PartiteGraphFactoryExtension extension -
path(
{required int vertexCount}) → Graph< V, E> -
Available on GraphFactory<
Creates a Graph that forms a linear path.V, E> , provided by the PathGraphFactoryExtension extension -
prefectTree(
{required int height, int arity = 2}) → Graph< V, E> -
Available on GraphFactory<
Creates a perfectly balanced tree ofV, E> , provided by the TreeGraphFactoryExtension extensionheight
and a branching factor ofarity
. In the resulting tree all leaf nodes are at the same depth. -
randomErdosRenyi(
{required int vertexCount, required double probability}) → Graph< V, E> -
Available on GraphFactory<
Generates a graph using the Erdős–Rényi model withV, E> , provided by the RandomGraphFactoryExtension extensionvertexCount
vertices and a constantprobability
of creating an edge between any pair of vertices. -
ring(
{required int vertexCount}) → Graph< V, E> -
Available on GraphFactory<
Creates a Graph that forms a closed ring.V, E> , provided by the RingGraphFactoryExtension extension -
star(
{required int vertexCount}) → Graph< V, E> -
Available on GraphFactory<
Creates a Graph that forms a star.V, E> , provided by the StarGraphFactoryExtension extension -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited