Think Like A Programmer

Share this post

User's avatar
Think Like A Programmer
Graphs

Graphs

One of the most flexible data structures there is

BowTiedHamachi's avatar
BowTiedHamachi
Dec 24, 2022
∙ Paid

Share this post

User's avatar
Think Like A Programmer
Graphs
Share

Welcome to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you. In today’s article, we’ll be looking at graphs - a data structure which can be used to represent connections or relationships between different objects.

Personally, I think graphs are extremely useful in computer science - and they’re probably significantly more useful than you think!

Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Analogy

Imagine you’re going to a new theme park and you see the following map

Theme Park Map Amusement Day Out Building Maths KS2

We can mark out potential places of interest with a circle as seen below. In this example, I’ve chosen 5 random places and marked them out.

There are also some roads that connect the individual attraction so let’s use some lines to represent these roads

Each line here represents a direct path that connects the two nodes without going through another attraction

Now that we have this specific representation, what can we do with it?

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 BowTiedHamachi
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share