Reputation: 400
I am trying to solve the problem below. It is like k-minimum-spanning-tree and the steiner tree problem, but it is with a graph.
Am I correct that neither k-MST or the Steiner tree approximation solutions will work? If so, what is this problem called? And what are the solutions? I am fine with using heuristics or approximations to solve this problem and don't need formal proofs.
Upvotes: 3
Views: 2113
Reputation: 1707
You are correct that K-MST or Steiner tree won't work - they produce a tree only, while you need a graph with special properties, e.g. with 0 cost between vertices within U and minimal cost for all other edges if I understood your problem.
While juancn's answer looks correct, I think that using something like metaheuristic, e.g. simulated annealing, or constraint satisfaction approaches will be better.
For metaheuristics:
For constraint satisfaction:
sum (vertices==1) = k
For the last approach, constraint satisfaction, memory could be a problem - you need a lot of memory to represent a fully-connected graph and all constraints. Still, check Minizinc, lpsolve and coin-or projects.
Upvotes: 1
Reputation: 2613
I don't know if there's a faster algorithm, but the trivial one (if I got your explanation right) is:
If there are n vertices this is explores n!/(k! (n-k)!)
such combinations.
Upvotes: 2