A Crazy Difficult Algorithmic Problem: Can You Help This Person?

Dr. Ashish Bamania
CodeX
Published in
3 min readJul 26, 2022

--

Let’s say that there is a salesman who works for a delivery company.

He has to travel to different cities to deliver packages every day.

Photo by Markus Spiske on Unsplash

He wants to go home early today.

For this, he is trying to figure out the shortest path that will take him to all the cities.

To find the shortest path, he will have to calculate the distance covered in each route involved.

He checks his list of cities:

  • Delhi
  • Mumbai

Routes Between Two Cities

There are two possible routes that he can take to connect these cities.

Route 1 : Delhi to Mumbai
Route 2 : Mumbai to Delhi
Photo by GeoJango Maps on Unsplash

In a short while, he receives a phone call that he has to travel to another city as well.

--

--

Dr. Ashish Bamania
CodeX

Self- Taught Software Engineer 👨‍💻 | Emergency Physician 🩺 | AIIMS, New Delhi 👨‍🎓| Free 'AI In 100 Images' : https://bamaniaashish.gumroad.com/l/visual_ai