<?xml version="1.0" encoding="windows-1252"?>
<node id="40617" title="Re: Graph Traversal" created="2000-11-08 18:53:56" updated="2005-08-13 05:35:16">
<type id="11">
note</type>
<author id="29594">
nop</author>
<data>
<field name="doctext">
All this effort for a game?!?&lt;br&gt;&lt;br&gt;But since the problem
is interesting...&lt;br&gt;&lt;br&gt;
As the problem is certainly NP, try hueristics.  
Simulated annealing, GAs, tabu search; whatever.  The hard part is how you encode the problem.  One clever way uses a sort sequence:
&lt;ol&gt;
&lt;li&gt; Each depot gets an key, a float between 0 and 1
&lt;li&gt; To determine a tour, sort the depots by key
&lt;li&gt; Visit the depots in sorted-by-key order.  Return to base (closing the loop) as late as possible (eg going to one more depot would leave you insufficient moves to get home).
&lt;/ol&gt;
Start by randomly assigning keys.  Your original tour will be horrible.  Improve the tour by any optimization hueristic (annealing, tabu, genetic algs) with reasonable mutuation operators such as 
&lt;ul&gt; &lt;li&gt; randomly swap the keys of two depots
&lt;li&gt; randomly peturb the keys of some depots
&lt;li&gt; randomly "cross-over" two tours, by taking key values from each
&lt;/ul&gt;
The nice thing about the encoding is that it creates/maintains good subtours, and is robust to mutations 
(every list of keys is a well-formed tour).  &lt;br&gt;&lt;br&gt;I've used this approach in a machine-scheduling problem with good results.  Easily coded, unlike breaking out the heavy machinery of integer programming.  Good luck.
&lt;br&gt;
[nop]
</field>
<field name="root_node">
40586</field>
<field name="parent_node">
40586</field>
</data>
</node>
