MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Optimizing Route Calculation

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  4 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-25-2008
Junior Member
White Belt
 
Join Date: Mar 2008
Posts: 2
Optimizing Route Calculation

Ok -- I've searched the internet high and low, and even spoken with the makers of MileCharter.....

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....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-26-2008
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 742
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-26-2008
Junior Member
White Belt
 
Join Date: Mar 2008
Posts: 2
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!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-27-2008
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 742
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-01-2008
Junior Member
Yellow Belt
 
Join Date: Oct 2007
Posts: 17
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/optimizing-route-calculation-7360.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 11:11 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

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!


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47