Optimize performance

andrea
04-16-2008, 03:41 AM
hi boys, I'm using the method "optimize". I've set 5 waypoint but the problem is:
it requires about 3 minutes only for 5 point, is it normal???
can I do something for optimize the time??

thanks

Wilfried
04-16-2008, 05:01 AM
Hi,

This looks not normal, unless if it is a very difficult route to calculate?

Winwaed
04-16-2008, 07:34 AM
I have seen this kind of performance (and much, much worse) if the points are spread out. If they're close together (eg. the same city) then it should be much quicker.

Note that you are essentially solving the Travelling Salesman Problem. This is recognised in Computer Science as computationally difficult. The time required increases exponentially according to the number of points. Also on top of that, you have to calculate the individual route segments.


Richard

andrea
04-16-2008, 09:40 AM
I've solved the problem with CPU, cause i use win XP in a virtual machine.
I've changed the option of core and now its ok.

SO, I've done this test:

5 point in about 300km --> 2:26 minutes. is it ok? is it normal?

I've tryed also with the software mappoint and the result is the same.

Wilfried
04-18-2008, 01:42 AM
Hi,

I just did in the standalone executable 5 points in France with a total distance of 1600 km. the calculation of the route take exact 3 seconds. Is the machine oke? For example starting the start alone exetable how log does this take?

andrea
04-18-2008, 01:46 AM
Hi,

I just did in the standalone executable 5 points in France with a total distance of 1600 km. the calculation of the route take exact 3 seconds. Is the machine oke? For example starting the start alone exetable how log does this take?

mmm very strange.
Yesterday i've tryed also without the optimize method and then it has require 3 minute... i don't know why!
Maybe because i use Mappoint on one virtuale machine (VMware).
i must to try in a simple PC...

Wilfried
04-19-2008, 10:34 AM
Hi Andrea,

Virtual machines degrade performance of course. yes please try it first on a regular machine.

andrea
04-21-2008, 02:43 AM
ok, i've installed mappoint and my application on a regular machine.
but it required about 1.30 minute for to get the point.
this is my code:


ApplicationClass wApplication = new ApplicationClass();
wApplication.Units = GeoUnits.geoKm;

Map wMap = wApplication.ActiveMap;
Route wRoute = wMap.ActiveRoute;


wMap.Parent.PaneState = GeoPaneState.geoPaneRoutePlanner;
object item = 1;



wRoute.Waypoints.Add( wMap.FindResults("Milano").get_Item(ref item) , "Milano");
wRoute.Waypoints.Add(wMap.FindResults("Mantova").get_Item(ref item), "Mantova");
wRoute.Waypoints.Add(wMap.FindResults("Lecco").get_Item(ref item), "Lecco");
wRoute.Waypoints.Add( wMap.FindAddressResults("via centrale 8", "Abbadia Lariana", string.Empty,
"Lombardia", "23821", GeoCountry.geoCountryItaly).get_Item(ref item), "Casa Mia" );

wRoute.Waypoints.Add(wMap.FindAddressResults("via belfiore 41", "Lecco", string.Empty,
"Lombardia", "23900", GeoCountry.geoCountryItaly).get_Item(ref item), "Lecco");

wRoute.Waypoints.Add(wMap.FindResults("Piacenza").get_Item(ref item), "Piacenza");



wRoute.DriverProfile.StartTime = System.DateTime.Now ;

// optimize
wRoute.Waypoints.Optimize();
wRoute.Calculate();

andrea
04-22-2008, 02:30 AM
Hi,

I just did in the standalone executable 5 points in France with a total distance of 1600 km. the calculation of the route take exact 3 seconds. Is the machine oke? For example starting the start alone exetable how log does this take?

do yu use optimize method?

Wilfried
04-22-2008, 02:38 AM
Hi Andrea,

I tryed and yes takes same long time here too. If you try exact same locations direct on the mappoint.exe (manually) is it taken that time too? If not you probably have to set driverprofile and preferred roads in your application.

andrea
04-22-2008, 02:53 AM
Hi Andrea,

I tryed and yes takes same long time here too. If you try exact same locations direct on the mappoint.exe (manually) is it taken that time too? If not you probably have to set driverprofile and preferred roads in your application.

the same time...

i must to set driver profile in my application on the object route?
which value?

andrea
04-22-2008, 02:57 AM
if i do not use the "optmize" method it dont require many times, but i need it.
I've tryed with some city in france with mappoint and it require about 3 minutes when i would optimize the route

Wilfried
04-24-2008, 07:43 AM
Hi,

If it is the same time if you do the calculation manually then I'm afraid there is nothing to do about it.

 
Web mp2kmag.com
mapforums.com