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