I am seeking the edge lists of the complements of named graphs on n vertices. At first sight I would use


However GraphComplement requires a graph object. How do I convert G into an object accepted by GraphComplement? Thank you.

  • 1
    $\begingroup$ What happens if you try GraphComplement[GraphData[GraphData[n][[i]]]]? $\endgroup$ Jun 26, 2016 at 11:18

1 Answer 1


GraphData[5] returns a list of specifications of graphs with 5 vertices. Apply GraphData again to such a specification to get an actual graph.

For example,

GraphData[{"Wheel", 5}]

where {"Wheel", 5} is the last element from GraphData[5].

The GraphData documentation page has many such examples.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.