Graph theory
In this example, in the picture, a container ship traveled across routes between Asia and Europe. This ship visited 11 countries.The countries are the nodes in this picture, and their travel ruts are the links.
-
If we start from Singapore(sg) using the BFS algorithm, considering the alphabetical order of the name of nodes, the distances of Italy(it), France(fr), and Turkey(tr) are:
- I) 5,4,2
- II) 5,4,3
-
Using the algorithm DFS the path from Grece(gr) to Italy(it) is:
- III) gr-tr-eg-ae-it
- IV) gr-eg-ae-it
- V) gr-eg-fr-ae-it
- A) I,IV
- B)II,IV.
- C)I,V
- D) II,III
- E) None of the above.
Interesting question, but I cannot take it. When you say, 'alphabetical order of the names of nodes', are you referring to the names inside the circles (e.g., Italy) or the names outside the circles (e.g., it)? Not clear. Also, please end with 'Original idea by: ' and your name.
ReplyDelete