The word "graph" causes genuine confusion the first time a programmer hears it, because everyday English already uses it for something else entirely — a bar graph, a line graph, a chart with an x-axis and a y-axis. Set that meaning aside completely. A graph in computer science is a map of things and the connections between them: dots, called nodes (or vertices), connected by lines, called edges.

Picture a map of cities connected by roads: each city is a node, and each road connecting two cities is an edge. That's a complete, correct mental model for a graph — nothing about it requires an axis, a scale, or plotted data points. A social network is a graph where people are nodes and friendships are edges. A website is a graph where pages are nodes and links between them are edges. Anything that's naturally describable as "these things, and which of them connect to which" is a graph.

Two properties are worth knowing because they change what a graph can represent. An edge can be directed, meaning the connection only goes one way — a one-way street, or a "follows" relationship on social media where you can follow someone without them following you back — or undirected, meaning the connection goes both ways equally, like a real friendship or a two-way road. An edge can also carry a weight, a number representing cost or distance — the length of a road in miles, or the delay on a network link — which is exactly what makes "find the shortest route" a question a graph can answer at all, covered in this site's article on Dijkstra's algorithm.

Graphs matter to programmers because a huge number of real problems are secretly graph problems once you notice the shape: routing GPS directions, ranking search results by how pages link to each other, recommending a "you might also know" contact based on mutual friends, scheduling tasks that depend on other tasks finishing first. None of these look like a grid of numbers or a list of items — they look like relationships, which is precisely the shape a graph is built to represent.

Once a graph reads as "dots and the lines between them" instead of a chart with an axis, the rest of graph theory — traversal, shortest paths, trees as a special restricted case, all covered elsewhere in this category — is really just different questions asked about that same simple picture.

ABCD
Four nodes and four edges — dots and the connections between them, no axis or chart involved.