Community of VE/MapPoint Users and Developers
This is a discussion on Optimizing Route Calculation within the Development forums, part of the MapPoint 2006/2009 Discussion category; Ok -- I've searched the internet high and low, and even spoken with the makers of MileCharter..... I have thousands ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Optimizing Route Calculation I have thousands of zipcodes in a database. I need to find out how far (driving distance) each of those zipcodes is to each of the other zipcodes. I have written code to do this, and it works great, but it is incredibly slow. I am getting 1 - 3 routes per second. So for 1,000 zipcodes (500,000 routes) it takes between 46 and 138 hours to get the distances. I have Application.Visible set to false, so it is not having to render the maps, but I need other advice on how to speed up the process.... I set my waypoints using: objMap.ActiveRoute.Waypoints.Add(objMap.GetLocatio n(dblLat1, dblLon1)) Where dblLat1,dblLon1 are the lat and lon of the zipcode (because mappoint does not recognize all of the zips...) Any ideas to help optimize this process would be great... If I can squeeze out even 6 routes per second that would cut the time in half. Obviously I know the obvious answer of throwing more computers at the problem -- I am looking for code optimizations. Thank you in advance for any ideas.... |
| ||||
| Re: Optimizing Route Calculation
As I was suggesting on the phone, time isn't your only problem. Have you considered how you are going to store 800 million mileages? Is that going into a database? Which one? Access won't handle that many (it has a 2GB limit). Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Optimizing Route Calculation
Richard, I have reserved myself to the fact that getting the distance for all 40,000 that we discussed isn't likely an option, but I have narrowed the list down to 100 zips that I need to compare to the 40,000.... This is 4 Million Routes instead of 800 Million.... Drastically less. But that's still 4 Million seconds (46 Days) worth of processing... I'm just wondering if anyone is willing to offer help in optimizing the code... I didn't really want to ask you directly, because it's your livelyhood, and I didn't want to ask you to give up trade secrets... Thanks!!! |
| ||||
| Re: Optimizing Route Calculation
It is Microsoft you need to be talking to... Route finding is computationally difficult ("NP Complete"). All things considered, MapPoint's route finding doesn't perform too badly. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Optimizing Route Calculation
jper043 This may not help as I guess you may have already done things this obvious. I will list them because I did not when I did it first: 1. Make sure that you recognise mirror calculations (ie Loc2 to Loc1 picks up data for calculation already done for Loc1 to Loc2) rather than recalculating 2. Create all the location objects before you start the calculation run 3. Consider whether you can live with straightline distance which you then multiply by a fiddle factor (1.2 being the favorite, but you could do a sample of real routes and establish a better factor for your geography). This of course is MUCH faster. 4. Divide the database into multiple parts and run on multiple computers |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Snap to a Road - MapPoint Articles - MP2K Magazine | This thread | Refback | 03-27-2008 10:17 AM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 03-27-2008 08:42 AM | |
| Optimizing Route Calculation - MapPoint Forums | This thread | Refback | 03-26-2008 01:58 AM | |
| Optimizing Route Calculation - MapPoint Forums | This thread | Refback | 03-26-2008 01:58 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Route Optimizing Software Question | getgo | MapPoint 2006/2009 Discussion | 1 | 06-09-2006 07:21 PM |
| Optimizing a lot of stops | mundiz | MapPoint 2006/2009 Discussion | 7 | 08-22-2005 11:53 AM |
| Route Optimizing with 2 identical stops | cwrude | MapPoint 2006/2009 Discussion | 0 | 01-19-2005 01:28 PM |
| hiding directions after route calculation in a MP controll | ruyasan | MapPoint 2006/2009 Discussion | 4 | 05-19-2004 05:19 PM |
| How to handle route calculation error | rberick | MapPoint 2006/2009 Discussion | 2 | 12-17-2003 07:12 PM |
Rome Flights
Rome flights can be costly flights if you don't know where to book. You can find the latest deals from the leading UK Tour Operators at Holiday Hypermarket.
Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.
Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.
Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!
Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com
Travel Deals
Click here and read up on the travel deals available online.
Holidays to Goa
Golden beaches, coconut trees. Visit On The Beach for holidays to Goa, and experience India!