generalized_petersen_graph#

generalized_petersen_graph(n, k, *, create_using=None)[source]#

Returns the Generalized Petersen Graph GP(n,k).

The Generalized Peterson Graph consists of an outer cycle of n nodes connected to an inner circulant graph of n nodes, where nodes in the inner circulant are connected to their kth nearest neighbor [1] [2]. A Generalized Petersen Graph is cubic with 2n nodes and 3n edges.

Some well known graphs are examples of Generalized Petersen Graphs such as the Petersen Graph GP(5, 2), the Desargues graph GP(10, 3), the Moebius-Kantor graph GP(8, 3), and the dodecahedron graph GP(10, 2).

Parameters:
nint

Number of nodes in the outer cycle and inner circulant. n >= 3 is required.

kint

Neighbor to connect in the inner circulant. 1 <= k <= n/2. Note that some people require k < n/2 but we and others allow equality. Also, k < n/2 is equivalent to k <= floor((n-1)/2)

create_usingNetworkX graph constructor, optional (default=nx.Graph)

Graph type to create. If graph instance, then cleared before populated.

Returns:
Gnetworkx Graph

Generalized Petersen Graph n k

References