Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

 Subscribe to receive our newsletter. Subscribe Unsubscribe

## Optimize Hangs

This is a discussion on Optimize Hangs within the Development forums, part of the MapPoint Desktop Discussion category; Hi, if i optimize in cities all works find, testet up to 16 points. 6 point, 2 points in 3 ...

1. Member Yellow Belt
Join Date
Jul 2007
Posts
45

## Optimize Hangs

Hi,
if i optimize in cities all works find, testet up to
16 points.
6 point, 2 points in 3 differnt big cities. Now
the optimize routine won't return. Not even after
10min. Did the optimizing by myself (greedy with
a graph and calculated the distances between
the nodes with mappoint) - it returns after
2min20 with the correct solution.

Problem is ... if i do the same in the first scenario
i need very much time just to get the distances
between the points.

Now i got a few questions:
1. Why does MapPoint hang up?
2. Can i predict it by any chance that it won't
optimize correct, beforehand?
3. Can i cancel the optimize method after
5 sek? Couldn't find a way to stop him.
4. Is there a faster way to get the distances
between the points?
5. Is there a boundary what MapPoint can optimize?
6. If i use air-distance, to which point i can use
them to optimize the points?

Thankful for any help, does ms delete such threads,
couldn't find more then 1 thread about this.
Read about people using mappoint with thousands of
points, are they insane or do they something i don't?

2. ## Re: Optimize Hangs

I did have a similar problem, see this Programming Challenge from a past newsletter --

MapPoint Programming Challenge
and
Handling Route that Calculates but does not Optimize

In this case I believe it was dead-end, one-way streets that would cause it to hang up.

AFAIK, this is not solution except to have some other thread running that detects when MapPoint is hanging for too long on an optimize... it never retuirns an error but when it hangs like this eventually the processor usage drops -- it's hanging but doing nothing. Is this also true in your case?

No one deletes threads or tries to hide MapPoint's weak points in here, in fact we like to gripe about them

Eric

3. Member Yellow Belt
Join Date
Jul 2007
Posts
45

## Re: Optimize Hangs

it runs at full speed but i don't have time to wait hours if it returns,
i'd like to stop optimizing after a few sekonds, is this possible
with another thread etc.? (how to plz)
couldn't find a way to stop him, don't want to kill him ...

was just a little ... i think mappoint lacks a lot generell points ...
the application is ok but the activex got serious problems like the
dead end i'm at now.

what did you do to control the optimize routine?

4. Member Yellow Belt
Join Date
Jul 2007
Posts
45

## Re: Optimize Hangs

btw. if i use big distances in optimizing it takes more than 20min,
didn't try it (who has time to do nothing for hours).
Is this normal?
At the moment i check if 2 points are farther apart than 100km.
If not, i use mappoint, else i permutate the waypoints between
start and end an calculate the best route by looking at the -
distance as the crow flies - (stole this phrase from other threads).
It's finit an quite exact for optimizing.
What would be your limit in which you would use MapPoint
or change to own code. (Problem is that i need the data quite
fast because the user won't wait forever for just a single route)

Optimizing 10 point in Germany (each point a big city) is unbearable,
waiting for hours or use as the crow flies in optimizing and the
optimizing takes 15sek. After that i got to wait for 1min30-1min45
till it calculated the route again. Normal Route calculating was about
50sek.

Which algo do the use in mappoint, some minimal spanning tree with
eulerroute to get fast solutions with about max 1,5-2,0 longer route
or do they use brute force to calculate each possibility? Why does
the optimizing so poor ...

5. Member Yellow Belt
Join Date
Jul 2007
Posts
45

## Re: Optimize Hangs

my workaround:

1. graph (distance as the crow flies - fast)
2. if (distance between 2 points < 100) mappoint else greedy
3. cope with an unsatisfying solution

greedy: maps a permutated int-array on the points between
start and end and calculate each possibility.

Good thing: I can stop the own alg ....

Post your own unsatisfying solution, everyone!

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•