Question-48
Data Structure
Graph
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Every entry W[i][j]
where \(i \ne j\) in the matrix W
below is the weight of the edge from vertex i
to vertex j
.
\[
W=\begin{bmatrix}0 & 1 & 8 & 1 & 4\\1 & 0 & 12 & 4 & 9\\8 & 12 & 0 & 7 & 3\\1 & 4 & 7 & 0 & 2\\4 & 9 & 3 & 2 & 0\end{bmatrix}
\] What is the minimum possible weight of a path P
from vertex 4
to vertex 1
in this graph?
Answer
\(4\)