The Gateway to Computer Science Excellence

+53 votes

Let $G$ be a complete undirected graph on $4$ vertices, having $6$ edges with weights being $1, 2, 3, 4, 5,$ and $6$. The maximum possible weight that a minimum weight spanning tree of $G$ can have is __________

+6

The question is asked such a way that you have make the weight maximum in a MST.No matter how you draw the graph you can't make the weight more that 7,It may be 6 or 7 but they asked about maximum possible weight that the MST have.So 7 is the maximum, You can' make it more than that because that will not be MST.

0

You took a given graph- but the question does not restrict to just one possible graph. For that graph you are correct.

0

you have tried for only one possibility. there will be many ways to draw it but no matter how you draw you will get the maximum possible weight of the minimum spanning tree is 7.

+4

My approach

you just make cycle with 3 min weight edge

so in this you will get two edges weight 1,2.

now 3 is included in cycle so we cant consider it

so now remaining 4,5,6

so min is 4 becouse complete graph we consider

so ans is 1+2+4

you just make cycle with 3 min weight edge

so in this you will get two edges weight 1,2.

now 3 is included in cycle so we cant consider it

so now remaining 4,5,6

so min is 4 becouse complete graph we consider

so ans is 1+2+4

+91 votes

Best answer

Many people here have not understood the question itself. Consider a complete graph of $4$ vertices. We have a total of $6$ edges of given weights but we do not have the exact graph. Many different graphs are possible each having a different structure. Consider these $2$ graphs, both of them are different. We do not know the exact structure of the graph, so what the question wants is to find the MST of all such structures and out of these tell the weight of the MST having maximum weight. The point about the MST of a graph with unique edge weights is valid for a given structure of the graph. With the same set of edge weights more than $1$ graph is possible and all of them can have different MSTs.

My solution: Draw a complete graph of $4$ vertices. Sort given edges $y$ weight in increasing order. Just like Kruskal's algorithm sort the edges by weight. MST of graph with $4$ vertices and $6$ edges will have $3$ edges. Now in any case we will have to include edges with weights $1$ and 2 as they are minimum and Kruskal's algorithm includes minimum weight edge if it does not form a cycle. We can not have a cycle with $2$ edges. In Kruskals algorithm, an edge will be rejected if it forms a cycle with the edges already selected. To increase the weight of our MST we will try to reject the edge with weight $3.$ This can be done by forming a cycle. The graph in pic1 shows this case. This implies, the total weight of this graph will be $1+2+4 = 7.$

My solution: Draw a complete graph of $4$ vertices. Sort given edges $y$ weight in increasing order. Just like Kruskal's algorithm sort the edges by weight. MST of graph with $4$ vertices and $6$ edges will have $3$ edges. Now in any case we will have to include edges with weights $1$ and 2 as they are minimum and Kruskal's algorithm includes minimum weight edge if it does not form a cycle. We can not have a cycle with $2$ edges. In Kruskals algorithm, an edge will be rejected if it forms a cycle with the edges already selected. To increase the weight of our MST we will try to reject the edge with weight $3.$ This can be done by forming a cycle. The graph in pic1 shows this case. This implies, the total weight of this graph will be $1+2+4 = 7.$

+4

@prateek, Question is asking about maximum weight of minimum MST.

that's why we have to take care of weight should be as minimum as possible and along with maximum value.

that's why we have to take care of weight should be as minimum as possible and along with maximum value.

0

it is possible because first of all we want mst along with max.weight ,so we have to take edge weight 1 , 2 and after that we have no other choice so we have to take 4 edge weight that mst will be max weight which follow the property, we can't take any other edge that will not be mst then

+1

if you really have understood the logic try to explain the logic writing 2 or 3 more lines so that a layman can also understand it , remembering what difficulties you faced while you were not getting the answer.. cause your answer to this question still did not clear the matter at all...im still in the same position where i was , after reading the previous answers...

0

why we are not using 1+2+5 = 8?

as it also forms a spanning tree

and wht is the meaning of max possible weight in min. spanning tree .(MST)min spanning tree, is itself contains irreducible cost. HOW COULD BE IT MAXIMUM?

as it also forms a spanning tree

and wht is the meaning of max possible weight in min. spanning tree .(MST)min spanning tree, is itself contains irreducible cost. HOW COULD BE IT MAXIMUM?

0

1,2,3 will be there in MST for the best case but In the question, we have to find-

The maximum possible weight that a minimum weight spanning tree of G can have

Step 1: Select 1,2 and 3 should be in the cycle if 3 is not in the cycle then it will be not our case.

Step 2: Now imagine 4,5,6 as maximum value set we can select 4 or 5 or 6 all are right but it is not asked ,we have asked the minimum value by selecting a maximum value as follows:-

$1+2+4 = 7 (\checkmark)$

$1+2+5 = 8 (\times)$

$1+2+6 = 9(\times)$

$1+3+4 = 8(\times)$

$1+3+5 = 9 (\times)$

$1+3+6 = 10(\times)$

$2+3+4 = 9(\times)$

$2+3+5 = 10 (\times)$

$2+3+6 = 11(\times)$

that is the reason 7 is the answer

+55 votes

+2

