1

Does anybody know this algorithm a little bit, because I'm considering using it, but I'm not sure whether it really meets all my requirements. So bascially, what I want to do is splitting up a graph in several subgraphs. However the nodes of each subgraph should be connected, that is it should not be the case that for example if I want to reach node x I have to go through another subgraph. And that is exactly my concern. Is it possible, that when I split up a graph with the Kernighan-Lin algorithm, that the nodes of the subgraphs will end up scattered all over?

Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
user2560216
  • 63
  • 1
  • 5

1 Answers1

1

Yes, K--L may create disconnected subgraphs. For example, it splits the 8-vertex star

* * *
 \|/
*-*-*
 /|
* *

into two 4-vertex subgraphs, of which one, the one not containing the center, is necessarily not connected. I don't know what you would want to happen on this example.

David Eisenstat
  • 64,237
  • 7
  • 60
  • 120
  • Hi, thanks for the clarification. Well, actually, I don't need the subsets to be of equal size. I just want to partition the graph. So in your example, I would like to have a number of subgraphs (how much should be specifiable) that are connected and according to the weights of the edges, minimal with respect to the internal costs of each subgraph. Do you know, by any chance, which algorithm might be better suited for this problem? Or is it possible to modify the K--L to meet my requirements? – user2560216 Jul 09 '13 at 06:44
  • @user2560216 It's a tough problem. If you really don't care about the balance, then find a vertex that's not a bridge and make that one of the subgraphs. If you do, finding the best balance possible turns out to be NP-hard. The first heuristic I would try would be to compute, for every edge in the graph, the min-cut between its endpoints. Then, using the min-cut weights as the new edge weights, find a minimum spanning tree. Then chop up the MST: removing an edge from a tree leaves exactly two connected components. – David Eisenstat Jul 09 '13 at 12:01
  • Ah ok, you try it this way. Today I found this paper from some Swedish researchers: http://soda.swedish-ict.se/5473/1/T2013_03.pdf I just skimmed through it rather quickly, but it looks intersting as well. For finding the min-cuts, would you use the Hao-Orlin algorithm? You know also my main concern is that the subgraphs are connected, I don't care that much about the balance of the subsets. – user2560216 Jul 10 '13 at 11:31