- #1
Guitz
- 22
- 8
Hi all,
I'm trying to use a directed graph for a traffic simulation program.
This is an example of a simplified graph :
The red triangle is the position and orientation of the car. The green circle is the destination node.
I wish to prohibit a U-turn on a bend and a crossroads but I authorize it on a dead end (node 4).
The array of nodes (3, 6, 8) is therefore prohibited.
Likewise (3, 1, 3, 6, 8) is forbidden.
On the other hand, (3, 1, 2, 3, 6, 8) and (3, 4, 3, 6, 8) are allowed. The latter being the shortest path.
How please modify the data structure of my graph and the A* (or Dijkstra's) algorithm to achieve my goals?
Thanks
I'm trying to use a directed graph for a traffic simulation program.
This is an example of a simplified graph :
The red triangle is the position and orientation of the car. The green circle is the destination node.
I wish to prohibit a U-turn on a bend and a crossroads but I authorize it on a dead end (node 4).
The array of nodes (3, 6, 8) is therefore prohibited.
Likewise (3, 1, 3, 6, 8) is forbidden.
On the other hand, (3, 1, 2, 3, 6, 8) and (3, 4, 3, 6, 8) are allowed. The latter being the shortest path.
How please modify the data structure of my graph and the A* (or Dijkstra's) algorithm to achieve my goals?
Thanks
Last edited: