48 48 votes If all the edge weights of an undirected graph are positive, then any subset of edges that connects all the vertices and has minimum total weight is aHamiltonian cyclegridhypercubetree Graph Theory gateit-2006 graph-theory graph-connectivity easy + – Ishrat Jahan 13.8k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply anon1 commented Aug 29, 2021 reply Follow flag MST → TREE 4 4 replyShare pavansan commented Jan 3, 2025 reply Follow flag yes 0 0 replyShare legend_of_cse commented Apr 2 reply Follow flag Reasoning: Minimality and Connectivity To understand why the answer is a tree, we look at the two requirements provided in the problem:Connects all vertices: The subset must provide a path between every pair of vertices in the graph.Minimum total weight: The sum of the weights of the chosen edges must be as small as possible.Why not a Cycle (Hamiltonian, Grid, or Hypercube)?A tree is defined as a graph that is connected and acyclic (has no cycles). If a subset of edges contains a cycle, you can remove any one edge from that cycle and the graph will still be connected.Since the problem states all edge weights are positive, removing that extra edge will always result in a lower total weight. Therefore, any structure with a cycle (like a Hamiltonian cycle a grid, or a hypercube) cannot be the "minimum" weight subset.2. Formal Proof (by Contradiction)We can prove this property formally using the following logic:The Theorem:In an undirected graph $G = (V, E)$ where all edge weights $w(e) > 0$, any subset of edges $S \subseteq E$ that connects all vertices $V$ and has the minimum possible total weight $\sum_{e \in S} w(e)$ is a tree.The Proof:Assumption: Suppose $S$ is a subset of edges that connects all vertices and has the minimum total weight, but $S$ is not a tree.Property of Connected Non-Trees: If $S$ connects all vertices but is not a tree, it must contain at least one cycle.The Reduction: Let $C$ be a cycle in $S$, and let $e_{uv}$ be an edge in that cycle.Maintaining Connectivity: If we remove $e_{uv}$ from $S$, the graph remains connected because any path that previously used $e_{uv}$ can now go the "long way" around the remaining edges of the cycle $C$.Weight Comparison: Let the new set of edges be $S' = S - \{e_{uv}\}$. The total weight of $S'$ is:$$\text{Weight}(S') = \text{Weight}(S) - w(e_{uv})$$The Contradiction: Since all edge weights are given as positive ($w(e_{uv}) > 0$), it follows that:$$\text{Weight}(S') < \text{Weight}(S)$$This contradicts our initial assumption that $S$ was the subset with the minimum total weight.Conclusion: Therefore, $S$ cannot contain any cycles. A connected graph with no cycles is, by definition, a tree. 0 0 replyShare Please log in or register to add a comment.
Best answer 68 68 votes Hamiltonian cycle $\Rightarrow$ This is a cycle. A cycle will not only connect all vertices, it will have $1$ extra edge than necessary. So I can just remove that edge & get better cost "subset of edges" which connect all vertices. So, this is FALSE. grid $\Rightarrow$ A grid graph has cycles and so this is FALSE for same reason as option A. Hypercube $\Rightarrow$ A hypercube graph also has cycles. So, this also is FALSE. Tree $\Rightarrow$ This is answer. We need to have Minimum spanning tree to be exact. "If all the edge weights of an undirected graph are positive, then any subset of edges that connects all the vertices and has minimum total weight is a Minimum Spanning Tree". ! (D) is TRUE. Akash Kanase answered Dec 3, 2015 • edited Jun 17, 2019 by Arjun Akash Kanase comment Share Follow See all 2 Comments 2 2 Comments reply Nitesh Methani commented Jan 9, 2017 reply Follow flag I agree with the answer but only for this question... coz "tree" in general does not touch all the vertices..ri8 ? Tree is a subgraph which has no cycle..not necessarily contains "ALL" vertices.. 0 0 replyShare shraddha priya commented Apr 11, 2017 reply Follow flag @Nitesh here we are asked about a subset of EDGES and not Vertices. So to have all vertices and subset of edges so that weight is minimum, we definitely need to have a tree, an MST to be precise. 1 1 replyShare Please log in or register to add a comment.
12 12 votes Target : Get a subset of edges such that weight is minimum and it connects all vertices. Since, all weights are positive and we need a subset with minimum weight, then we should avoid cycles, coz we should have only a single path between any pair of vertices in the graph. Having a cycle will unnecessarily add up edge weight and will do no help in accomplishing the target. This rules out all options A, B and C. Hence, answer = option D amarVashishth answered Dec 4, 2015 amarVashishth comment Share Follow 0 reply Please log in or register to add a comment.
5 5 votes Tree is a minimally connected Graph. So, Option (D) is Correct. Himanshu1 answered Nov 18, 2015 Himanshu1 comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes I think it is (D) Sandeep_Uniyal answered Jan 18, 2015 Sandeep_Uniyal comment Share Follow See 1 comment 1 1 comment reply akash commented Jul 28, 2015 reply Follow flag is Hamiltonian Cycle not Possible?why? 0 0 replyShare Please log in or register to add a comment.
3 3 votes A minimum spanning tree is a spanning tree of a connected, undirected graph. It connects all the vertices together with the minimal total weighting for its edges. answer is D Nikhil Prasad answered Dec 19, 2015 Nikhil Prasad comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote The correct answer is Tree as explained above. Now some people may get confused regarding the correctness of this option as a tree may not necessarily connect all the vertices, which is true indeed. However, here we are not asked about the definition of tree. We are just given a scenario where we have a subset of edges that connects all the vertices and has minimum total weight. This is clearly a Minimum Spanning Tree and not any tree in general. However, an MST is still a tree (with some special properties) and so among the given options, Tree is correct. Sometimes questions like this are given, where none of the options are 100% correct, so we have to choose the option which is closest to being correct. vaibhavkedia968 answered Jul 14, 2020 vaibhavkedia968 comment Share Follow 0 reply Please log in or register to add a comment.