K-Connected Spanning Subgraph
Background
Consider that you are given a transportation network, which is a graph. Now you are asked to find out a sub-graph that the transportation capacity between any two sites in the sub-graph is above some threshold k.
This sub-graph could be viewed as kind of a backbone. Its importance is as follows: even if some lines in the transportation network break down, so long as the lines of this sub-graph operates, we can guarantee that the network is able to transport k capacity cargo between any two sites.
If we examine this problem deeply, we may ask the following questions:
- Does such a sub-graph exist?
- If such a sub-graph exist, how to find one with the minimum number of edges?
Solution
Existence could be answered right now. If the minimum cut of the graph is no less than k, then we could find such a sub-graph. A trivial case is the graph itself. But the second one is difficult. It is believed that this is a NP hard problem.
Approximation algorithms are proposed. One of them was given by Hiroshi Nagamochi and Toshihide ibaraki [A Linear-Time Algorithm for Finding a Sparse k-Connected Spanning Subgraph of a k-Connected Graph] in 1992.
We firstly formalize the notions. To simplify the problem, we focus on graphs that are undirected and consist of no multiple edges and self loops.
k-Connected Graph: A graph is k-Connected if the minimum cut of the graph is no less than k.
Nagamoci-Ibaraki Algorithm Given a graph , if is the maximal spanning forest of , the is a k-Connected Sub-graph with edges if , where is the minimum cut of G.
Here only a scratch of proof is given. Consider a particular cut C in G, whose value is no less than . For any with , it must consist of at least one edge of C. Otherwise we could add an arbitrary edge in to such that is still a forest, contradicting is maximal.
Finding a maximal forest in requires time. So is required for k-Connected Graph. Nagamochi and Ibaraki did it in time. They scaned all nodes and edges once and classify edges into different , here .
Pseudo Code:
- h(v) = 0,
- $E_i = \emptyset, \forall i \in [1..|E|] $
- while that has not been scanned
- find u with maximum h(u)
- marked u as scanned
- for all that has not been scanned
- marked (u,v) as scanned.
- if h(u) == h(v) then
- ++h(u)
- end if
- ++h(v)
- end for
end while
Analysis
To see that the algorithm indeed works, we have to check two things:
- is a forest, i.e., does not contain a cycle.
- is maximal.
doesn't contain a cycle: suppose that when u is being scanned and (u,v) is added to , a cycle is created. Then some edge incident to v belongs to . Thus h(v) >= i before (u, v) is added to . But (u,v) is added to after . So . A contradiction.
is maximal. If is not maximal, there is some edge for some such that is a forest. Denote the tree containing u in by and the one containing v in by . Further, denote the order of nodes in and being scanned by respectively. Without losing generality, suppose is scanned before . When is scanned, we must have and . After is scanned, . For any other node such that , we guarantee that before is scanned and , otherwise z is scanned before . Now , it's scanned before . Following this way, u is scanned before . When u is scanned, . So (u, v) is add to some for . A contradiction.
The number of edges in
Suppose the order of nodes being scanned in V is . The value of could not exceed i, since there are at most one edge incident to for some j less than i. So does not appear in forest for . Then contains at most |V| - 1 - (k - 1) = |V| - k edges. Thus the number of edges in is at most