0

So here is the problem: enter image description here

Ignore problem 7, i blanked out irrelevant parts.

I already know that the answer to Problem 8 is 13 as stated in the picture. But i dont know how to algorithmically come to this conclusion.

I know how to create a MST from a graph using Prims Algorithm, but I feel like there is a better way to quickly come up with an answer here.

user2327195
  • 263
  • 3
  • 10
  • Why do you think that the given graph is special and a better algorithm is possible? – Abhishek Bansal Dec 17 '14 at 06:23
  • The 5 vertices with lowest weights (1, 1, 3, 4, 4) in this graph form the spanning tree, so yes, it is relatively easy to find that tree in this graph (I used Kruskal's to create the spanning tree). – Vincent van der Weele Dec 17 '14 at 06:57

1 Answers1

0

As it says in this link :

This problem can be solved by many different algorithms. It is the topic of some very recent research. There are several "best" algorithms, depending on the assumptions you make:

  • A randomized algorithm can solve it in linear expected time.1
  • It can be solved in linear worst case time if the weights are small integers.2
  • Otherwise, the best solution is very close to linear but not exactly linear. The exact bound is O(m log beta(m,n)) where the beta function has a complicated definition: the smallest i such that log(log(log(...log(n)...))) is less than m/n, where the logs are nested i times.3

These algorithms are all quite complicated, and probably not that great in practice unless you're looking at really huge graphs. The book tries to keep things simpler, so it only describes one algorithm but doesn't do a very good job of it. I'll go through three simple classical algorithms (spending not so much time on each one).

So it is better to stick with Prim or Kruskal

  1. Karger, Klein, and Tarjan, "A randomized linear-time algorithm to find minimum spanning trees", J. ACM, vol. 42, 1995, pp. 321-328.
  2. Fredman and Willard, "Trans-dichotomous algorithms for minimum spanning trees and shortest paths", 31st IEEE Symp. Foundations of Comp. Sci., 1990, pp. 719--725.
  3. Gabow, Galil, Spencer, and Tarjan, Efficient algorithms for finding minimum spanning trees in undirected and directed graphs. Combinatorica, vol. 6, 1986, pp. 109--122.
Lrrr
  • 4,755
  • 5
  • 41
  • 63
  • Wasn't that easier to say that the tree has 5 edges and sum of first five shortest edges is at least 13, so it's the answer (w.r.t question). Also Tarjan's algorithm is not that complicated but it's not related to this question. Well, good references for further research. – Saeed Amiri Dec 21 '14 at 09:22
  • @SaeedAmiri I didnt want to just provide an answer to this question, this graph mst length could be solved just by simple checking, all i said was because those algorithms are bit complicated it is better to just use prim and then find the tree length, but if time is a real matter there are algorithms that can solve this issue in better time. – Lrrr Dec 21 '14 at 09:53
  • I see your point, but at the first place you should answer the asked question, then if you want you can give side notes. e.g in this answer randomized algorithm of X is not necessary to solve the problem for a fixed graph. – Saeed Amiri Dec 21 '14 at 17:36
  • @SaeedAmiri yes you are right, maybe my answer is too general. – Lrrr Dec 21 '14 at 17:54