You know what a graph looks like on paper: circles and lines. But how do you tell a C++ program about it? A computer only understands numbers and arrays.
You need a data structure that answers questions like: "Is there an edge between and ?" or "What are all neighbors of node ?" Two main approaches exist: the Adjacency Matrix and the Adjacency List. Each has trade-offs in memory, speed, and simplicity. Choosing the right one depends on your graph's density.