[pgrouting-dev] Having problems under standing the distance matrix of TSP in respect to route network pgroute version 2

Daniel Kastl daniel at georepublic.de
Thu Jun 13 17:59:36 PDT 2013


Hi Dave,

Thanks for reporting. Maybe I just mixed up something with copy & paste.
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.
Will take a look.

Daniel


On Fri, Jun 14, 2013 at 7:40 AM, Stephen Woodbridge <woodbri at swoodbridge.com
> wrote:

> Dave - moving this over to the pgrouting list.
>
>
> Hi Dave,
>
> 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.
>
> src/tsp/test/*.test
>
> I just made up numbers for a symmetric matrix. It was not taken from an
> actual network.
>
> So the sly part is that its NOT from a graph ;)
>
> Daniel - please correct me it you did something else.
>
> -Steve
>
> On 6/13/2013 6:11 PM, Dave Potts wrote:
>
>>
>> In the travel sales person problem an example is provided,  I having
>> problems understanding it
>>
>> The example route network is posted as
>> http://docs.pgrouting.org/dev/**doc/src/developer/sampledata.**
>> html#sampledata<http://docs.pgrouting.org/dev/doc/src/developer/sampledata.html#sampledata>
>>
>> I have assume the distance between red node 1 and red node 3 is 2, ie
>> the unit distance 1 +1  which I  make to be 2
>>
>> given that
>>
>> I think the route matrix should be
>>
>>      1 2 3 4
>> ======
>> 1 | 0 1 2 3
>> 2 | 1 0 1 2
>> 3 | 2 1 0 1
>> 4 | 3 2 1 0
>>
>> distance 1 to 4 is 1+1 +1 ==3
>> distance 2 to 4 is 1+1       ==2
>> distance 3 to 4 is 1
>> etc
>>
>> But the give value is (please see
>> http://docs.pgrouting.org/dev/**src/tsp/doc/index.html<http://docs.pgrouting.org/dev/src/tsp/doc/index.html>
>> )
>>      1 2 3 4
>>
>> 1  {0,1,2,3},
>> 2  {1,0,3,2},
>> 3  {2,3,0,4},
>> 4  {3,2,4,0}
>>
>> I just don't understand how the distance between 3 and 4 can be the
>> value 4, ditto he values between 2 and 3
>>
>> Have I missed something sly ?
>>
>> Dave.
>>
>>
>>
>> ______________________________**_________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-**bin/mailman/listinfo/postgis-**devel<http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel>
>>
>
> ______________________________**_________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-**bin/mailman/listinfo/postgis-**devel<http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel>
> ______________________________**_________________
> pgrouting-dev mailing list
> pgrouting-dev at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/pgrouting-dev<http://lists.osgeo.org/mailman/listinfo/pgrouting-dev>
>



-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-dev/attachments/20130614/f0747735/attachment.html>


More information about the pgrouting-dev mailing list