Ties are a sort order
transcript
Two plans cost the same. One buys fewer uplinks. Both are valid answers. Which one does Kruskal give? It depends on the sort order. Decide it before you code.
Add a hidden origin node. Each uplink becomes a link. Now one graph holds every choice. Kruskal runs once on it.
Two uplinks cost seven each. Both servers need supply. The link between them costs seven. Uplinks first buys two. Link first buys one. Both cost fourteen.
Every uplink costs nineteen here. Look at one example. Links alone cost nine. The right plan costs thirteen. That plan mixes both.
The total is the same. The second number differs. A wrong order loses the goal. Always decide the tie first.
Sort by cost first. Then by kind. Two keys in one sort. Links come before uplinks.
A tie is a sort order. Choose it for the second goal. The tie is yours to choose. Links come before uplinks. Full breakdown in the lecture.