Yes, that's correct. We have to find the maximum weight, but it still has to be a Minimum spanning tree. Therefore you can't take 6 weight in the MST. Just take the next lightest weight.

+1

@Soumya Sharma 1

bcoz it is asking for maximum weight of MST. 1,2,3 forms a MST but it's weight is not maximum.

bcoz it is asking for maximum weight of MST. 1,2,3 forms a MST but it's weight is not maximum.

+22

Again cut and cycle property asked.

Since for a graph of 4 vertices, a spanning tree would have 3 edges,

there is no doubt that edge with weights 1 and 2 would definitely be included in MST because with 2 edges you cannot form a cycle.

Now, we are left to choose one edge with weights remaining as 3,4,5 and 6.

We want to make the weight of MST maximum.

Assign 3 such that it forms a cycle and hence it is rejected.

And now for the imagine graph as a cut and edges 4,5,6 passing the cut.

The lightest edge passing the cut is now 4 and hence included in MST of this graph.

Hence, maximum possible weight is 1+2+4=7.

0

@ayush Sir can you pls help me somehow with this question...

https://gateoverflow.in/3813/gate2005-it-52

actually i am not understanding the "cutset" term and the relation of the question with that ....

if possible pls help

+2

It's simple. Imagine you have a graph with a bridge.Now no matter what the weight of this bridge is, this bridge will be included in MST of G.

Similarly, the question says you have graph and it's MST has maximum weight edge.

I think you know definition of cut set of G.

Now the cut property says you can decompose the graph into two set of vertices such that the edges crossing the cut would have one endpoint in set 1 of vertices and another end in other set of vertices.

Now your graph can be imagined as joint made between two subcomponents and this joint is represented by the edges crossing the cut.

so lightest edge of this cut is included in mst of G.

For more details refer theorem 23.1 of coremen.

Similarly, the question says you have graph and it's MST has maximum weight edge.

I think you know definition of cut set of G.

Now the cut property says you can decompose the graph into two set of vertices such that the edges crossing the cut would have one endpoint in set 1 of vertices and another end in other set of vertices.

Now your graph can be imagined as joint made between two subcomponents and this joint is represented by the edges crossing the cut.

so lightest edge of this cut is included in mst of G.

For more details refer theorem 23.1 of coremen.

0

cut property ==> Lightest weight edge in cut set is always included in MST

In a graph cut edge with MIN weight is always included in MST

In a graph cut edge with MAX weight always excluded in MST

are this statement right ?? please correct me if wrong..this topic is very confusing for me :(

+1

@jatin -khachane 1-Your third statement is wrong.Consider a pendant edge and to this edge I assign a very heavy weight.You have to take this into MST without which your MST would be disconnected.

0

What we do if edges weight are

1,2,3,4,5,6,7,8,9 and 10.

than find maximum possible weight that a minimum weight spanning tree of G have..???

1,2,3,4,5,6,7,8,9 and 10.

than find maximum possible weight that a minimum weight spanning tree of G have..???

+28 votes

ans is 7.

it is said maximum weight pssbl.

draw a triangle. 3 sides weight 1 2 3. and 4th point is in center. join it with tringle vertices.. got more 3 sides. new side weight 4 5 6. now draw mst. take 1 take 2. cant take 3, so take 4. 1+2+4=7

it is said maximum weight pssbl.

draw a triangle. 3 sides weight 1 2 3. and 4th point is in center. join it with tringle vertices.. got more 3 sides. new side weight 4 5 6. now draw mst. take 1 take 2. cant take 3, so take 4. 1+2+4=7

0

are u sure coz i think its 6 (1+2+3 )

how can a graph with 7 as its weight be a minimum spanning tree when there is a spanning tree with weight 6 ??

how can a graph with 7 as its weight be a minimum spanning tree when there is a spanning tree with weight 6 ??

+16 votes

+11 votes

+10 votes

+5 votes

As other have explained with diagrams, the correct answer is 7. The explanation is as follows:

Keep in mind the Kruskal's algorithm for generating MST of a graph. It will pick edges in increasing order, and include them in MST if it does not form a cycle. So it will first pick edge of weight 1, then edge of weight 2 (2 edges cannot form a cycle). Now it will pick edge of weight 3 if it does not form a cycle, but since we want to maximize the weight, we will label edges of a triangle(cycle) with edge weights 1,2,3 respectively so that we cannot pick edge with weight 3 in our MST because it will then form a cycle. Therefore we have a configuration where the MST has 3 edges with weight - 1,2,4 and hence total weight = 7

Keep in mind the Kruskal's algorithm for generating MST of a graph. It will pick edges in increasing order, and include them in MST if it does not form a cycle. So it will first pick edge of weight 1, then edge of weight 2 (2 edges cannot form a cycle). Now it will pick edge of weight 3 if it does not form a cycle, but since we want to maximize the weight, we will label edges of a triangle(cycle) with edge weights 1,2,3 respectively so that we cannot pick edge with weight 3 in our MST because it will then form a cycle. Therefore we have a configuration where the MST has 3 edges with weight - 1,2,4 and hence total weight = 7

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.6k
- Digital Logic 2.9k
- Programming and DS 5k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.2k
- Databases 4.2k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.6k
- Others 2k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

51,925 questions

58,884 answers

200,229 comments

112,466 users