I teach a course in Discrete Mathematics, and part of the subject matter is a coverage of Prim's algorithm and Kruskal's algorithm for constructing a minimum spanning tree on a weighted graph. Students do not actually implement the algorithms in code; only pseudocode is given; students are asked to hand-trace the algorithm behaviors on a number of exercise and assessments.
In order to make the algorithms deterministic (and so exercises each have a unique solution), the textbooks I've seen generally give a further direction of, "assume that the vertices are ordered alphabetically" (e.g., Rosen Sec. 11.4 exercises 13-15). That is, this presents a deterministic tiebreak criterion, assuming edges are identified with letters themselves in alphabetical order. E.g.: if at some step of either algorithm, {a,d} and {b,c} are both eligible edges to be added with minimum weight, then the {a,d} edge will be chosen. (Here's an example student question arising from this direction.)
I've personally implemented both algorithms in C++ following this criterion, using an adjacency matrix for the underlying edge data. I've found that the exercise direction is clarified for students when we step through a minimal-search loop at least once, with the vertices stored in alphabetical order, and find that the selected edge is the first one found with minimal value.
So my question is: Do the algorithms of Prim and Kruskal always produce the same minimum spanning tree, given the tiebreak-by-alphabetical order criterion? (And ignoring any other possible implementation details.)
My first intuition was that I could sketch an example where the two algorithms produce different trees, but after several attempts I've failed to do so. I also wrote a Monte Carlo program to randomly create a few hundred thousand random weighted graphs, of various vertex, edge, and weight numbers, and send them through my implementation of both Prim's and Kuskal's algorithm; in all of my experimentation, they've produced identical minimum spanning trees.
Some things that are obviously known and not part of this question:
Here are some related questions, answers, and comments which do not resolve this question. None of these answers assume the deterministic ordering (alphabetic) criterion here, and therefore conclude that the ordering is ambiguous due to different possible underlying implementations: