Difference issue

what is the difference between minimum weight hamiltonian path and minimum spanning tree?

@Rj.25 hey ,these both are not same as Every path is a tree, but not every tree is a path so you can say that this is difference.

please explain with an example

@Rj.25 Consider the triangle graph with unit weights - it has three vertices x,y,z, and all three edges {x,y},{x,z},{y,z} have weight 1. The shortest path between any two vertices is the direct path, but if you put all of them together you get a triangle rather than a tree. Every collection of two edges forms a minimum spanning tree in this graph, yet if (for example) you choose {x,y},{y,z}, then you miss the shortest path {x,z}.

In conclusion, if you put all shortest paths together, you don’t necessarily get a tree.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.