AllGraphs - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

AllGraphs

  

generate iterator to traverse all graphs meeting specified conditions

 

Calling Sequence

Parameters

Options

Description

Iterator Objects

Examples

Compatibility

Calling Sequence

AllGraphs(opts)

Parameters

opts

-

(optional) argument of the form option or option=value where option is one of vertices, edges, connected, directed, nonisomorphic.

Options

• 

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.

Description

• 

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.

Iterator Objects

• 

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).

Examples

iteratorGraphTheoryAllGraphsvertices=3,nonisomorphic

iteratorGraph IteratorVertices: 3..3Edges: 0..infinityconnected=false, directed=false, selfloops=false, nonisomorphic=true

(1)

iterator:-getNext

Graph 1: an undirected graph with 3 vertices and 0 edge(s)

(2)

iterator:-getNext

Graph 2: an undirected graph with 3 vertices and 1 edge(s)

(3)

iterator:-getNext

Graph 3: an undirected graph with 3 vertices and 2 edge(s)

(4)

iterator:-getNext

Graph 4: an undirected graph with 3 vertices and 3 edge(s)

(5)

iterator:-hasNext

false

(6)

Compatibility

• 

The GraphTheory[AllGraphs] command was introduced in Maple 2024.

• 

For more information on Maple 2024 changes, see Updates in Maple 2024.

See Also

GraphTheory

GraphTheory[Graph]

ModuleIterator