Posted inComputer Science Data Structures Graphs
How to Represent Undirected Weighted Graphs Using Edge Lists
Learn the edge list representation for undirected weighted graphs. Build a vertex list and an edge list of triples that store both endpoints and the weight of each edge. Convert the list to use indexes so node lookups become constant time when the vertices are stored in a vector or array. This approach keeps each undirected edge only once and improves the speed of operations that need both edges and nodes.
