The complement graph of a graph G is the graph G^c where any two vertcies are adjacent in G^c iff they are not adjacent in G. The original vertex set is preserved, only the edges are changed.
i1 : G = cycleGraph 4
o1 = Graph{0 => {1, 3}}
1 => {0, 2}
2 => {1, 3}
3 => {0, 2}
o1 : Graph
|
i2 : complementGraph G
o2 = Graph{0 => {2}}
1 => {3}
2 => {0}
3 => {1}
o2 : Graph
|
The object complementGraph is a method function.