top of page


Welcome to the Graph articles page. Find all the programs used to solve various problems using graphs. We hope these articles help you "plot" your computer science knowledge.
Graph


Sparse vs Dense Graphs — Know Your Connections
Imagine two cities. City A has just a few roads connecting important areas. City B has a road between almost every pair of places. Both...


Bipartite Graph — Color It, Don’t Fight It
Let’s say you’re forming two teams from a group of people, where some people just can’t work together . Your job is to split them into...


Kosaraju’s Algorithm — Breaking Down the Graph into Strong Pieces
Let’s say you’re looking at a giant network of cities. You want to find groups of cities where each one is reachable from every other in...


Topological Sort — The “What Comes First” Guide
Let’s say you’re baking a cake 🎂. You must mix ingredients before baking , and you can’t bake before heating the oven . You need a clear...


Floyd-Warshall Algorithm—All Paths, All at Once
Imagine you’re building a global travel app 🌍. You don’t just want the shortest route from A to B— you want the shortest path between...


Bellman-Ford Algorithm—The GPS That Handles Bad Roads Too
Let’s say you're planning a road trip. Some roads give you shortcuts, but others are so bad that they cost you negative time . Dijkstra...


Breadth-First Search (BFS) — Explore Level by Level
While DFS goes deep, Breadth-First Search (BFS) is more social 😄. It explores neighbors level by level , like meeting everyone in your...


Depth-First Search (DFS) — Dive Deep First, Then Backtrack
Ever gone into a maze and kept turning left until you hit a wall, then backtracked to try another path? That’s exactly how Depth-First...


Dijkstra’s Algorithm — Finding the Shortest Path, Smartly
Let’s say you're in a city trying to get to a friend’s house 🚶♂️, and there are many roads with different travel times. You want to get...


Kruskal’s Algorithm — Connect the Dots, But Keep It Cheap
Let’s say you want to build bridges between islands 🏝️, and your goal is to connect all of them with the least cost , without making a...


Prim’s Algorithm: One Step at a Time
Imagine you're building roads to connect a group of villages. You want to make sure every village is connected without spending more...


Understanding Graphs
Graphs are everywhere. Imagine a city map, or a social media network. All these systems can be represented using a graph—a data structure...
bottom of page
