For example, for the digraph in Fig. 8.7 whose vertices are numbered from
1to4,matrixwill be as follows:
=⎡
⎢
⎢
⎣
0303
0013
4000
0310
⎤
⎥
⎥
⎦
The list of intermediate vertices on the shortest path from vertex to
vertex can be then generated by the call to the following recursive algo-
rithm, provided [ ]∞:
Algorithm ShortestPath( [1 1])
//The algorithm prints out the list of intermediate vertices of
11. First, for each pair of the straws, determine whether the straws intersect.
(Although this can be done in log time by a sophisticated algorithm,
the quadratic brute-force algorithm would do because of the quadratic