I have to find the difference between the worst and the best possible execution time in a DAG (directed acyclic graph) of tasks.
The DAG of tasks looks like the following: https://i.stack.imgur.com/IuES0.png
I already know that the worst possible execution time is 5 and the best possible execution time is 4. So the answer (the difference) is 1.
But I can't figure out how it is calculated.
In relation to what I have read, I guess the two vertices in the bottom are both initial vertices, since you should be able to get to all the other vertices from start.
I would really appreciate if somebody could explain to me how the worst and the best possible execution times are calculated.
The graph contains a path of four vertices, so you need at least 4 units of time regardless of the order of execution. It is easy to find an execution that is completed in 4 units of time.
As for the upper bound, there are 7 vertices, so you need at most 7 units of time. However, initially you have three possible start vertices, so in particular you will start by processing two tasks at once. Thus, the maximum amount of time needed is 6. Now where can we find another improvement in our upper bound? Think about it for yourself. In case you can't figure it out, you may consult the following hints and/or solution. But not after you've tried to figure it out for yourself for at least, say, 10 minutes. ;-)
Hint 1:
Hint 2:
Solution: