Solving the travelling salesman problem (TSP) - using Google Maps

Background

I am one of the hundreds of people who's average work day comprises a home based start, progressing through vists to between 5 - 10 customer locations and finishing with the last leg of the journey back home to the point where I started. Without route optimization support, planning my route can take a few minutes in google maps for a couple of locations, 30 minutes to an hour for 6 or 7 locations and above that is nigh on impossible.


After a bit of a trawl I found speedyroute.com and their 2 optimised routes per day executed from the same IP address worked well for a long time. Hence I almost went into shock when on valentines day 2025 - speedyroute.com removed their free route optimization service. So I trawled again but the only application I could find which worked as well as speedyroute.com was only available in North America.


Long story short - rather than pay a subscription, as last resort I checked out the pricing for use of the google maps API. I have done quite a bit of solution development utilising PHP/MYSQL etc, so pulling together my own web based route optimization application sounded like fun. Having done a fair bit of research I could see the prices for API useage was extremely complex, but overall fractions of pennies per API call and based on say 1 or 2 routes optimized daily the costs could actually be zero.

Google Maps API Scope

To give the application access to all required resources and host it in a secure area we can kill 2 birds with one stone and implement Oauth. Once inside a load of form fields for start address, finish address and say 11 stops in between to be safe, then a button to calculate the route, a button to clear te form and last but not least - a map showing the sensibility of our optimized route appeared to be a reasonable place to start. With this in mind, below is what our google shopping list is beginning to look like:

  • Google Cloud - Oauth Sevice: Free
  • Google Maps API: Less than $200 - Free
  • Google Directions API Less than $200 - Free
  • Google Places API Less than $200 - Free

In a nut shell to use the google maps API you need to create a google cloud account and setup a project and whilst at this time you can get a $300 free trial, we still need to setup a payment method despite our planned zero spend. There is a monthly charge per call to the google maps APIs, but you get $200 free every month. With some carefull resouce planning this looked feasible.

Routes Optimized mostly 5-10 stops

System Logins twice per day

Google Maps API Calls across 3 APIs

Development hours evenings and weekends

Knowledge/Capability

I have always wondered if any one ever really used the section which represents their knowledge and capability. I think the below becomes a bit more useful as a tool to represent the requirements to develop a functional application with a simple workflow identifying any help I was going to.

HTML 100%
CSS 75%
JavaScript 75%
PHP 80%
Google Maps API 100%
ChatGPT 100%

Strategy/Considerations

The application was going to be constructed utilising HTML, PHP and Javascript to control the mechanics of the views and API calls.

You will also note the google speciality area and of course chatgpt.

From my own experience - I do not believe chatgpt creates good code, due to its annoying habit suddenly fogetting the story so far and begin to generalise. It also has a nasty habit of inserting placeholders like "THE REST OF YOUR CODE GOES HERE" which can get you into a bit of a mess and there is usually a whole array of PHP deprecated function notices due to the age of the training data.

However, chatgpt is exceptionally good at browsing to find things such as google cloud and google maps API fair useage policies and interpretting licensing terms etc as well as locating public record data and case studies. This saved hours of trawling through document archives looking for terms, as I was pointed straight at exactly what I needed. In keeping the spend less than $200 per month this is actually a key piece of the puzzle.

Sumary

Brandon Johnson

Innovative and deadline-driven Graphic Designer with 3+ years of experience designing and developing user-centered digital/print marketing material from initial concept to final, polished deliverable.

  • Portland par 127,Orlando, FL
  • (123) 456-7891
  • alice.barkley@example.com

Education

Master of Fine Arts & Graphic Design

2015 - 2016

Rochester Institute of Technology, Rochester, NY

Qui deserunt veniam. Et sed aliquam labore tempore sed quisquam iusto autem sit. Ea vero voluptatum qui ut dignissimos deleniti nerada porti sand markend

Bachelor of Fine Arts & Graphic Design

2010 - 2014

Rochester Institute of Technology, Rochester, NY

