<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 14/06/13 02:59, Daniel Kastl wrote:<br>
      Hi Daniel, List <br>
      <br>
      I must admit I found the entire process of creating a postgress
      array in a suitable form for the pgr_tsp function to be a exercise
      in slow torture! <br>
      <br>
      Would anybody have any major objections if I attempted to rewrite
      the interface so it took a normal sql querry?<br>
      <br>
      Something like <br>
      <pre><span class="k"></span><span class="o"></span><span class="k"></span><span class="n"><span class="n">pgr_costResult</span><span class="p">[] </span>pgr_tsp</span><span class="p">(</span><span class="s1">'SELECT source,target distance FROM vertex_table'</span><span class="p">,</span><span class="s1">2</span><span class="p"></span><span class="mi"></span><span class="p">);

That way the problem with creating a square array in postgres would disappear. 

Dave
</span></pre>
      <br>
          <br>
      <span id="taw" style="margin-right:0"><a class="spell"
href="https://www.google.nl/search?client=ubuntu&hs=uQi&channel=fs&gl=uk&q=exercise+in+slow+torture&spell=1&sa=X&ei=BKa6UYnAF5G20QXc_4HQCg&ved=0CCcQvwUoAA"></a></span></div>
    <blockquote
cite="mid:CABXBSH9eSPmkoO9zM3tbLSUTTMC1geoJJohVUGy+s5f9KmKdXA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Dave,
        <div><br>
        </div>
        <div>Thanks for reporting. Maybe I just mixed up something with
          copy & paste.</div>
        <div>I remember that I needed to add a vertex table to the
          sample data for the new TSP with distance matrix and got the
          ID's a bit wrong first.</div>
        <div>Will take a look.</div>
        <div><br>
        </div>
        <div>Daniel<br>
          <div class="gmail_extra"><br>
            <br>
            <div class="gmail_quote">On Fri, Jun 14, 2013 at 7:40 AM,
              Stephen Woodbridge <span dir="ltr"><<a
                  moz-do-not-send="true"
                  href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">Dave -
                moving this over to the pgrouting list.
                <div class="im"><br>
                  <br>
                  Hi Dave,<br>
                  <br>
                  I'm not sure the Daniel used the example data network
                  for this example. The data looks like one of the
                  matrix I used in my test cases.<br>
                  <br>
                  src/tsp/test/*.test<br>
                  <br>
                  I just made up numbers for a symmetric matrix. It was
                  not taken from an actual network.<br>
                  <br>
                  So the sly part is that its NOT from a graph ;)<br>
                  <br>
                  Daniel - please correct me it you did something else.<br>
                  <br>
                  -Steve<br>
                  <br>
                  On 6/13/2013 6:11 PM, Dave Potts wrote:<br>
                </div>
                <div>
                  <div class="h5">
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <br>
                      In the travel sales person problem an example is
                      provided,  I having<br>
                      problems understanding it<br>
                      <br>
                      The example route network is posted as<br>
                      <a moz-do-not-send="true"
href="http://docs.pgrouting.org/dev/doc/src/developer/sampledata.html#sampledata"
                        target="_blank">http://docs.pgrouting.org/dev/doc/src/developer/sampledata.html#sampledata</a><br>
                      <br>
                      I have assume the distance between red node 1 and
                      red node 3 is 2, ie<br>
                      the unit distance 1 +1  which I  make to be 2<br>
                      <br>
                      given that<br>
                      <br>
                      I think the route matrix should be<br>
                      <br>
                           1 2 3 4<br>
                      ======<br>
                      1 | 0 1 2 3<br>
                      2 | 1 0 1 2<br>
                      3 | 2 1 0 1<br>
                      4 | 3 2 1 0<br>
                      <br>
                      distance 1 to 4 is 1+1 +1 ==3<br>
                      distance 2 to 4 is 1+1       ==2<br>
                      distance 3 to 4 is 1<br>
                      etc<br>
                      <br>
                      But the give value is (please see<br>
                      <a moz-do-not-send="true"
                        href="http://docs.pgrouting.org/dev/src/tsp/doc/index.html"
                        target="_blank">http://docs.pgrouting.org/dev/src/tsp/doc/index.html</a>)<br>
                           1 2 3 4<br>
                      <br>
                      1  {0,1,2,3},<br>
                      2  {1,0,3,2},<br>
                      3  {2,3,0,4},<br>
                      4  {3,2,4,0}<br>
                      <br>
                      I just don't understand how the distance between 3
                      and 4 can be the<br>
                      value 4, ditto he values between 2 and 3<br>
                      <br>
                      Have I missed something sly ?<br>
                      <br>
                      Dave.<br>
                      <br>
                      <br>
                      <br>
                      _______________________________________________<br>
                      postgis-devel mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:postgis-devel@lists.osgeo.org"
                        target="_blank">postgis-devel@lists.osgeo.org</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel"
                        target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</a><br>
                    </blockquote>
                    <br>
                    _______________________________________________<br>
                    postgis-devel mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:postgis-devel@lists.osgeo.org"
                      target="_blank">postgis-devel@lists.osgeo.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel"
                      target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</a><br>
                  </div>
                </div>
                _______________________________________________<br>
                pgrouting-dev mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:pgrouting-dev@lists.osgeo.org"
                  target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev"
                  target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
              </blockquote>
            </div>
            <br>
            <br clear="all">
            <div><br>
            </div>
            -- <br>
            <span
style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic
              UG & Georepublic Japan<br>
              eMail: <a moz-do-not-send="true"
                href="mailto:daniel.kastl@georepublic.de"
                style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>
              Web: <a moz-do-not-send="true"
                href="http://georepublic.de/"
                style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
pgrouting-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pgrouting-dev@lists.osgeo.org">pgrouting-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>