What is graph?

A graph is like a map that shows how things are connected to each other.

Imagine you have a toy box full of different toys, cars, blocks, and action figures. Now, think about how these toys can be linked: maybe your car drives on the road made from blocks, or your action figure plays with both. A graph is like drawing lines between these toys to show who's connected to whom.

How a graph works

In a graph, each toy (or person, or place) is called a node, it’s like a dot that represents something important. The line you draw between them is called an edge, it shows the connection.

You can have as many nodes and edges as you want! A graph could be simple, with just two toys connected by one road, or super complicated, like a city map with hundreds of streets and buildings.

Why graphs are useful

Graphs help us understand how things relate to each other. They're used in real life too, for example, when planning the best route for a delivery truck, or showing friendships on social media. It’s just like making a game plan for your toys!

Take the quiz →

Examples

  1. A group of friends where each person is connected to others they know
  2. A map showing cities and the roads that connect them
  3. A family tree showing how people are related

Ask a question

See also

Discussion

Recent activity