Under the usual walk convention allowing repeated edges, the stated hypothesis is insufficient. Take the connected graph consisting of one zero-weight edge . It has no simple cycles, so the cycle condition holds. Nevertheless is a minimum-weight -walk of weight zero and is not a path.
If the course uses “walk” to mean an edge-nonrepeating trail, the intended argument is valid. If such a minimum trail repeats a vertex, take its first repeated-vertex segment. Its interior vertices are distinct and no edge repeats, so this segment is a simple cycle . Removing it leaves an -trail of weight , a contradiction. Hence is a path. Since every -path is a competing trail, it is a shortest path.
For unrestricted walks, the same proof works if every nontrivial closed subwalk has positive weight, in particular if every edge has positive weight. This is cycle erasure in minimum-weight walks. The exact 2017 course convention was not available to check; the counterexample and the trail interpretation distinguish the two meanings explicitly.
Let be the weight of a shortest -path, and let be the predecessor of on the chosen . Its prefix to must also be shortest: a cheaper prefix followed by the final edge would give a cheaper walk to , and cycle erasure in minimum-weight walks would produce a cheaper path because every edge weight is positive. Therefore
Following predecessor arrows strictly decreases , so cannot revisit a vertex. Since each nonroot vertex has a predecessor, finiteness forces every predecessor chain to end at . Thus is connected.
The edges are distinct: if two vertices selected the same undirected edge, each would be the other's predecessor, contradicting strict decrease. Hence has exactly edges. A finite connected graph with this edge count is a tree. This proves that positive-weight shortest-path predecessors form a tree, without requiring the initially chosen paths to be mutually consistent.