Quia nobis sequi est occaecati aut. Repudiandae et iusto quae reiciendis et quis Eius vel ratione eius unde vitae rerum voluptates asperiores voluptatem Earum molestiae consequatur neque etlon sader mart dila

Professional Experience

Senior graphic design specialist

2019 - Present

Experion, New York, NY

  • Lead in the design, development, and implementation of the graphic, layout, and production communication materials
  • Delegate tasks to the 7 members of the design team and provide counsel on all aspects of the project.
  • Supervise the assessment of all graphic materials in order to ensure quality and accuracy of the design
  • Oversee the efficient use of production project budgets ranging from $2,000 - $25,000

Graphic design specialist

2017 - 2018

Stepping Stone Advertising, New York, NY

  • Developed numerous marketing programs (logos, brochures,infographics, presentations, and advertisements).
  • Managed up to 5 projects or tasks at a given time while under pressure
  • Recommended and consulted with clients on the most appropriate graphic design
  • Created 4+ design presentations and proposals a month for clients and account managers

Portfolio

Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. Quisquam quos quisquam cupiditate. Et nemo qui impedit suscipit alias ea. Quia fugiat sit in iste officiis commodi quidem hic quas.

  • All
  • App
  • Product
  • Branding
  • Books

App 1

Lorem ipsum, dolor sit amet consectetur

Product 1

Lorem ipsum, dolor sit amet consectetur

Branding 1

Lorem ipsum, dolor sit amet consectetur

Books 1

Lorem ipsum, dolor sit amet consectetur

App 2

Lorem ipsum, dolor sit amet consectetur

Product 2

Lorem ipsum, dolor sit amet consectetur

Branding 2

Lorem ipsum, dolor sit amet consectetur

Books 2

Lorem ipsum, dolor sit amet consectetur

App 3

Lorem ipsum, dolor sit amet consectetur

Product 3

Lorem ipsum, dolor sit amet consectetur

Branding 3

Lorem ipsum, dolor sit amet consectetur

Books 3

Lorem ipsum, dolor sit amet consectetur

Services

Magnam dolores commodi suscipit. Necessitatibus eius consequatur ex aliquid fuga eum quidem. Sit sint consectetur velit. Quisquam quos quisquam cupiditate. Et nemo qui impedit suscipit alias ea. Quia fugiat sit in iste officiis commodi quidem hic quas.

Lorem Ipsum

Voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident

Dolor Sitema

Minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat tarad limino ata

Sed ut perspiciatis

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur

Magni Dolores

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

Nemo Enim

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque

Eiusmod Tempor

Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi

Testimonials

Necessitatibus eius consequatur ex aliquid fuga eum quidem sint consectetur velit

Proin iaculis purus consequat sem cure digni ssim donec porttitora entum suscipit rhoncus. Accusantium quam, ultricies eget id, aliquam eget nibh et. Maecen aliquam, risus at semper.

Saul Goodman

Ceo & Founder

Export tempor illum tamen malis malis eram quae irure esse labore quem cillum quid malis quorum velit fore eram velit sunt aliqua noster fugiat irure amet legam anim culpa.

Sara Wilsson

Designer

Enim nisi quem export duis labore cillum quae magna enim sint quorum nulla quem veniam duis minim tempor labore quem eram duis noster aute amet eram fore quis sint minim.

Jena Karlis

Store Owner

Fugiat enim eram quae cillum dolore dolor amet nulla culpa multos export minim fugiat dolor enim duis veniam ipsum anim magna sunt elit fore quem dolore labore illum veniam.

Matt Brandon

Freelancer

Quis quorum aliqua sint quem legam fore sunt eram irure aliqua veniam tempor noster veniam sunt culpa nulla illum cillum fugiat legam esse veniam culpa fore nisi cillum quid.

John Larson

Entrepreneur

Contact

Necessitatibus eius consequatur ex aliquid fuga eum quidem sint consectetur velit

Address

A108 Adam Street, New York, NY 535022

Call Us

+1 5589 55488 55

Email Us

info@example.com

Loading
Your message has been sent. Thank you!