In this MIT video regarding Prims algorithm for minimum spanniing tree the professor explains π[v] ←u
at time 71:16 seconds . But I do not understand why we need this step . What does this notation π[v] ←u
mean actually ? Also what does the last line in the algorithm that follows mean ?
The entire algorithm given in the source is as follows :
Q←V
key[v] ←∞for all v∈V
key[s] ←0for some arbitrary s∈V
while Q≠∅
do u←EXTRACT-MIN(Q)
foreach v∈Adj[u]
do ifv∈Qand w(u, v) < key[v]
then key[v] ←w(u, v)⊳DECREASE-KEY
π[v] ←u
At the end, {(v, π[v])}forms the MST