Connecting Tech Pros Worldwide Forums | Help | Site Map

Question About Minimum Spanning Tree

BigBaz
Guest
 
Posts: n/a
#1: Nov 20 '08
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.

Thanks in advance.

Giff
Guest
 
Posts: n/a
#2: Nov 20 '08

re: Question About Minimum Spanning Tree


BigBaz wrote:
Quote:
Thanks in advance.
What is the question? And what is the c++-related question?
Juha Nieminen
Guest
 
Posts: n/a
#3: Nov 20 '08

re: Question About Minimum Spanning Tree


BigBaz wrote:
Quote:
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.
You are supposed to do your homework yourself, not ask others to do it
for you.
Jeff Schwab
Guest
 
Posts: n/a
#4: Nov 20 '08

re: Question About Minimum Spanning Tree


BigBaz wrote:
Quote:
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.
Enumerate all combinations of arcs in G into a sequence,
all_arc_combinations. Copy the combinations that are spanning trees
into a new sequence, all_spanning_trees. [1] Sort the spanning trees by
total weight, and return the least element of the sorted sequence.

Make sure you run your code to completion on a graph with at least a few
hundred nodes, so you'll know it's working.

[1] To tell whether a given combination of arcs is a spanning tree: A
priori (for efficiency), enumerate all combinations of nodes in G into a
set, all_node_combinations. Copy both nodes from each arc in the
arc-combination into a node-combination,
nodes_in_potential_spanning_tree. (Be careful to preserve duplicate
nodes, or else you might mis-identify a cyclic subgraph as a tree.) If
all_node_combinations contains nodes_in_potential_spanning_tree, the
arc-combinations is a spanning tree of G.
red floyd
Guest
 
Posts: n/a
#5: Nov 20 '08

re: Question About Minimum Spanning Tree


BigBaz wrote:
Quote:
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.
>
Thanks in advance.
A complete answer can be found here:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.2

Hope that helps.
BigBaz
Guest
 
Posts: n/a
#6: Nov 20 '08

re: Question About Minimum Spanning Tree


On Nov 20, 9:53*am, red floyd <no.spam.h...@example.comwrote:
Yes, I will try to do it myself. But this algorithm is different from
the normal algorithm of finding mst, otherwise the question will just
ask me how to find a mst. So clearly there's some difference. Any help
would be appreciated.

Jeff_Schwab, is your algorithm efficient? Thanks!


Quote:
BigBaz wrote:
Quote:
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.
>
Quote:
Thanks in advance.
>
A complete answer can be found here:
>
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
>
Hope that helps.
Jeff Schwab
Guest
 
Posts: n/a
#7: Nov 20 '08

re: Question About Minimum Spanning Tree


BigBaz wrote:
Quote:
Jeff_Schwab, is your algorithm efficient? Thanks!
No. The algorithm I posted is so remarkably inefficient that it is
completely impractical. That's sort of why I posted it; you haven't
made any apparent effort to even think about solutions to the problem.
This isn't really the right place to ask a pure CS question, anyway.

Good luck.
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
Guest
 
Posts: n/a
#8: Nov 20 '08

re: Question About Minimum Spanning Tree


On 2008-11-20 11:04, BigBaz wrote:
Quote:
Given a graph G and a minimum spanning tree T, suppose that we
decrease the weight of one of the edges that is not in T. Give an
algorithm that finds the minimum spanning tree in the modified graph.
T' = T
Quote:
Thanks in advance.
Your welcome.

--
Erik Wikström
Closed Thread