complement of a graph
g1 = graph_complement(g,[gmax])
:a optional graph data structure.
graph data structure of the new graph
The complement of a graph g is the graph g1 with the same node set but whose edge set consists of the edges not present in g (i.e., the complement of the edge set of g with respect to all possible edges on the vertex set of G).
graph_complement
returns the undirected graph
g1
which is the complement of the graph
g
with respect to the corresponding complete graph.
When gmax
is given, the complement is made with
respect to gmax
. g
and
gmax
are supposed to be simple graphs (use
graph_simp
before calling
graph_complement
if necessary) and to have the same
number of nodes.