Summary
An
adjacency_list is a
graph_representation that stores each vertex’s
vertex_neighbors. Its
space_complexity is
O_V_plus_E, so it suits
sparse_graphs. Neighbor iteration is efficient; you visit each neighbor once. Checking an edge can take time proportional to the vertex degree. It supports
directed_graphs and undirected graphs. For weights, store (neighbor, weight) pairs for
weighted_edges. Common implementations use arrays or vectors of lists or hash maps.