Posted inComputer Science Data Structures Graphs
How to Represent an Unweighted Undirected Graph with an Edge List
Represent an unweighted undirected graph as a tuple of a vertex list and an edge list. Store nodes as indexable objects and list each edge once as a pair of indexes so you can reach any vertex in constant time.
