[pgrouting-users] FW: Multiple queries in a row

Daniel Kastl daniel at georepublic.de
Wed Nov 21 03:39:59 PST 2012


There is something, but it didn't make it yet into pgRouting master branch:
https://github.com/pgRouting/pgrouting/wiki/APSP

You can find it in this branch:
https://github.com/pgRouting/pgrouting/tree/gsoc-tdsp

Daniel



On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera at gmail.com>wrote:

> Hi Iñigo,
>
> I needed to do something similar to what you are trying to do some time
> ago and asked in the list. Unfortunately, it is not possible to retrieve
> several shortest paths in one run. It is certainly possible to reduce the
> time needed to perform the shortest path routing between a set of nodes,
> but for this the code of the shortest_path C function should be modified to
> fetch the road network data it needs from the DB only once and then perform
> the routing algorithm several times.
>
> Tao
>
>
> 2012/11/21 Iñigo Vázquez <ivgwildchild666 at hotmail.com>
>
>> Thanks for your reply, but in my case the shortest path doesn`t interest
>> me. I need the shortest paths from one given node to each others beacuse
>> then I want to calculate a path taking into account a given time limit.
>>
>> Something like in the "Traveling Salesman Problem" but with Time Window.
>>
>> Thanks!
>>
>> ------------------------------
>> From: gunnar at tradlosetrondheim.no
>> Date: Wed, 21 Nov 2012 11:08:03 +0100
>> Subject: Re: [pgrouting-users] Multiple queries in a row
>> To: pgrouting-users at lists.osgeo.org
>> CC: ivgwildchild666 at hotmail.com
>>
>>
>> Hello,
>>
>>
>> I do not know the answer to you question, but I might know an workarround
>> if you are only interrested in the shortest of them.
>>
>> We use a hack to find the path to the closest node of a set of nodes.
>>
>> Basically we tweak the query which builds the graph to rename all nodes
>> which are applicable to some id which cannot be found in the graph elsewere
>> (e.g. -1), and the search for the path to this node.
>>
>> (NB: this could/would give strange beahviour if used with astar)
>>
>>
>>
>> Best regards Gunnar
>>
>>
>> 2012/11/21 Iñigo Vázquez <ivgwildchild666 at hotmail.com>
>>
>> Dear all,
>>
>> I need to obtain a set of nearest nodes from a given location (maybe 30
>> or 40). Then I need to calculate the shortest path from the given node from
>> each others. It means to execute shortes_path query multiple times in a
>> row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 -> too
>> long).
>>
>> SELECT * FROM shortest_path('
>>    SELECT id AS id,
>>           source::int4 AS source,
>>           target::int4 AS target,
>>           cost::float8 AS cost
>>    FROM tt_2po_4pgr',275742,274494,
>> false,
>> false)
>>
>> What would be the best way to do this in a reasonable time?
>>
>>
>> Thank in advance!
>>
>>
>> Pd: excuse my english
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>>
>>
>> --
>>  Gunnar Rangøy  System developer  Trådløse Trondheim / Wireless Trondheim
>> tradlosetrondheim.no  +47 99 36 06 99
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>


-- 
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-users/attachments/20121121/4a764628/attachment-0001.html>


More information about the Pgrouting-users mailing list