Author Topic: Route creation using an unsorted set of destination postcodes  (Read 2339 times)

Route creation using an unsorted set of destination postcodes
« on: 13 December, 2013, 03:19:32 pm »
OK, I want to create a route that minimises distances between a set of unordered postcodes (or eastings/northings).

This is for a set of educational establishments, I can get either the postcodes or eastings/northings for these.

For a test run I am just conducting this in my local area, but ideally I'd like to include a much larger set of postcodes.

example data  https://docs.google.com/spreadsheet/ccc?key=0AhH383N3HlFrdEpnWUhjc1hhTnJ4RlktbzV4ZWp0aGc&usp=sharing (note this data is not senstitive)


Re: Route creation using an unsorted set of destination postcodes
« Reply #1 on: 13 December, 2013, 03:28:07 pm »
It's a well studied problem called travelling salesman (Wikipedia).  There is no easy full solution.

Re: Route creation using an unsorted set of destination postcodes
« Reply #2 on: 13 December, 2013, 03:46:29 pm »
How can this be so hard? Surely the brute force method should be relatively straightforward for someone to implement using google maps.

Can I instead use something to bring up these postcodes as a set of points in google maps and join the dots manually?

Or even a way of searching for multiple directions at once (in google you can search for CH44 7LK to CH44 7NN - BUT you cannot do this for multiple directions AFAIK) which I can then edit to make as short as possible afterwards.

Re: Route creation using an unsorted set of destination postcodes
« Reply #3 on: 13 December, 2013, 04:42:25 pm »
Didn't/doesn't Autoroute rearrange destinations to produce a shorter route?

Re: Route creation using an unsorted set of destination postcodes
« Reply #4 on: 13 December, 2013, 05:44:16 pm »
Brute force method takes way too much computing time.
There are lots of algorithms for traversing a graph - look at the A* algorithm, often used in computer games for path finding for AIs / baddies.

Re: Route creation using an unsorted set of destination postcodes
« Reply #5 on: 15 December, 2013, 03:47:05 pm »
Microsoft Autoroute 2011 does 'Optimising'.

Just done my Christmas card delivery using exactly this.

Re: Route creation using an unsorted set of destination postcodes
« Reply #6 on: 16 December, 2013, 11:20:38 am »
Are there any free websites / software that do this optimisation or do I need to buy a copy of autoroute 13 (£34.06  on amazon)?

Re: Route creation using an unsorted set of destination postcodes
« Reply #7 on: 16 December, 2013, 11:39:55 am »
The alternative is to Place all the points on Googlemaps and then move them around until the total distance is as low is you can get it.

It usually ends up being a big circular ring.

Re: Route creation using an unsorted set of destination postcodes
« Reply #8 on: 16 December, 2013, 01:23:19 pm »
Is there a quick way of putting 100+ postcodes into google maps for the manual approach?

(Even if I had autoroute 13, is it possible to put that many postcodes in quickly for their optimisation?)

Re: Route creation using an unsorted set of destination postcodes
« Reply #9 on: 16 December, 2013, 01:30:47 pm »
Its what's known in the IT trade as "Manual input".

It's long and tedious.

Re: Route creation using an unsorted set of destination postcodes
« Reply #10 on: 16 December, 2013, 02:07:39 pm »
Ningishzidda - so whether I have autoroute or use google maps I have to manually input the postcodes?

Re: Route creation using an unsorted set of destination postcodes
« Reply #11 on: 16 December, 2013, 02:45:14 pm »
Ningishzidda - so whether I have autoroute or use google maps I have to manually input the postcodes?

You have the postcodes on an Excel spreadsheet, so you can copy and paste them one-by-one into Googlemaps.
Don't forget to click 'Add destination' between each.

Re: Route creation using an unsorted set of destination postcodes
« Reply #12 on: 16 December, 2013, 03:23:16 pm »
But can this adding of postcodes be done more easily with autoroute or is it the same kind of manual entry?

mcshroom

  • Mushroom
Re: Route creation using an unsorted set of destination postcodes
« Reply #13 on: 16 December, 2013, 04:25:03 pm »
You could map them out on a road atlas with oat flakes and get a slime mould to figure it out ;D
Climbs like a sprinter, sprints like a climber!

Re: Route creation using an unsorted set of destination postcodes
« Reply #14 on: 16 December, 2013, 05:20:29 pm »
As mentioned this is the traveling salesman problem, and is thought to be hard.

Some promicing research is currently modeling ants, is proving intresting however.  The good solution is still going to be a long way off.
Just someone's butler

Re: Route creation using an unsorted set of destination postcodes
« Reply #15 on: 16 December, 2013, 06:37:19 pm »
Had a go with google engines - printout map and navigate on the fly: https://mapsengine.google.com/map/edit?mid=z3833Sltlxt8.kUvajJaE2Ho4

not ideal - maximum 100 points per spreadsheet

Re: Route creation using an unsorted set of destination postcodes
« Reply #16 on: 16 December, 2013, 09:09:11 pm »
Been on MS Autoroute 2011.

I created one tab in a workbook which had the list of my postcodes in column A

I used Autoroute's 'Import Data Wizard' to import the list of postcodes to create one .AXE file with all the postcodes as a Pushpin Set.

I right-click on the Pushpin Set and choose 'Add Pushpins as stops' and hey presto, they are all Waypoints.

Then I go 'Optimise stops' and the software sorts them into the shortest journey.

Done. No trouble.

Re: Route creation using an unsorted set of destination postcodes
« Reply #17 on: 20 December, 2013, 01:10:34 pm »