• No results found

2.2 Faithful BCNF Decomposition

3.1.3 Computing Autonomous Sets

To complete this section, we now address the question of computing the minimal au- tonomous sets of H. While Theorem 3.18 suggests an approach (at least for simple hypergraphs), computing the transversal hypergraph can lead to exponential runtime. Instead, we shall utilize the following observation.

Lemma 3.24. Let H be a hypergraph on V andP ={S1, . . . , Sn} the partition of V into

minimal autonomous sets. Let further H0

1 H[S1] be non-empty, and H0 H be the

hypergraph

H0 :=H10 ∨H[S2]∨. . .∨H[Sn].

Then S2, . . . , Sn are minimal autonomous sets of H0.

Proof. By definitionS2, . . . , Snare autonomous forH0. If one of thoseSi were not minimal

for H0, i.e., could be partitioned into smaller autonomous sets T

1, . . . , Tk, then

H[Si] = H[T1]∨. . .∨H[Tk]

and thus the sets Ti would be autonomous for H as well, contradicting the minimality of

Si.

We use this to compute the partition of V into minimal autonomous sets as follows. We pick some vertexv ∈V and splitH into two hypergraphs, one containing all the edges which containv, the other one containing all those edges which do not contain v. We will need only one of them, so let Hv be the smaller one of the two, i.e., the one with fewer

edges (if both contain exactly the same number of edges we may choose either one):

Hv := smaller of

½

{e∈H |v ∈e} {e∈H |v /∈e}

If Hv is empty, then v lies in all or no edges of H, and in both cases the set {v} is

autonomous for H. This reduces the problem of finding the minimal autonomous sets of

H to finding the minimal autonomous sets ofH[v], where v :=ϑH \ {v}, as they are also

minimal autonomous sets of H.

Consider now the case whereHv is not empty. LetS1 be the minimal autonomous set

of H containingv. Then Hv has the same form as H0 in Lemma 3.24, whereH10 contains

either the edges of H[S1] which do or those which do not contain v. We now compute

the minimal autonomous sets of Hv, and check for each set whether it is autonomous for

H. By Lemma 3.24 the sets autonomous for H are exactly the S2, . . . , Sn, while the sets

not autonomous for H partition S1. Taking the union of those non-autonomous sets and

keeping the autonomous ones thus gives us the minimal autonomous sets ofH. Note that the set {v}is always autonomous for Hv, asv is contained in either all or no edges ofHv.

Thus it suffices to compute the minimal autonomous sets of Hv[v].

In either case we have reduced the problem of finding the minimal autonomous set of

H to that of finding the minimal autonomous sets of a hypergraph with fewer vertices. This gives us the following recursive algorithm.

Algorithm “Recursive Autonomous Partitioning” INPUT: hypergraph H

OUTPUT: partition of ϑH into minimal autonomous sets

function RAP(H) select vertex v ∈ϑH Hv := smaller of ½ {e∈H |v ∈e} {e∈H |v /∈e} if Hv = then return {{v}} ∪RAP(H[v]) else Aut :=∅, S1 :={v} Autv :=RAP(Hv[v])

for all S∈Autv do

if S autonomous forH then

Aut :=Aut∪ {S} else

S1 :=S1∪S

end

return {S1} ∪Aut

While the test whether a setS is autonomous for H can be performed by computing

H0 :=H[S]H[S] and comparing it to H, the resulting set can easily contain up to |H|2

edges if S is not autonomous. We observe that always H H0 and thus H = H0 iff

|H|=|H0|. Since|H0|=|H[S]| · |H[S]|, the later condition can be checked faster without

actually computing H0.

Theorem 3.25. Let H be a hypergraph with k vertices and n edges. Then the ”Re- cursive Autonomous Partitioning” algorithm computes the partition of ϑH into minimal

autonomous sets of H in time O(nk2).

Proof. We have already argued that the algorithm computes the minimal autonomous sets of H correctly, so we only need to show the time bound.

The depth of recursion is at most k. In each call we compute Hv, which can be done

in O(n). If Hv = we only need to compute H[v], which is possible in O(nk). Thus this

part of the algorithm can be performed in O(nk2).

If Hv 6= we need to test each set found to be autonomous for Hv whether it is

autonomous forH. The number of such tests is at most k, and each test can be performed in O(nk), by computing H[S] and H[S] and testing whether |H| =|H[S]| · |H[S]|. This leads to a complexity of O(nk2). Since the number of edges of H

v is at most half of the

number of edges of H, the number of steps required for performing the tests on Hv (or

the next subgraph in the recursion for which tests are required) is at most half as many. This leads to a total complexity of

O((n+n 2 +

n

4 +. . .)k