How to Represent Undirected Weighted Graphs Using Edge Lists

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.
Graph Connectedness Explained: Connected Strongly Connected and Weakly Connected

Graph Connectedness Explained: Connected Strongly Connected and Weakly Connected

This video explains graph connectedness for both undirected and directed graphs. For undirected graphs a connected graph means every node can reach every other node through a path. Disconnected graphs have nodes that cannot reach others and may contain separate subgraphs. For directed graphs the terms change to strongly connected where every node reaches every other node following edge directions and weakly connected where the graph is connected if directions are ignored. Step by step examples show how adding edges turns a graph from not connected to weakly connected and finally to strongly connected.