nil
| d | π | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 | |
| ∞ | ∞ | ∞ | ∞ | ∞ | 0 | 0 | 0 | 0 | 0 | |
| 2 | 9 | 3 | 7 | 9 | 0 | 0 | 0 | 0 | 0 | |
| 2 | 8 | 3 | 6 | 8 | 0 | 1 | 0 | 1 | 1 | |
| 2 | 8 | 3 | 6 | 7 | 0 | 1 | 0 | 1 | 3 | |
| 2 | 8 | 3 | 6 | 7 | 0 | 1 | 0 | 1 | 3 | |
| 2 | 8 | 3 | 6 | 7 | 0 | 1 | 0 | 1 | 3 | |
The shortest paths are the paths from vertex 0 in the spanning tree below:
The proof of the that G has no cycle would observe that G has 1 connected component, that when all G's edges are removed, it has as many components as vertices, and that adding each edge back to G would reduce the number of components by exactly one -- so it must be that adding each edge reduces the number of components by 1 and thus does not create a cycle.
x1 + x2 + x3 subject to z1 = 4 - x2 - x3 z2 = 0 - x1 - x2 + x3 z3 = 0 + x1 + x2 - x3Since x1 has a positive coefficient in the objective function, we solve the second constraint for it, so that we are now maximizing
2x3 - z2 subject to x1 = 0 - x2 + x3 - z2 z1 = 4 - x2 - x3 z3 = - z2Now x3 has a positive coefficient in the objective function. We solve the z1 constraint for it, so that we are now maximizing
8 - 2x2 - 2z1 - z2 subject to x1 = 4 - 2x2 - z1 - z2 x3 = 4 - x2 - z1 z3 = - z2All coefficients of variables in the objective function are now negative, so its maximum value is 8, and this value is attained by giving x1 and x3 each the value 4, and x2 the value 0.