title: Travelling salesman (TSP) getting the actual path
body: <p>I wonder if there is a way to get the path (not only the distance) chosen by brute force algorithm (TSP)in my solution like i get only the distance. </p>
  
  <p>Notice that I started from City Stockholm and ended at Stockholm.</p>
  
  <ul>
  <li>The shortest path is city1 --> City2 --> City3 ----> .......then ---> City1 ?</li>
  </ul>
  
  <p>A part of my main class:</p>
  
  <pre><code>    public void step(boolean[] wentTo, int currentCity, float distance)
      {
          int wentToCount = 0;
          for (int i = 1; i &lt;= cityCount; ++i)
          {
              if (wentTo[i - 1])
              {
                  ++wentToCount;
                  continue;
              }
              boolean[] copy = new boolean[cityCount];
              System.arraycopy(wentTo, 0, copy, 0, cityCount);
              copy[i - 1] = true;
              float dist = distance + distances[distanceIndex(currentCity, i)];
              step(copy, i, dist);
          }
          if (wentToCount == cityCount)
          {
              if (shortest &gt; distance)
              {
                  shortest = distance;
              }
          }
      }
  </code></pre>