graphscope.nx.generators.expanders.chordal_cycle_graph#

graphscope.nx.generators.expanders.chordal_cycle_graph(p, create_using=None)[source]#

Returns the chordal cycle graph on p nodes.

The returned graph is a cycle graph on p nodes with chords joining each vertex x to its inverse modulo p. This graph is a (mildly explicit) 3-regular expander [1].

p must be a prime number.

Parameters:
  • p (a prime number) – The number of vertices in the graph. This also indicates where the chordal edges in the cycle will be created.

  • create_using (NetworkX graph constructor, optional (default=nx.Graph)) – Graph type to create. If graph instance, then cleared before populated.

Returns:

G – The constructed undirected multigraph.

Return type:

graph

Raises:

NetworkXError – If create_using indicates directed or not a multigraph.

References