The Gateway to Computer Science Excellence

+45 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 __________

+5

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.

+75 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.$

+3

@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

0

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...

+52 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.

+17

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

+1

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.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,651 questions

56,214 answers

194,173 comments

95,428 users