Are you aware that
- you are¹ describing the well known travelling salesman problem?
- "perfect" solutions for non-trivial cases of NP-complete problems are unknown?
- there are very good solutions for real world problems though?
Please check if you really need all criteria!
Pick at most 2 of 3 and we might be able to help:
- Fast (i.e. polynomial²) computation
- Proven minimal path
- unknown number of nodes > n (n ~ 20 ?)
If it's just a theoretical question and you can't limit the requirements, then I suppose a branch and bound algorithm might be the best approach, but it won't be faster than brute force in some edge cases.
HTH! =)
Cheers Rolf
( addicted to the Perl Programming Language)
update
had a short glance at the WP article and it describes much better what I wanted to tell.
footnotes
¹) almost
²) corrected, educated foo++
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|