Graph representation is the encoding of a problem domain as a set of nodes (vertices) connected by edges, capturing entities and the relationships between them. It enables algorithmic reasoning over connectivity, distance, and structure, and underpins pathfinding, routing, and topological analysis. Common concrete forms include adjacency matrices, adjacency lists, and edge lists.
Content
- The choice of representation drives performance: adjacency matrices give O(1) edge lookups at O(V^2) space, while adjacency lists are sparse-friendly. Graphs may be directed, weighted, or labelled, and form the foundation for shortest-path search, network analysis, and knowledge-graph storage.