I have this problem. I have a graph of n nodes that I want to split into two subgraphs of x nodes and n-x nodes subject to the constraint that the number of remaining edges is maximized (or minimizing the number of edges that are cut).
Not sure if that makes sense. Not a graph theory person but this is the abstract version of my problem. What algorithms should I look at that might help me?
This is NOT a homework problem. Interesting problem though I think!
I plan on implementing in C.
A split graph is a graph whose vertices can be partitioned into a clique and an independent vertex set.
In a complete graph or complete bipartite graph, every cut is a split.
Abstract—A decomposition of a graph G is a set D = {H1, ··· , Hk} of pairwise edge-disjoint subgraphs of G that cover the set of edges of G. If Hi is isomorphic to a fixed graph H, for 1 ≤ i ≤ k, then we say that D is an H-decomposition of G. In this work, we study the case where H is a path of fixed length.
The special case where x = n - x is called the minimum bisection problem and is NP-hard. This makes your problem NP-hard as well. There are several heuristics described in the Wikipedia article on graph partitioning, including local search (e.g., start with a random cut and repeatedly swap pairs of vertices that decrease the size of the cut) and spectral methods (e.g., compute and threshold the second eigenvector). If n is small, integer programming is also a possibility.
Perhaps a depth first search over nodes. We assign nodes one at a time and count the number of cuts so far. If that number exceeds the best solution's number, then we abort this one and backtrack.
I've been imagining this as a Prolog-type algorithm, but doing it in C shouldn't be too hard. Backtracking just means unassigning the last assigned node.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With