Illustrated guide to an interesting Shortest Path Algorithm

Novel problems require tailored solutions. Sometimes, taking a detour and a fresh look at the problem can significantly reduce its complexity. Today we’ll talk about one such technique called 0–1 Breadth First Search.

Welcome! To the brand new article of Code Stories where we solve interesting problems using the fundamentals of Computer Science. 🚀

Just like our last post regarding Dynamic Programming, we’ll first understand the problem statement. After that, we’ll start exploring solution approaches and gradually develop the intuition for 0–1 BFS. Following that, we will code the entire solution. 🎉

This article assumes that you have a basic


You can only connect the dots by looking backward

Problems can’t be considered easier or difficult in isolation.
It is essential to define the scale at which they need to be solved.
Today we will deal with an interesting problem that will reiterate this point.

Welcome! To the brand new article of Code Stories where each week we solve interesting problems using the fundamentals of Computer Science. 🚀

We will begin by understanding the problem statement in detail.
After that, we will focus on various solution approaches.
Finally, we will code the solution. 🎉

This article assumes that you have a basic understanding of Dynamic Programing. …


Making Computer Science simple bit by bit

If you can’t explain it simply, you don’t understand it well.

Computer Science is often seen as an esoteric discipline. Most of the learners approach it in a convoluted fashion. You hear complex mathematical jargon thrown around in corridors.
On top of that Pop culture left no stone unturned to depict Programming as a niche skill possessed by socially anxious (awkward) individuals.

However, I can’t blame them entirely. The complexity of a subject depends on a variety of things like:

  • Are you exposed to similar branches of knowledge?
  • What do you want to achieve by studying it?
  • How much time…

Abhimanyu Shekhawat

Oracle | Ex-Paypal | GSoC’16 | Writes about Programming & Psychology

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store