> However still I think that according to the line 8 in algorithm, all adjacent vertices of $a$ not in the tree must be added first to the tree. Thus $h$ should also get added immediately after $b$, before $c$. You are confusing the resulting MST `tree` (denoted $T$) with the intermediate priority queue $Q$. - All the vertices are already in $Q$ at the end of initialization (Lines 1 ~ 5). However, $T = \emptyset$ at this time point. - A vertex $u$ is extracted from $Q$ and becomes a member of tree $T$ at line 7. - In the loop starting from Line 8, vertice $v$ satisfying the requirements of Line 9 are *not* inserted into the tree $T$; instead their keys in the priority queue $Q$ are changed (in fact, decreased).