Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

rustworkx.graph_complement#

graph_complement(graph, /)#

Compute the complement of an undirected graph.

Parameters:

graph (PyGraph) – The graph to be used.

Returns:

The complement of the graph.

Return type:

PyGraph

Note

Parallel edges and self-loops are never created, even if the multigraph attribute is set to True