GraphTheory
AllGraphs
generate iterator to traverse all graphs meeting specified conditions
Calling Sequence
Parameters
Options
Description
Iterator Objects
Examples
Compatibility
AllGraphs(opts)
opts
-
(optional) argument of the form option or option=value where option is one of vertices, edges, connected, directed, nonisomorphic.
vertices=nonnegative integer or range, size of graphs appearing in the iteration
Specifies the size of graphs that appear in the resulting iteration.
edges=nonnegative integer or range, edge count of graphs appearing in the iteration
Specifies the edge count of graphs that appear in the resulting iteration.
connected=truefalse
If true, specifies that only connected graphs should appear in the iteration.
directed=truefalse
Specifies whether the returned graphs should be directed or undirected.
nonisomorphic=truefalse
If true, specifies that only one representative of each isomorphic class should appear in the iteration.
The AllGraphs(opts) command returns an iterator object which can be used to traverse all graphs meeting the specified conditions.
With each step, the iterator object will return a Graph object.
The iterator object is an Iterator with hasNext and getNext methods as defined by the Iterator API.
The state of an iterator object iter may be reset to the beginning of the iteration by invoking Reset(iter).
iterator≔GraphTheoryAllGraphs⁡vertices=3,nonisomorphic
iterator≔Graph IteratorVertices: 3..3Edges: 0..infinityconnected=false, directed=false, selfloops=false, nonisomorphic=true
iterator:-getNext⁡
Graph 1: an undirected graph with 3 vertices and 0 edge(s)
Graph 2: an undirected graph with 3 vertices and 1 edge(s)
Graph 3: an undirected graph with 3 vertices and 2 edge(s)
Graph 4: an undirected graph with 3 vertices and 3 edge(s)
iterator:-hasNext⁡
false
The GraphTheory[AllGraphs] command was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
See Also
GraphTheory[Graph]
ModuleIterator
Download Help Document