Graph Complement

Author

Eric W. Weisstein
May 31, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/GraphComplement.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/GraphComplement.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Usage

?GraphComplement

RandomGraph[10,.5]//FullForm

g=Graph[List[List[List[1,3]],List[List[2,3]],List[List[3,4]],List[List[2,5]],List[List[3,5]],List[List[1,6]],List[List[2,6]],List[List[3,6]],List[List[4,6]],List[List[4,7]],List[List[5,7]],List[List[6,7]],List[List[1,8]],List[List[3,8]],List[List[4,8]],List[List[5,8]],List[List[7,8]],List[List[2,9]],List[List[3,9]],List[List[4,9]],List[List[8,9]],List[List[2,10]],List[List[3,10]],List[List[4,10]],List[List[9,10]]],List[List[List[0.8090169943749475`,0.5877852522924731`]],List[List[0.3090169943749475`,0.9510565162951535`]],List[List[-0.30901699437494734`,0.9510565162951536`]],List[List[-0.8090169943749473`,0.5877852522924732`]],List[List[-1.`,0]],List[List[-0.8090169943749476`,-0.587785252292473`]],List[List[-0.3090169943749476`,-0.9510565162951535`]],List[List[0.30901699437494723`,-0.9510565162951536`]],List[List[0.8090169943749472`,-0.5877852522924734`]],List[List[1.`,0]]]];

ShowGraphArray[{
g1=SetGraphOptions[g,EdgeColor->Red],
SetGraphOptions[g2=GraphComplement[g],EdgeColor->Blue],
SetGraphOptions[GraphSum[g1,g2],Join[Edges[g2],{EdgeColor->Blue}]]},VertexStyle->Disk[.05]]