# converting a named graph into a graph object

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

G=Part[GraphData[n],i]
GC=GraphComplement[G]
edges=EdgeList[GC]


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

• What happens if you try GraphComplement[GraphData[GraphData[n][[i]]]]? – J. M. is in limbo Jun 26 '16 at 11:18

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

where {"Wheel", 5} is the last element from GraphData[5].
The GraphData documentation page has many such examples.