# Will MST find the shortest path for each pair $(r,v)$?

Will local best choice will lead to global best choice? In other words, I'm thinking about whether it's possible that the MST has to put its branch location in the middle of two far nodes A,B and thus would make the path from root to A and B respectively not the global minimum?

This is Prim's algorithm, at page 634 (655 is pdf reader page):

While this is Dijkstra, at page 658 (679 is pdf reader page):

Book: Introduction to Algorithm 3ed.

No, the MST may not find the shortest path for each pair of nodes $$(r,v)$$.
For example, consider a graph of three vertices $$A,B,C$$ with edge weight $$AB\mapsto 2, AC\mapsto 2, BC\mapsto 3$$. Its MST is edges AB and AC. However, the shortest path between $$B$$ and $$C$$ is the edge BC.