Page 1 of 1

change Dijkstra's algorithm

Posted: Tuesday 17 December, 2013 - 10:59
by manuel
Hi,

does anybody know how to change Dijkstra's algorithm? I´m trying to change the routing of my advanced transporters. If it isn´t possible to change the algorithm, does anybody have the programming code of it?
Thanks.

Manuel

Re: change Dijkstra's algorithm

Posted: Thursday 19 December, 2013 - 10:14
by MatthijsJongboer
Hello Manuel,

The Dijkstra algorithm optimizes the tables to a single source shortest path.
When you want to change the routing in your network, this is also possible.
However, it would not be a routing according the Dijkstra algorithm anymore.

To make use of the existing implementation, have a look at the Network Controller Atom in the Library. Here you will find the dijkstra algorithm called in the function NetworkController_OptimizeNetwork. It optimizes two tables (a distance and a node table). This would be the place to implement your own algorithm which results in two optimized tables. You can use 4DScript to write the algorithm.

Perhaps you can shed some light on what you want to achieve and what algorithm you want to use?

Regards,
Matthijs

Re: change Dijkstra's algorithm

Posted: Thursday 19 December, 2013 - 11:57
by manuel
hi,

i´m trying to get the fastest route (not the shortest). My advanced Transporter is really slow at corners, but the shortest route in the network consists of many corners. the advanced transporter would be much more faster, if he avoids this corners an drives an other route. I think i got to implement my own algorithm :cry: . thanks for your help!

Re: change Dijkstra's algorithm

Posted: Tuesday 31 December, 2013 - 11:53
by MatthijsJongboer
Hi Manual,
What you want to achieve is the combination of 2 variables resulting in 1 path. This is not possible with the Dijkstra algorithm. I would suggest to use only one variable (e.g. time) and create your tables accordingly. This will present quite some challenges depending on the level of detail you want to have. Having a single 'cost' for each node would simplify things.

Let us know what solution you come up with.
Gr. Matthijs