View Single Post

  #1 (permalink)  
Old 03-25-2008
jper043 jper043 is offline
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....
Reply With Quote