I have the following problem:
I have a cyclic weighted graph (the graph is one big cycle) with N nodes (in the picture, there are 4 nodes); Node 1 being the starting node.
In the picture you can see blue numbers, which represent a point in time where an event occurs. Events always occur regularly (e.g.: 10,20,30... or 21,42,63 ...)
My agent has to "catch" all events (either going to a specific node and then waiting, or arriving simultaneously) and starts at time 0 at the starting node.
The red numbers are the weights (time to travel from one node to another).
The question/problem:
I need an algorithm that outputs the optimal way.
Optimal way = You have to "catch" all events and use the shortest time possible.
The problem is, I can only think of an algorithm that goes through all possible ways (e.g. Nodes 2-3-4, 2-4-3, 3-2-4, ...), but that's factorial (ouch).
Can anyone help me with my problem? Maybe you know a common algorithm that does something similar?
Well, any thoughts are appreciated.
P.S.: The purple numbers in the picture are all possibilities with their time they need (e.g. 2-3-4 and 3-2-4 only need 40 time units).
P.P.S.: One example (for the 2-3-4 possibility):
- Agent is at Node 1 at time 0
- Agent goes to Node 2, needs 4 time units -> t = 4
- Waiting for the event at Node 2 (so, we wait until t = 10)
- Agent goes to Node 3, needs 2 time units -> t = 12
- Waiting for the next event (until t = 21)
- Agent goes to Node 4, needs 2 time units -> t = 23
- Waiting for the last event (until t = 40)
- All events visited, done (with t = 40)
debp


Sign In
Create Account


Back to top









