演算法›Ch4 圖論演算法第 38 題/共 111 題
38. Bellman-Ford、Shortest Path、Convergence
#AL-04-038中Bellman-FordShortest PathConvergence
一、單選題(共24分):該題答對得3分,答錯倒扣1分,未作答不給分。
- Given the following graph where vertex S is the source and the weight of each edge is specified alongside the edge, please apply the Bellman-Ford algorithm. During each pass/iteration of edge-by-edge relaxation, the order of edge to be processed is: AB, AD, BC, BF, CA, CD, CE, CF, DG, EG, FG, SA, SB (i.e., lexicographic order, assuming that an edge from vertex X to vertex Y is named XY).
For this particular graph and based on the aforementioned order of edge relaxation, how many passes/iterations are required for the Bellman-Ford algorithm to converge (i.e., to correctly find shortest paths from S to each of other vertices), and what is the shortest path distance from S to G? (NOTE: The Bellman-Ford algorithm requires P passes to converge if, for every vertex, the (P+1)th pass makes no improvement in shortest path distance.)

📄 交大115
▤完整推導請見《WH 資工筆記 · 演算法》Ch4 圖論演算法