<div dir="ltr">Hi Dave,<div><br></div><div style>Thanks for your comment.</div><div style><br></div><div style>I just added a comment to the pull request(<a href="https://github.com/pgRouting/pgrouting/pull/160">https://github.com/pgRouting/pgrouting/pull/160</a> ).</div>
<div style>(Because, tsp core algorithm analysis is too difficult for me...)</div><div style><br></div><div style>Thanks!</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/19 Dave Potts <span dir="ltr"><<a href="mailto:dave.potts@pinan.co.uk" target="_blank">dave.potts@pinan.co.uk</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>On 19/07/13 15:00, sanak wrote:<br>
      Well spotted !<br>
      <br>
      yes it does matter,  I had just assumed because I got an answer it
      was all working, it seems that its not, so there still seems to be
      an issue :-(<br>
      <br>
      The answers should be indentical<br>
      Dave<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi Dave,
        <div><br>
        </div>
        <div>Yes, it is also necessary.<br>
        </div>
        <div><a href="https://github.com/sanak/pgrouting4w/commit/fa8c5ff559344653a464f2c3416de0ef8c4ce393" target="_blank">https://github.com/sanak/pgrouting4w/commit/fa8c5ff559344653a464f2c3416de0ef8c4ce393</a></div>
        <div><br>
        </div>
        <div>By the way, in my environment(currently use MacOSX),</div>
        <div>your 2nd result was as follows, and it is not same as 1st
          one.</div>
        <div>
          ====</div>
        <div>
          <div>pgrouting-workshop=# SELECT seq, id FROM
pgr_tsp('{{0,0.1,0.3,0.3},{0.1,0,0.2,0.2},{0.3,0.2,0,0.2},{0.3,0.2,0.2,0}}'::float8[],1);</div><div class="im">
          <div> seq | id </div>
          <div>-----+----</div>
          <div>   0 |  1</div>
          </div><div>   1 |  0</div>
          <div>   2 |  3</div>
          <div>   3 |  2</div>
          <div>(4 rows)</div>
          <div>====</div>
        </div>
        <div><br>
        </div>
        <div>In your environment, is there no problem?</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>
          <br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/7/19 Dave Potts <span dir="ltr"><<a href="mailto:dave.potts@pinan.co.uk" target="_blank">dave.potts@pinan.co.uk</a>></span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>On 19/07/13 15:08, Dave Potts wrote:<br>
                I have found the problem, in the function int
                findEulerianPath(TSP *tsp) in the file
                src/tsp/src/tsplib.c<br>
                <br>
                <br>
                the code  says something like <br>
                int d,i,j,k,l,a<br>
                <br>
                The varible  d is used to compare against a variable of
                type DTYPE, with the result that there seems to be an
                underflow/overflow issue<br>
                <br>
                so the code needs to be changed to<br>
                <br>
                    int *mst, *arc;<br>
                    DTYPE d;<br>
                    int i, j, k, l, a;<br>
                    int n, *iorder, *jorder;<br>
                <br>
                having done,  I now get the expected result.<br>
                <br>
                Dave.<br>
              </div><div><div class="h5">
              <blockquote type="cite">
                <div>On 19/07/13 13:02, sanak wrote:<br>
                  Hi Sanak<br>
                  <br>
                  Thanks for your help<br>
                  <br>
                  I had the float version in my source base I changed it
                  to a double, I have done a make clean, install
                  restarted the service, still have the same problem :-(<br>
                  <br>
                  Dave<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">Hi Dave, Stephen,
                    <div><br>
                    </div>
                    <div>I encountered the same issue(<a href="https://github.com/pgRouting/pgrouting/issues/159" target="_blank">https://github.com/pgRouting/pgrouting/issues/159</a> ),</div>
                    <div> so, I sent the pull request(<a href="https://github.com/pgRouting/pgrouting/pull/160" target="_blank">https://github.com/pgRouting/pgrouting/pull/160</a> ).</div>
                    <div><br>
                    </div>
                    <div>> Stephen</div>
                    <div>Could you check my pull request?</div>
                    <div><br>
                    </div>
                    <div>Thanks,</div>
                  </div>
                  <div class="gmail_extra"><br>
                    <br>
                    <div class="gmail_quote">2013/7/19 Dave Potts <span dir="ltr"><<a href="mailto:dave.potts@pinan.co.uk" target="_blank">dave.potts@pinan.co.uk</a>></span><br>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have been trying to do
                        some work which requires the tsp, some of my
                        values have values of 0.1 in the dataset, I keep
                        getting odd results.<br>
                        <br>
                        So I tried a well known example from the  pgr
                        _tsp distance page and it work as expected.<br>
                        <br>
                        I then repeated the same example but reduced all
                        of the distance by a factor off 10 and got an
                        error.  Unless I have make a mistake in my
                        understanding of the manual page, I think we
                        might a problem where<br>
                        <br>
                        -- version used<br>
                        select pgr_version();<br>
                                           pgr_version<br>
-------------------------------------------------<br>
                         (2.0.0-dev,v2.0.0-rc1,0,bf13fd7,develop,1.48.0)<br>
                        -- Use a example get a result set<br>
                        SELECT seq, id FROM
                        pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}'::float8[],1);<br>
                         seq | id<br>
                        -----+----<br>
                           0 |  1<br>
                           1 |  2<br>
                           2 |  3<br>
                           3 |  0<br>
                        (4 rows)<br>
                        -- repeat for reduce everything by  scale factor
                        of 10  ie 1.0 becomes 0.1 etc<br>
                        <br>
                        SELECT seq, id FROM
pgr_tsp('{{0,0.1,0.3,0.3},{0.1,0,0.2,0.2},{0.3,0.2,0,0.2},{0.3,0.2,0.2,0}}'::float8[],1);<br>
                        <br>
                        ERROR:  Error TSP fail to findEulerianPath,
                        check your distance matrix is valid.<br>
                        <br>
                        As far as I understand it my matrix has 0's on
                        the leading diangonal  and [a,b] == [b,a]<br>
                        <br>
                        Dave.<br>
                        _______________________________________________<br>
                        Pgrouting-users mailing list<br>
                        <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
                        <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
                      </blockquote>
                    </div>
                    <br>
                    <br clear="all">
                    <div><br>
                    </div>
                    -- <br>
                    <div dir="ltr">
                      <div>Ko Nagase (sanak)</div>
                      <div>Georepublic Japan</div>
                      <div>mail: <a href="mailto:geosanak@gmail.com" target="_blank">geosanak@gmail.com</a> </div>
                      <div>        <a href="mailto:nagase@georepublic.co.jp" target="_blank">nagase@georepublic.co.jp</a></div>
                    </div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                  <pre>_______________________________________________
Pgrouting-users mailing list
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a>
</pre>
                </blockquote>
                <br>
                <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
Pgrouting-users mailing list
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a>
</pre>
              </blockquote>
              <br>
            </div></div></div><div><div class="h5">
            <br>
            _______________________________________________<br>
            Pgrouting-users mailing list<br>
            <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
            <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
            <br>
          </div></div></blockquote>
        </div><div><div class="h5">
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr">
          <div>Ko Nagase (sanak)</div>
          <div>Georepublic Japan</div>
          <div>mail: <a href="mailto:geosanak@gmail.com" target="_blank">geosanak@gmail.com</a> </div>
          <div>        <a href="mailto:nagase@georepublic.co.jp" target="_blank">nagase@georepublic.co.jp</a></div>
        </div>
      </div></div></div><div><div class="h5">
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Pgrouting-users mailing list
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a>
</pre>
    </div></div></blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Ko Nagase (sanak)</div><div>Georepublic Japan</div><div>mail: <a href="mailto:geosanak@gmail.com" target="_blank">geosanak@gmail.com</a> </div>
<div>        <a href="mailto:nagase@georepublic.co.jp" target="_blank">nagase@georepublic.co.jp</a></div></div>
</div>