networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
mycielskian(G, iterations=1)

The Mycielskian of graph preserves a graph's triangle free property while increasing the chromatic number by 1.

The Mycielski Operation on a graph, $G=(V, E)$ , constructs a new graph with $2|V| + 1$ nodes and $3|E| + |V|$ edges.

The construction is as follows:

Let $V = {0, ..., n-1}$ . Construct another vertex set $U = {n, ..., 2n}$ and a vertex, :None:None:`w`. Construct a new graph, M, with vertices $U \bigcup V \bigcup w$ . For edges, $(u, v) \in E$ add edges $(u, v), (u, v + n)$ , and $(u + n, v)$ to M. Finally, for all vertices $u \in U$ , add edge $(u, w)$ to M.

The Mycielski Operation can be done multiple times by repeating the above process iteratively.

More information can be found at https://en.wikipedia.org/wiki/Mycielskian

Notes

Graph, node, and edge data are not necessarily propagated to the new graph.

Parameters

G : graph

A simple, undirected NetworkX graph

iterations : int

The number of iterations of the Mycielski operation to perform on G. Defaults to 1. Must be a non-negative integer.

Returns

M : graph

The Mycielskian of G after the specified number of iterations.

Returns the Mycielskian of a simple, undirected graph G

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/generators/mycielski.py#12
type: <class 'function'>
Commit: