Graph database

This is a module for providing common types of graphs.

pyrigi.graphDB.CnSymmetricFourRegular(n=8)[source]

Return a \(C_n\)-symmetric 4-regular graph.

The value n must be even and at least 8.

Return type:

Graph

Parameters:

n (int)

Definitions

pyrigi.graphDB.CnSymmetricWithFixedVertex(n=8)[source]

Return a \(C_n\)-symmetric graph with a fixed vertex.

The value n must be even and at least 8.

The returned graph satisfies the expected symmetry-adapted Laman count for rotation but is (generically) infinitesimally flexible.

Return type:

Graph

Parameters:

n (int)

Definitions

Example with joint at origin

pyrigi.graphDB.Complete(n=None, vertices=None)[source]

Return the complete graph on n vertices.

The vertex labels can also be specified explicitly via the keyword vertices.

Parameters:
  • n (int) – The number of vertices.

  • vertices (Sequence[Hashable]) – An optional parameter for the vertices.

Return type:

Graph

Examples

>>> print(Complete(5))
Graph with vertices [0, 1, 2, 3, 4] and edges [[0, 1], [0, 2], [0, 3], [0, 4], [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
>>> print(Complete(5, [0, 1, 2, 3, 4]))
Graph with vertices [0, 1, 2, 3, 4] and edges [[0, 1], [0, 2], [0, 3], [0, 4], [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]
>>> print(Complete(vertices=['a', 'b', 'c', 'd']))
Graph with vertices ['a', 'b', 'c', 'd'] and edges [['a', 'b'], ['a', 'c'], ['a', 'd'], ['b', 'c'], ['b', 'd'], ['c', 'd']]
pyrigi.graphDB.CompleteBipartite(n1, n2)[source]

Return the complete bipartite graph on n1+n2 vertices.

Return type:

Graph

Parameters:
pyrigi.graphDB.CompleteMinusOne(n)[source]

Return the complete graph on n vertices minus one edge.

Return type:

Graph

Parameters:

n (int)

pyrigi.graphDB.CubeWithDiagonal()[source]

Return the graph given by the skeleton of the cube with a main diagonal.

Return type:

Graph

pyrigi.graphDB.Cycle(n)[source]

Return the cycle graph on n vertices.

Return type:

Graph

Parameters:

n (int)

pyrigi.graphDB.Diamond()[source]

Return the complete graph on 4 vertices minus an edge.

Return type:

Graph

pyrigi.graphDB.Dodecahedral()[source]

Return the graph given by the skeleton of a dodecahedron.

Return type:

Graph

pyrigi.graphDB.DoubleBanana(dim=3, t=2)[source]

Return the dim-dimensional double banana graph.

Definitions

Generalized Double Banana

Parameters:
  • dim (int) – An integer greater or equal 3.

  • t (int) – An integer such that 2 <= t <= dim-1.

Return type:

Graph

Examples

>>> print(DoubleBanana())
Graph with vertices [0, 1, 2, 3, 4, 5, 6, 7] and edges [[0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [2, 3], [2, 4], [3, 4], [5, 6], [5, 7], [6, 7]]
>>> print(DoubleBanana(dim = 4))
Graph with vertices [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and edges [[0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [0, 8], [0, 9], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [1, 7], [1, 8], [1, 9], [2, 3], [2, 4], [2, 5], [3, 4], [3, 5], [4, 5], [6, 7], [6, 8], [6, 9], [7, 8], [7, 9], [8, 9]]
pyrigi.graphDB.Frustum(n)[source]

Return the n-Frustum graph.

Return type:

Graph

Parameters:

n (int)

Definitions

n-Frustum graph

pyrigi.graphDB.Icosahedral()[source]

Return the graph given by the skeleton of an icosahedron.

Return type:

Graph

pyrigi.graphDB.K33plusEdge()[source]

Return the complete bipartite graph on 3+3 vertices with an extra edge.

Return type:

Graph

pyrigi.graphDB.K66MinusPerfectMatching()[source]

Return the complete bipartite graph minus a perfect matching.

A matching is formed by six non-incident edges.

Return type:

Graph

pyrigi.graphDB.Octahedral()[source]

Return the graph given by the skeleton of an octahedron.

Return type:

Graph

pyrigi.graphDB.Path(n)[source]

Return the path graph with n vertices.

Return type:

Graph

Parameters:

n (int)

pyrigi.graphDB.ThreeConnectedR3Circuit()[source]

Return a 3-connected \(R_3\)-circuit.

The returned graph is hypothesized to be the smallest 3-connected \(R_3\)-circuit.

Return type:

Graph

pyrigi.graphDB.ThreePrism()[source]

Return the 3-prism graph.

Return type:

Graph

pyrigi.graphDB.ThreePrismPlusEdge()[source]

Return the 3-prism graph with one extra edge.

Return type:

Graph

pyrigi.graphDB.Wheel(n)[source]

Create the wheel graph on n+1 vertices.

Return type:

Graph

Parameters:

n (int)