turn penalty through node

34 views
Skip to first unread message

mbl

unread,
Feb 13, 2012, 12:57:43 PM2/13/12
to networkx-discuss
How can I include turn penalties for a street network?
I read in a shapefile for the street network. I would like the
shortest path algorithm to include a penalty (weight) for a right turn
or left turn.
I have the x-y coordinates for the ends of the edges. So I should be
able to calculate the angle between edges. Maybe I can add a new edge
to represent every possible turn at the node and assign the angle as
the weight?

Oleguer Sagarra

unread,
Feb 13, 2012, 1:16:06 PM2/13/12
to networkx...@googlegroups.com
You can alternatively set nodes as streets and edges as intersections.
Any two streets connected by an intersection are connected via an edge
with the weight you want (angle, mean traffic at peak hour.. whatever).
I think this simple transformation would make many problems easier to
treat.. but it's just an idea...

good luck!

--
*************************************
Oleguer Sagarra, "Ula"

"Si a les persones els posaren tants entrebancs com als ordinadors per considerar-los intel�ligents, el 90% de la humanitat seria considerada est�pida." I. Asimov

#: Abans d'imprimir aquest correu electr�nic, pensa b� si �s necessari fer-ho: El medi ambient �s q�esti� de tots. Si l'has d'imprimir, intenta fer-ho a doble full o re-escalant-lo a dos fulls per p�gina.

*************************************

franck kalala

unread,
Feb 15, 2012, 4:00:23 PM2/15/12
to networkx...@googlegroups.com
Can networkx read this type of file?



It has a list of regular graph with 10 vertices and having
 degree 4.

Franck

Ahmed Dassouki

unread,
Jul 6, 2013, 1:35:59 PM7/6/13
to networkx...@googlegroups.com, uga...@gmail.com
Can you elaborate with an example perhaps?


On Monday, February 13, 2012 2:16:06 PM UTC-4, Oleguer Sagarra wrote:
On 13/02/12 18:57, mbl wrote:
> How can I include turn penalties for a street network?
> I read in a shapefile for the street network. I would like the
> shortest path algorithm to include a penalty (weight) for a right turn
> or left turn.
> I have the x-y coordinates for the ends of the edges. So I should be
> able to calculate the angle between edges. Maybe I can add a new edge
> to represent every possible turn at the node and assign the angle as
> the weight?
>
You can alternatively set nodes as streets and edges as intersections.
Any two streets connected by an intersection are connected via an edge
with the weight you want (angle, mean traffic at peak hour.. whatever).
I think this simple transformation would make many problems easier to
treat.. but it's just an idea...

good luck!

--
*************************************
Oleguer Sagarra, "Ula"

"Si a les persones els posaren tants entrebancs com als ordinadors per considerar-los intel�ligents, el 90% de la humanitat seria considerada est�pida." I. Asimov

#: Abans d'imprimir aquest correu electr�nic, pensa b� si �s necessari fer-ho: El medi ambient �s q�esti� de tots. Si l'has d'imprimir, intenta fer-ho a doble full o re-escalant-lo a dos fulls per p�gina.

*************************************

Reply all
Reply to author
Forward
0 new messages