Question

SPANNING TREE AND GRAPH C++ (use explanation and visualization if needed) and also provide an algorithm...

SPANNING TREE AND GRAPH C++ (use explanation and visualization if needed) and also provide an algorithm

Do not need to provide code or a description of the algorithm in that case.

Let G be a simple, undirected graph with positive integer edge weights. Suppose we want to find the maximum spanning tree of G. That is, of all spanning trees of G, we want the one with the highest total edge weight. If there are multiple, any one of them is fine to find.

Describe a simple algorithm to accomplish this.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,

We can use, the opposite of Kruskal's algorithm for minimum spanning tree by choosing max edge weight in every step.

Kruskal's Algorithm for MAXIMUM Spanning tree:

  1. Sort all the edges in decreasing order(MAX to MIN) of their edge weights/costs.
  2. Pick the maximum cost edge.
  3. Check if it forms a cycle with the spanning tree formed so far.
    1. If cycle is not formed, include this edge.
    2. Else, discard it. Go to step 2 until there are (V-1) edges in the spanning tree.

Example:

Add a comment
Know the answer?
Add Answer to:
SPANNING TREE AND GRAPH C++ (use explanation and visualization if needed) and also provide an algorithm...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT