paley_graph#
- paley_graph(p, create_using=None)[source]#
Returns the Paley
-regular graph on nodes.The returned graph is a graph on
with edges between and if and only if is a nonzero square in .If
, is a square in and therefore is a square if and only if is also a square, i.e the edges in the Paley graph are symmetric.If
, is not a square in and therefore either or is a square in but not both.Note that a more general definition of Paley graphs extends this construction to graphs over
vertices, by using the finite field instead of . This construction requires to compute squares in general finite fields and is not what is implemented here (i.epaley_graph(25)
does not return the true Paley graph associated with ).- Parameters:
- pint, an odd prime number.
- create_usingNetworkX graph constructor, optional (default=nx.Graph)
Graph type to create. If graph instance, then cleared before populated.
- Returns:
- Ggraph
The constructed directed graph.
- Raises:
- NetworkXError
If the graph is a multigraph.
References
Chapter 13 in B. Bollobas, Random Graphs. Second edition. Cambridge Studies in Advanced Mathematics, 73. Cambridge University Press, Cambridge (2001).