Skip to Content

Designing a beautiful & Optimal road Trip around India

Photo by Royal Enfield
Photo by Royal Enfield
Update:

The article was well received by the National Geographic Traveller India and they were kind enough to support it with a special tweet, a beautiful souvenir and an yearly subscription of the magazine. Thanks for this gesture guys, really appreciate it.

Wake Me Up When September Ends

Its been a busy month, and also a month dedicated to Travel, not literally travel but at least reading and writing about it.

Travel & Data Science, two things I love in this world. Let’s start the journey fellows.

Connecting the dots

I am an avid reader of NatGeo blogs and articles, superb writing with some superb locations with some super awesome photographs, what else you need. I was searching for some short escapes and came around the Short Breaks section on there website. Again impressed by the collection these guys have, currently 55 surreal destinations across India you’ll fall in love with. But wait, 55 ?? seriously, when will I be able to cover each and every one of them. Even if I cover at-least three destinations in a year, it will take me close to 18 years which is far less as my capacity to travel will decrease with time. Let’s drop the plan and go back to our monotonous lives. Wait!! We are analysts, how can we not come up with a solution to this time and travel problem. No way, lets fetch some data and see where we reach.

Short Breaks

Fetching Data

Scraping data from NatGeo’s website was easy. I pulled all the 55 destinations along with their tags and links on the world wide web, geocoded the addresses with the help of Google Maps API and tried to visualise the destinations over the Indian Map.

Ok, Now what!! I have the data, I have the locations, but coming back to where we started, how to travel these beautiful locations and cover them as soon as possible. This sounds familiar, at least to Computer Science guys, guessed it right, we have the Travelling Salesman problem at our hands fellows - How to cover the given destinations using the shortest route possible. Some progress, at least the problem is cleared, we’ll figure how to approach this NP hard problem soon!!

Travelling Salesman 101

In my journey of learning more about visualisations, I come across a lot of amazing people doing some great work in this field and Randal Olson is one of them. His work is amazing, and one of the reasons I am writing this post. I remembered, I have read his article - Computing the optimal road trip across the US, mine had a similar use case. Let’s see what the master has to say.

According to him - If you started computing this problem(TSP) on your home computer right now, you’d find the optimal route in about 9.64 x 1052 years — long after the Sun has entered its red giant phase and devoured the Earth.

Ohh, great!! What now, Genetic Algorithms - yups, basically a smarter technique to find a solution that is good enough for our purpose. Not getting into much details (for a simple implementation and understanding of a Genetic Algorithm follow this post) lets move ahead. We have the data, we know the algorithm, let’s start implementing it and get our optimal route for this mind blowing trip. Randall, explains the technique briefly and also has the code shared on Github. The code is written completely in Python and uses Javascript for visualisation. I have used a combination of R, Python and Java Script for this problem. You can find the respective codes here.

Result

Amazed!! The program started with 57K KM’s and ended computing the total distance as 10K KM’s traversing each and every destination. 55 destinations looked a mighty, 10K KM looks easy. Data Scientist at work fellows :). Have a look at the route below, 10000 KM’s of paradise.

Here is the list of destinations in order
  1. Bal Samand’s verdure could inspire poets.
  2. Churu’s locked havelis reveal dazzling art.
  3. At this boutique resort, the only signal you’ll receive is the call of the mountains waiting to be explored.
  4. Rekindling idyllic vacations in Kashmir.
  5. A B&B holiday with the Dhauladhars for company.
  6. Trekking, fishing and driving around this little-known town.
  7. Far from the chaos of Manali town, The Himalayan is like a plush man cave.
  8. Despite its proximity to manic Mussoorie, this town retains its old-world aura.
  9. Dehradun is an Enid Blyton storybook come alive.
  10. The hotel is about wellbeing and turning the focus inward.
  11. Explore the secrets of this beautiful hill station - (Post not linked)
  12. Thrills, frills, and safari adventures in Uttarakhand.
  13. Enjoying the healing powers of a spectacular view.
  14. Serenity and luxury in the Kumaon hills.
  15. Temples, forts and shopping.
  16. The spirit of indulgence still dances among the relics of this town in Madhya Pradesh.
  17. Following Rabindranath Tagore’s inspiration in a rural paradise.
  18. Despite a surfeit of tourists, Gokarna has aged well.
  19. Hello Goodbye, it’s a Beatles-themed hotel.
  20. Elephant rides, jeep safaris and boat safaris in the wild.
  21. The Jagannath Temple defines the spirit of the holy town of Puri.
  22. The Andhra town is home to the guru of Jayalalitha, Hema Malini and Rekha.
  23. Compelling history, green spaces, & delicious food welcome you in this Tamil Nadu town.
  24. This region in Tamil Nadu is packed with history and grandeur.
  25. Weekend getaway: There’s something in these temples for everyone.
  26. Discovering rare books, opulent paintings, and dancing-girl dolls in Thanjavur.
  27. A local rose-flavoured drink and the native jasmine will enhance your cultural exploration of Madurai.
  28. Stunning views, flocks of cuddly sheep, smoked garlic that’s what Kodaikanal is about. (magazine archive)
  29. Four ways to explore the Kerala beach town.
  30. This island getaway borrows heavily from the traditional Kerala homestead.
  31. In Fort Kochi’s oldest street, a snug, historical home.
  32. Travel back in time at the 100-year-old Sinna Dorai Bungalow.
  33. Plus Kotagiri’s hiking trails, churches and waterfalls.
  34. Hoysala grandeur comes alive in the temple carvings of Belur and Halebid.
  35. Sakleshpur offers a year-round escape for the city-weary.
  36. Back to basics at this homestay in Arasinamakki.
  37. Kerala’s northernmost district makes for a great weekend getaway.
  38. The lush village lies in a Unesco World Heritage site.
  39. An active break in Bhatkal.
  40. An idyllic weekend getaway in Karnataka.
  41. A slice of life in a Goan village.
  42. Old-world charm and pineapple pickle in the sunshine state.
  43. At Capella, curl up with a book by a palm-fringed courtyard.
  44. Expect new hues every fortnight.
  45. Maharashtra’s only heritage hotel built inside a fort.
  46. Sa-i-Mika has cozy, no-frills rooms in one of the world’s wettest landscape.
  47. The eco-resort makes for an artsy weekend getaway from Mumbai.
  48. Go white water rafting, birding, hiking or just relax.
  49. Weekend Getaway: Rest and relaxation are unavoidable in this rural retreat.
  50. Skip Rajkot for Jamnagar’s snacks and surmo. (magazine archive)
  51. Baroque palaces meet the bare beauty of the White Rann in Bhuj.
  52. A restored Ahmedabad haveli embraces its neighbourhood.
  53. Luxury tents in a rustic setting near Sariska National Park.
  54. The “city of dawn” will make your spirits soar.
  55. Love for the desert and comfort coalesce.

The best part is this algorithm works just as well when you’re planning a smaller trip within your state as when you’re planning a larger trip spanning the entire world. All the algorithm needs are the distances travelled between every stop so it can compute the optimal route. How you get between those stops is up to you.

With the help of this beautiful algorithm, I managed to move this list to my bucket list. Plan a trip, apply the algorithm, find an optimal path and most importantly, enjoy your vacation. I should now write less about data and more about my experience while covering these amazing places.*

Thanks to National Geographic India for this amazing collection.