Branch and Recharge: Exact algorithms for generalized domination Fedor V. Fomin

advertisement
Branch and Recharge: Exact algorithms for generalized
domination
Fedor V. Fomin∗
Petr A. Golovach†
Jan Kratochvı́l‡
Dieter Kratsch§
Mathieu Liedloff§
Abstract
Let σ and be two sets of nonnegative integers. A vertex subset S ⊆ V of an
undirected graph G = (V, E) is called a (σ, )-dominating set of G if |N (v) ∩ S| ∈ σ
for all v ∈ S and |N (v) ∩ S| ∈ for all v ∈ V \ S. This notion introduced by J. A.
Telle generalizes many domination-type graph invariants.
We show a general algorithm enumerating all (σ, )-dominating sets of an input
graph G in time O∗ (cn ) for some c < 2 using only polynomial space, if σ is successorfree, i.e., it does not contain two consecutive integers, and either both σ and are finite,
or one of them is finite and σ ∩ = ∅. Thus in this case one can find maximum and
minimum (σ, )-dominating sets in time o(2n ), though for many particular choices of σ
and already the existence of a (σ, )-dominating set is NP-complete. Our algorithm
straightforwardly implies a non trivial upper bound cn with c < 2 for the number of
(σ, )-dominating sets in an n-vertex graph under the above conditions on σ and .
Finally, we also present algorithms using a Sort & Search paradigm to find maximum and minimum ({p}, {q})-dominating sets and to count the ({p}, {q})-dominating
sets of a graph in time O∗ (2n/2 ).
1
Introduction
We consider finite undirected graphs without loops or multiple edges. Thus a graph is a
pair G = (V, E) where V is the (finite) set of vertices and E the set of edges. The size
of G is the number of vertices, and throughout the paper we reserve n = |V | to denote
this quantity. We call two vertices u, v adjacent if they form an edge, i.e., if uv ∈ E. The
open neighborhood of a vertex u ∈ V is the set of the vertices adjacent to it, denoted by
N (u) = {x : xu ∈ E}, and the closed neighborhood is defined as N [u] = N (u) ∪ {u}. A
set of vertices S ⊆ V is dominating
if every vertex of G is either in S or adjacent to a
vertex in S, i.e., if V = u∈S N [u]. Finding a dominating set of the smallest possible
size belongs to the most important optimization problems on graphs. In some sense the
problem is harder than typical graph invariants such as clique or independent set – the
∗
Department of Informatics, University of Bergen, 5020 Bergen, Norway. E-mail: fomin@ii.uib.no
Department of Applied Mathematics, Faculty of Mathematics, Syktyvkar State University, Syktyvkar
167001, Russia. E-mail: golovach@syktsu.ru
‡
Department of Applied Mathematics, Charles University, Malostranské nám. 25, 118 00 Praha 1,
Czech Republic. E-mail: honza@kam.ms.mff.cuni.cz
§
Laboratoire d’Informatique Théorique et Appliquée, Université Paul Verlaine - Metz, 57045 Metz
Cedex 01, France. E-mail: (kratsch|liedloff)@univ-metz.fr
†
1
problem is NP-hard even for chordal graphs, and the fixed-parameter version is W[2]-hard.
Many generalizations have been studied, such as independent dominating set, connected
dominating set, efficient dominating set, etc. (cf. [8])
In [13], J.A. Telle introduced the following framework of domination-type graph invariants. Let σ and be two sets of non negative integers. A vertex subset S ⊆ V of an
undirected graph G = (V, E) is called a (σ, )-dominating set of G if |N (v) ∩ S| ∈ σ for
all v ∈ S and |N (v) ∩ S| ∈ for all v ∈ V \ S. The following table shows a sample of
previously defined and studied graph invariants which can be expressed in this framework.
σ
N0
{0}
N0
{0}
{0}
{0}
{1}
N
{1}
{r}
N
N0
{1}
{1}
{0, 1}
N
{1}
N
N0
N0
(σ, )-dominating set
dominating set
independent set
efficient dominating set
1-perfect code
strong stable set
independent dominating set
total perfect dominating set
total dominating set
induced matching
r-regular induced subgraph
Table 1: Examples of (σ, )-dominating sets, N is the set of positive integers, N0 is the set
of nonnegative integers.
We are interested in the computational complexity of decision and search problems
related to (σ, )-domination. Explicitly, we consider the following problems parameterized
by σ and .
∃(σ, )-DS: Does an input G contain a (σ, )-dominating set?
Enum-(σ, )-DS: Given a graph G, list all (σ, )-dominating sets of G.
#-(σ, )-DS: Given a graph G, determine the number of (σ, )-dominating sets of G.
Max-(σ, )-DS: Given a graph G, find a (σ, )-dominating set of maximum size.
Min-(σ, )-DS: Given a graph G, find a (σ, )-dominating set of minimum size.
Obviously, the enumeration problem Enum-(σ, )-DS is the most difficult one, since as
soon as we have all (σ, )-dominating sets in a list, we can quickly see if the list is nonempty
(and hence answer the ∃(σ, )-DS problem), we can also compare the sizes of the listed
sets to answer the minimization and maximization questions, and we can quickly count
the number of listed sets. However, maybe slightly surprisingly, already the existence
problem is NP-complete for many parameter pairs σ and , including some of those listed
in Table 1 (1-perfect code and total perfect dominating set). In fact, Telle [13] proves that
∃(σ, )-DS is NP-complete for every two finite nonempty sets σ, such that 0 ∈ .
There are several ways how to deal with NP-hard problems. One may look for heuristics
or approximation algorithms, or aim at speeding up the (exponential) running time of exact
2
algorithms. The latter approach is also the goal of the present paper. We present a O∗ (cn )time1 algorithm for the Enum-(σ, )-DS problem, where the constant c < 2 depends on σ
and , for a fairly wide class of parameter sets σ and .
The main contribution of the paper is three-fold. First it is the general algorithm for a
large class of domination-type problems. Secondly, the technique used in the running time
analysis is a combination of standard Branching algorithm with Recharging (motivated
by recharging techniques used in many proofs of especially graph coloring theorems). As
such we find the technique, which we call Branch & Recharge, new and we hope it can be
found useful for other problems as well. Thirdly, an upper bound on the running time of an
enumeration algorithm immediately implies an upper bound on the number of enumerated
objects. Thus our Branch & Recharge algorithm has a combinatorial corollary that every
graph with n vertices contains at most O∗ (cn ) (σ, )-dominating sets (under the same
assumptions on σ and ). This situation is interesting in its own. For many fast exact
algorithms, the running time analysis is based on combinatorial theorems bounding the
number of certain objects (most typically of maximal independent sets). Here, the time
analysis of a branching algorithm yields the proof of the combinatorial upper bound.
Another combinatorial result of this type is the well-known Moon-Moser theorem stating that the maximum number of maximal cliques (resp. maximal independent sets) of an
n-vertex graph is 3n/3 [11]; however its original proof is combinatorial. Recently Fomin et
al. obtained an upper bound of 1.7697n for the maximum number of minimal dominating
sets in a graph by the analysis of an exact exponential-time algorithm [4]. In general, exact exponential-time algorithms and their analysis seem to be useful tools to obtain such
combinatorial results (up to a polynomial factor).
Finally, we use a classical (though less known) technique for the design of exact algorithms. In his seminal survey paper [14] on exact algorithms Woeginger describes how to
design algorithms using this paradigm that solve the subset sum problem and the binary
knapsack problem in time O∗ (2n/2 ) (instead of time O∗ (2n ) by exhaustive search). The
basic idea is a clever use of sorting and searching, and thus we call it Sort & Search. We
establish O∗ (2n/2 ) time algorithms for the ∃(σ, )-DS, Min-(σ, )-DS, Max-(σ, )-DS and
the #-(σ, )-DS problem in the case that σ and are singletons.
Our paper is organized as follows. In Section 2 we present basic observations on (σ, )dominating sets and also discuss our condition imposed on the parameter sets σ and .
The Branch & Recharge algorithm is introduced in Section 3. The combinatorial upper
bound on the number of (σ, )-dominating sets is discussed in Section 4. The Sort &
Search based algorithms are presented in Section 5.
2
Preliminaries and the Main Theorem
We call a set of integers successor-free if it contains no pair of consecutive integers. In
the rest of the paper we use the notation p = max σ and q = max (with p = ∞ if σ is
infinite, and q = ∞ if is infinite).
A graph on n vertices may contain as many as 2n (σ, )-dominating sets, e.g., if 0 ∈ σ∩,
then the edgeless graph does. Another less trivial example is σ = = {0, 1, . . . , d}, since
then any set of vertices in a graph of maximum degree d is (σ, )-dominating. Therefore,
1
As has recently become standard, we write f (n) = O∗ (g(n)) if f (n) ≤ p(n) · g(n) for some polynomial
p(n).
3
if we aim at enumeration algorithm significantly faster than O(2n ), some restrictions must
be imposed on the parameter sets σ and . The following examples show that one cannot
enumerate all (σ, )-dominating sets within complexity O∗ (cn ) for some c < 2, if either σ
and both are infinite, or if one of σ and is infinite and both are intersecting. First take
G = Kn , σ the set of even integers and the set of odd integers. Second, take G = K1,n−1 ,
σ = 0 and = N0 . In any case, requiring σ to be successor-free is necessary to make the
recharging mechanism of our algorithm work (see subroutine Forcing-a below).
Another obvious observation concerns disconnected graphs. The number of (σ, )dominating sets in a graph is equal to the product of the numbers of (σ, )-dominating
sets in its connected components. Hence it would suffice to consider connected graphs.
However, the analysis of our algorithm also works for isolate-free input graphs (i.e., graphs
without isolated vertices), which is more interesting for the main combinatorial result of
our paper:
Theorem 1. If σ is successor-free and either both σ and are finite, or one of them is
finite and σ ∩ = ∅, then every isolate-free graph contains at most cn (σ, )-dominating
sets, where c = cσ, < 2 is a constant depending on σ and . Moreover, all the (σ, )dominating sets can be enumerated in time O∗ (cn ) (where c is the same constant).
The theorem is proved algorithmically in the next two sections. As already mentioned
in the Introduction, the algorithm solves not only the enumeration problem Enum(σ, )DS in time O∗ (cn ), but also the #-(σ, )-DS, ∃(σ, )-DS, Max-(σ, )-DS and Min-(σ, )DS problems (only the polynomial factor in the star-notation is different). It is worth
noting that the constant c depends only on p and q.
Recent results of Gupta et al. [6] give enumeration algorithms and lower and upper
bounds for the number of maximal r-regular subgraphs in a given graph. Induced r-regular
subgraphs are ({r}, N0 )-dominating sets, and thus this result is related to our work. As
can be expected for a special case, their bounds are better than our general bounds.
3
The Branch & Recharge algorithm
Throughout the rest of the paper we assume that σ and satisfy the assumptions of
Theorem 1. The algorithm is based on the Branch & Reduce paradigm and consists of
only one simple branching rule. To guarantee a running time faster than 2n , the branching
is combined with a recharging mechanism. The key idea of the algorithm is to guarantee
that in any branching step on a chosen vertex v the measure (resp. size) of the input
decreases by at least 1 when v is discarded, and it decreases by at least 1 + when v is
selected into the so far generated candidate for a (σ, )-dominating set. Here > 1 is a
constant dependent on σ and (in fact, on p and q only). The usage of the branching
vector (1, 1 + ) with > 0 immediately implies that the running time is faster than 2n .
Initially every vertex v ∈ V of the isolate-free input
graph G = (V, E) is assigned
weight w(v) = 1. The total weight of the graph is w(G) = v∈V w(v) = n. The algorithm
recursively builds candidate sets S for (σ, )-dominating sets in G. It recursively calls
procedure SigmaRho which consists of three subroutines: Forcing (which identifies vertices
that must or must not be placed in S), Recharge (which prepares the grounds for the next
subroutine by sending charges of along certain edges), and Branch (the core of the
algorithm, as it is responsible both for the exponential running time of the algorithm and
4
for the base of the exponential function). All these subroutines and the procedure work
with the same graph G and leave it unchanged, and with a global variable L which is the
list of candidate sets S. Their parameters are S, S (containing the vertices discarded from
the candidate set), the weight function w and an auxiliary directed graph H which is an
orientation of a spanning subgraph of G (H is tracking the recharging moves). Moreover,
Forcing, Recharge and Branch are called on a particular free vertex v. At every stage
of the algorithm a vertex is called free if it does not belong to S ∪ S. Free vertices keep
positive weights, allocated vertices get weight zero. Once a vertex is allocated in S (we
say it is selected) or in S (we say it is discarded) it never changes its status during further
calls. We will now describe the details in pseudocode (the global variable L and the input
graph G are not listed in the preamble). The choice of is
1
if both σ and are finite
1+max(p,q)
=
1
if one of σ, is infinite.
1+min(p,q)
Procedure SigmaRho(S, S, w, H)
if there is no free vertex then L := L ∪ {S}
else
let v be the last free vertex in the BFS ordering of V
if v = v1 then
/* v1 is the first vertex in the BFS ordering computed in the
preprocessing of the Algorithm Main-EnumSigmaRho (see below)
L := L ∪ {S, S ∪ {v}}
*/
else
Forcing(v, S, S, w, H)
if Forcing halted then Halt
if v is still free then
Recharge(v, S, S, w, H)
Branch(v, S, S, w, H)
else SigmaRho(S, S, w, H)
Subroutine Recharge(v, S, S, w, H)
if w(v) < 1 then
let {w1 , . . . , wt } = {x : vx ∈ E(H)}
for i := 1 to t do
let ui be another free neighbor (in G) of wi
for i := 1 to t do
w(ui ) := w(ui ) − E(H) := (E(H) ∪ {ui wi }) \ {vwi }
w(v) := 1
Comment : Note that w1 , . . . , wt are distinct vertices, while u1 , . . . , ut need not be.
If some u is the chosen free neighbor of several, say k, vertices from w1 , . . . , wt , then its
weight drops by k and also k edges starting in u are added to H. Lemma 5 shows that
wi always has another free neighbor in G.
5
Subroutine Branch(v, S, S, w, H)
1. S := S ∪ {v}; w(v) := 0; SigmaRho(S, S , w, H)
2. let u be a free neighbor of v
S := S ∪ {v}; w(v) := 0; w(u) := w(u) − ; E(H) := E(H) ∪ {uv}
SigmaRho(S, S, w, H)
The last subroutine depends on the finiteness of σ and . If both sets are finite, (note
that (1 + max(p, q)) = 1 in this case) we define Forcing as the subroutine Forcing-a
(see below). If one of σ, is infinite (and σ ∩ = ∅), we define the Forcing subroutine as
Forcing-b (note that (1 + min(p, q)) = 1 in this case).
Subroutine Forcing-a(v, S, S, w, H)
if ∃x ∈ S s.t. v is its unique free neighbor then
case
|N (x) ∩ S| ∈ σ then S := S ∪ {v}, w(v) := 0
|N (x) ∩ S| + 1 ∈ σ then S := S ∪ {v}, w(v) := 0
{|N (x) ∩ S|, |N (x) ∩ S| + 1} ∩ σ = ∅ then Halt
if ∃x s.t. |N (x) ∩ S| > max{p, q} then Halt
Subroutine Forcing-b(v, S, S, w, H)
while (∃x s.t. x is free and |N (x) ∩ S| > min{p, q}) or (∃y ∈ S, z ∈ S ∪ S s.t. z is the
unique free neighbor of y) or (∃u ∈ S ∪ S with no free neighbor) do
let x or y, z or u be such vertices
case
|N (x) ∩ S| > max{p, q} then Halt
|N (x) ∩ S| > p then S := S ∪ {x}; w(x) := 0
|N (x) ∩ S| > q then S := S ∪ {x}; w(x) := 0
|N (y) ∩ S| ∈ σ then S := S ∪ {z}; w(z) := 0
|N (y) ∩ S| + 1 ∈ σ then S := S ∪ {z}; w(z) := 0
{|N (y) ∩ S|, |N (y) ∩ S| + 1} ∩ σ = ∅ then Halt
|N (u) ∩ S| ∈ σ then S := S ∪ {u}; w(u) := 0
|N (u) ∩ S| ∈ then S := S ∪ {u}; w(u) := 0
|N (u) ∩ S| ∈ σ ∩ then Halt
Having described the recursive procedure and its subroutines, the entire algorithm
named Main-EnumSigmaRho (see below) can be formalized as one call of the recursive
procedure (and necessary preprocessing and final check of the items in the candidate list).
Algorithm Main-EnumSigmaRho(G)
Preprocessing : Choose an arbitrary vertex v1 and order the vertex set of G in a BFS
ordering starting in v1
Initialization : L := ∅; S := ∅; S := ∅; E(H) := ∅; for v ∈ V (G) do w(v) := 1
SigmaRho(S, S, w, H)
for S ∈ L do
if S is not a (σ, )-dominating set in G then L := L \ {S}
output(L)
The correctness of the algorithm follows from the following observations and claims,
and from the fact that it branches on each vertex whose membership to S or S is not
6
forced.
Lemma 2. (Loop invariant) At the time of each call of the SigmaRho procedure, the
following invariants are fulfilled:
1. if x is free then w(x) = 1 − d, where d = deg−
H (x) is the outdegree of x in H,
2. H is the disjoint union of out-oriented stars, and xy ∈ E(H) implies that y ∈ S,
3. w(x) = 0 for every x ∈ S ∪ S,
4. w(x) ≥ 0 for every free vertex x, and moreover w(x) > 0 after the execution of the
Forcing subroutine.
Proof. 1. The weight of free vertices. At the beginning the weight of every vertex is 1, and
also H is edgeless, so the outdegree of every vertex is 0 (in H). The invariant follows by
induction on the number of recursive calls. The weights of free vertices are changed in the
Recharge and Branch subroutines, and in each case the multiple of that is subtracted
from (or added to) the weight of the vertex is the same as the number of oriented edges
starting in the vertex that are added to (deleted from, respectively) H.
2. The shape of H. At the beginning, H is edgeless. It gets modified in the Recharge
and Branch subroutines. When recharging, edges vwi are replaced by ui wi , and when
branching, the edge uv is added. In each case the endpoint is a vertex allocated in S and
every vertex from S is the endvertex of at most one arc of H. (In the case of branching
this follows from the fact that w(v) = 1 before Branch is called on v, and hence has neither
outgoing nor incoming arcs.)
3. The weight of a vertex allocated to S or S becomes 0 at the time of allocation.
4. Weights of free vertices are nonnegative. This is guaranteed by the Forcing subroutines. We distinguish two cases depending on the finiteness of σ and .
4a. If both σ and are finite, a free vertex, say x, would have weight 0 or less only if it had
outdegree t > max(p, q) in H. But then x must have t neighbors in S. Certainly at the
beginning of the first call of SigmaRho, no such vertex exists. The number of S-neighbors
may get raised during the first part of the Forcing subroutine, but that is immediately
discovered by the second part of the subroutine and the execution is halted. The only
other possibility is during the second part of the Branch subroutine, when v is accepted
into S. In that case the weight of u, the free neighbor of v, was positive before Branch was
called and becomes 0 for just a short moment – the Forcing subroutine of the subsequent
call of SigmaRho discovers that u has too many neighbors in S and halts the execution
(unless this call is one of the final ones and we are in a leaf of the computation tree).
4b. If one of σ, is infinite, and hence σ ∩ = ∅, a free vertex, say x, would have weight 0
or less only if it had outdegree t > min(p, q) in H, and hence at least as many neighbors in
S. Again such a vertex is discovered in the Forcing subroutine and allocated in S or S (or
the execution halts). After that the number of S-neighbors of a free vertex may get raised
only in the second part of the Branch subroutine. In that case the weight of such free
vertex, called u in the subroutine, drops only by one , and since it was positive before,
it becomes 0, and only for a short while. The Forcing subroutine of the subsequent call
of SigmaRho discovers that u has too many neighbors in S and allocates u (or halts or
contributes to the list L of candidate sets when we are already in a leaf of the computation
tree).
7
Lemma 3. (Halting) If Forcing halted with current values S, S, then G contains no
(σ, )-dominating set M such that S ⊆ M ⊆ V \ S.
Proof. a) Both σ and are finite. If Forcing halts because some x has more than max(p, q)
neighbors in S, then such an S cannot be a subset of any (σ, )-dominating set M . Indeed,
if x ∈ M then |N (x) ∩ M | ≥ |N (x) ∩ S| > p = max σ and |N (x) ∩ M | cannot be in σ, as
well as |N (x) ∩ M | ≥ |N (x) ∩ S| > q = max and |N (x) ∩ M | cannot be in if x ∈ M . If
Forcing halts because some x ∈ S has a unique free neighbor, but neither |N (x) ∩ S| nor
|N (x) ∩ S| + 1 are in σ, then no M containing S is a (σ, )-dominating set since |N (x) ∩ M |
equals |N (x) ∩ S| or |N (x) ∩ S| + 1, depending on whether v ∈ M or not.
b) One of σ, is finite and σ ∩ = ∅. The first two reasons why Forcing may halt are
the same as above. If the subroutine halts because for some free vertex x, |N (x) ∩ S| is
neither in σ nor in , then no superset M of S can be a (σ, )-dominating set since x can
be neither in M nor outside it.
Lemma 4. (Necessity) If at some stage, with current values of S, S, Forcing wants to
place x in S, then for every (σ, )-dominating set in G such that S ⊆ M ⊆ V \ S, it holds
that x ∈ M .
Similarly, if at some stage, with current values of S, S, Forcing wants to place x in S,
then for every (σ, )-dominating set in G such that S ⊆ M ⊆ V \ S, it holds that x ∈ M .
Proof. Again the two cases are distinguished. In both it is assumed that M is a (σ, )dominating set such that S ⊆ M ⊆ V \ S.
a) Both σ and are finite. Suppose v is the unique neighbor of x ∈ S and |N (x)∩S| ∈ σ.
Then |N (x) ∩ S| + 1 ∈ σ because σ is successor-free. Thus v cannot be in M , since then
|N (x) ∩ M | = |N (x) ∩ S| + 1 ∈ σ. Similarly, |N (x) ∩ S| + 1 ∈ σ implies |N (x) ∩ S| ∈ σ
and v must be in M , since it is the only possible additional M -neighbor of x.
b) One of σ, is finite and σ ∩ = ∅. If z is the only neighbor of a vertex y ∈ S, the
argument is as above. If x is a free vertex such that |N (x) ∩ S| > p (and ≤ q since the
subroutine did not halt in the previous step), x cannot be in M because then |N (x)∩M | ≥
|N (x) ∩ S| > p = max σ and |N (x) ∩ M | could not be in σ, while if |N (x) ∩ S| > q,
then x cannot be outside M because then |N (x) ∩ M | ≥ |N (x) ∩ S| > q = max and
|N (x) ∩ M | could not be in . Finally, if u is a free vertex with no free neighbor, then
|N (u) ∩ M | = |N (u) ∩ S| and the membership of u in M is uniquely determined since
σ ∩ = ∅.
Lemma 5. (Correctness) The subroutines Recharge and Branch can always be executed.
Proof. The Forcing subroutine guarantees that no S-neighbor of v has v as its only free
neighbor. In the Recharge subroutine, vwi is an arc of H and hence wi ∈ S for every
i = 1, . . . , t. But then each wi has another free neighbor and Recharge does not get stuck.
For the Branch subroutine, we distinguish the two cases again. If both σ and are
finite, we note that vertices of G get allocated into S or S only when we attempt to branch
on them (in the preceding Forcing subroutine, or in Branch itself). Therefore when we
consider v to be the last free vertex in the BFS ordering of the vertex set of G, either
v = v1 is the root (and then we do not bother checking anything and just add both S and
S ∪ {v} to the candidate list L) or v has a predecessor u in the BFS tree of G. This u
8
comes earlier in the BFS ordering of G, hence was not attempted to branch on yet, and
hence is free at the time when v is processed.
Suppose one of σ, is finite and σ ∩ = ∅. If v has no free neighbor, then v (renamed
as u) gets allocated in the preceding run of the Forcing subroutine or that subroutine is
halted, but in neither case v remains free for branching.
Analysis of the running time. The weight of an instance (G, w, S, S, H) is w(G) =
v∈V w(v). In each branching on a vertex v the measure of the input decreases by 1 when
discarding v, and it decreases by 1 + when selecting v. In the standard terminology of
branching algorithms this implies that the branching vector is (1, 1 + ). The running time
of each execution of SigmaRho is polynomial, and so the total running time is O∗ (T ) where
T is the number of leaves of the search tree. The leaves of the search tree correspond to
the candidate sets.
Let T [k] be the maximum number of leaves of the search tree that any execution of our
algorithm may generate on a problem instance of weight k. Due to the branching vector
we obtain:
T [k] ≤ T [k − 1] + T [k − 1 − ].
Thus the number of (σ, )-dominating sets (which is bounded from above by T [n]) in an
isolate-free graph on n vertices is at most cn , and the running time of our algorithm that
enumerates all of them is O∗ (cn ), where c is the largest real root of the characteristic
polynomial
x1+ − x − 1 = 0.
The table shows the base of the exponential function bounding the running time of
our algorithm for some particular values of ϕ = 1 − 1 (= max(p, q) in the case of both σ
and finite, and is equal to min(p, q) if only one of them is finite and σ ∩ = ∅).
ϕ
c
0
1.6181
1
1.7549
2
1.8192
3
1.8567
4
1.8813
5
1.8987
6
1.9116
7
1.9216
8
1.9296
100
1.9932
As can be expected, c converges to 2 when ϕ converges to infinity (and converges to
0). This is easily seen from the characteristic equation, which tends to T [k] = 2T [k − 1].
4
Lower Bounds
The combinatorial consequence of our algorithm shows that (under certain assumptions on
σ and ) every isolate-free graph on n vertices contains at most 2n(1−δ) (σ, )-dominating
sets, for some δ > 0.
Taking σ = {0} and = N \ {0} we obtain the Independent Dominating Set problem
and the (σ, )-dominating sets are precisely the maximal independent sets. Hence our
theorem implies that the maximum number of maximal independent sets in a graph is
upper bounded by 1.6181n ; while Moon and Moser [11] tells us that the correct value is
1.4423n .
While the upper bound of Moon and Moser is tight, others like the one by Fomin et al.
for the maximum number of minimal dominating sets [4] might not be tight. Likewise, our
upper bounds established by a general approach are unlikely to be tight for all particular
values of (σ, ). Thus it is natural to look after lower bounds.
9
Let σ be the set of all even integers from the interval [0, r − 1], and be the set of all
odd integers from this interval, where r ≥ 2 is a positive integer. Consider G = sKr , the
disjoint union of s copies of the complete graph Kr . Clearly, this graph G has 2(r−1)s =
r−1
n
r
max{p,q}
n
min{p,q}+1
n
= 2 max{p,q}+1 = 2 min{p,q}+2 (σ, )-dominating sets.
Since both σ and are finite, and σ ∩ = ∅, we can use our algorithm in both variants.
The next table compares the bases of the exponential upper bounds given by our algorithm
1
1
and = 1+min(p,q)
, distinguished as cmax and cmin ,
(with both variants of = 1+max(p,q)
2
max{p,q}
respectively) with the base a(p,q) = 2 max{p,q}+1 of the exponential function giving the lower
bound arising from the example above.
r
cmax
cmin
a(p,q)
5
2
1.7549
1.6181
1.4142
3
1.8192
1.7549
1.5874
4
1.8567
1.8192
1.6817
5
1.8813
1.8567
1.7411
6
1.8987
1.8813
1.7817
7
1.9116
1.8987
1.8114
8
1.9216
1.9116
1.8340
9
1.9296
1.9216
1.8517
101
1.9932
1.9932
1.9863
A Sort & Search Approach
Sort & Search is a classical method to design exact algorithms. We refer to Woeginger’s survey [14] and a paper from 1981 by Schroeppel and Shamir showing how to use
the paradigm to establish moderately exponential-time algorithms solving NP-hard problems [12].
Since the paradigm has not been used much in recent work let us first describe the
idea. The original problem of size n, say an input graph G on n vertices, is divided into
two subproblems, say two disjoint vertex subsets V1 and V2 of size n/2. For each subset
S ⊆ Vi (i ∈ {1, 2}) a binary vector of length n is assigned and stored in a table Ti . The
definition of the (binary) vectors is of course problem dependent. Now T1 and T2 contain
each at most 2n/2 different vectors. Then each solution of the problem corresponds to a
vector a of the first subproblem and a vector b of the second one such that the sum of
the two vectors is a fixed goal vector c , i.e. a + b = c. All such pairs (a, b) of satisfying
vectors can be found by searching for each first vector a ∈ T1 the vector c −a in T2 . When
the second table is sorted in lexicographic order in a preprocessing, then this searching
can be done in O(n) times the length of the vectors, and thus the overall running time
of the algorithm is O∗ (2n/2 ). For more details on searching in a lexicographically ordered
table, we refer to Volume 3 of “The Art of Computer Programming” by D.E. Knuth [10,
p. 409 ff.].
We study the use of Sort & Search for constructing algorithms for ∃(σ, )-DS defined
in Section 1. The task is to decide whether the given graph has a (σ, )-dominating set.
Those problems are polynomial-time solvable or NP-complete depending on (σ, ). For
more details, we refer to [13].
The NP-complete ∃({0}, {1})-DS problem is called Perfect Code and it can be
solved in time O(1.1730n ) [3] (see also [2]). The algorithm is based on solving the exact
satisfiability problem (called XSAT) and the approach has been generalized to the so-called
Xi SAT problem. Those algorithms use Sort & Search and their running time is O∗ (2n/2 ).
Our use of Sort & Search was inspired by the aforementioned algorithms.
Theorem 6. The ∃({p}, {q})-DS problem can be solved in time O∗ (2n/2 ).
10
Proof. Let p, q ∈ N0 . Let G = (V, E) be the input graph and let k = n/2. As explained previously, the algorithm partitions the set of vertices into V1 = {v1 , v2 , . . . vk }
and V2 = {vk+1 , . . . , vn }. Then for each subset S1 ⊆ V1 , it computes the vector s1 =
{x1 , . . . , xk , xk+1 , . . . , xn } where
⎧
⎨ p − |N (vi ) ∩ S1 | if 1 ≤ i ≤ k and vi ∈ S1
q − |N (vi ) ∩ S1 | if 1 ≤ i ≤ k and vi ∈
/ S1
xi =
⎩
|N (vi ) ∩ S1 |
if k + 1 ≤ i ≤ n
and for each subset S2 ⊆ V2 , it computes
xk+1 , . . . , xn } where
⎧
if
⎨ |N (vi ) ∩ S2 |
p − |N (vi ) ∩ S2 | if
xi =
⎩
q − |N (vi ) ∩ S2 | if
the corresponding vector s2 = {x1 , . . . , xk ,
1≤i≤k
k + 1 ≤ i ≤ n and vi ∈ S2
k + 1 ≤ i ≤ n and vi ∈
/ S2 .
After the computation of these 2k+1 vectors, the algorithm sorts those corresponding to
V2 in lexicographical order. Then, for each vector s1 (corresponding to an S1 ⊆ V1 ) using
binary search it tests whether there exists a vector s2 (corresponding to an S2 ⊆ V2 ), such
that s2 = s1 . Note that the choice of the vectors garantees that s2 = s1 implies that S1 ∪S2
is a ({p}, {q})-dominating set. Such fixed vector s1 can be found in time n log 2n/2 in the
lexicographic order of the vectors of V2 . Thus the overall running time is O∗ (2n/2 ).
Corollary 7. Max-({p}, {q})-DS, Min-({p}, {q})-DS and #-({q}, {q})-DS can also be
solved in time O∗ (2n/2 ).
Proof. The algorithm of the previous theorem only needs to be modified as follows: Instead of sorting all vectors corresponding to V2 in lexicographic order, multiple copies are
removed and each vector is stored with an entry indicating its the number of occurrences.
Furthermore for minimization (resp. maximization), with each vector we store an Si ⊆ Vi
of minimum (resp. maximum) cardinality that generates this vector.
Finally, let us mention that the approach can be extended to certain infinite σ and .
Let m ≥ 2 be a fixed integer and k ∈ {0, 1, . . . , m − 1}. We denote by k + mN the set
{m · + k : ∈ N0 }.
Theorem 8. Let m ≥ 2 and p, q ∈ N0 . The problems ∃(p + mN, q + mN)-DS, MIN(p + mN, q + mN)-DS, MAX-(p + mN, q + mN)-DS and #-(p + mN, q + mN)-DS can be
solved in time O∗ (2n/2 ).
Proof. The corresponding algorithms in Theorem 6 and Corollary 7 are to be modified such
that all components of vectors are taken modulo m and the addition and/or subtraction
of vector components is taken modulo m.
6
Open Problems
It would be interesting to investigate the complexity of enumerating all (σ, )-dominating
sets for other sets σ and , as well as the relationship to combinatorial upper bounds on
their numbers. The following problem naturally suggests itself:
11
Problem 1 Can Enum-(σ, )-DS be solved in time O∗ (Dsσ, (n)), where Dsσ, (n) is the
maximum number of (σ, )-dominating sets in an n-vertex graph?
Perhaps a really daring question is the next one.
Problem 2 Characterize all pairs σ, for which every isolate-free n-vertex graph has at
most o(2n ) (or stricter, 2(1−δ)n for some δ > 0) (σ, )-dominating sets.
References
[1] A. Brandstädt, V. B. Le and J. P. Spinrad. Graph classes : A survey. Philadelphia,
SIAM Monographs on Discrete Mathematics and Applications, 1999.
[2] V. Dahlöf. Exact algorithms for exact satisfiability problems. PhD. thesis, Linköping,
Sweden, 2006.
[3] V. Dahlöf, P. Jonsson and R. Beigel. Algorithms for four variants of the exact satisfiability problem. Theoretical Computer Science 320 (2004), 373–394.
[4] F. V. Fomin, F. Grandoni, A. V. Pyatkin and A. A. Stepanov. Bounding the Number
of Minimal Dominating Sets: a Measure and Conquer Approach. Technical Report 309,
University of Bergen, September 2005.
[5] M. C. Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, New
York, 1980.
[6] S. Gupta, V. Raman and S. Saurabh. Fast exponential algorithms for Maximum rregular induced subgraph problems. Proceedings of FSTTCS 2006, Springer-Verlag, 2006,
Berlin, LNCS 4337, pp. 139–151.
[7] M. M. Halldorsson, J. Kratochvil and J. A. Telle. Independent sets with domination
constraints. Discrete Applied Mathematics 99 (2000), 39–54.
[8] T. W. Haynes, S. T. Hedetniemi, P. J. Slater. Fundamentals of Domination in Graphs
Marcel Dekker, New York, 1998
[9] P. Heggernes and J. A. Telle. Partitioning graphs into generalized dominating sets.
Nordic Journal of Computing 5 (1998), 128–142.
[10] D. E. Knuth. The Art of Computer Programming, Volume 3: Sorting and Searching.
Addison-Wesley, 1997 (second edition).
[11] J. W. Moon and L. Moser. On cliques in graphs Israel Journal of Mathematics 5 (1965),
23–28.
[12] R. Schroeppel and A. Shamir. A T = O(2n/2 ), S = O(2n/d ) algorithm for certain
NP-complete problems. SIAM Journal on Computing 3 (1981), 456–464.
[13] J. A. Telle. Complexity of domination-type problems in graphs. Nordic Journal of Computing 1 (1994), 157–171.
[14] G. J. Woeginger. Exact algorithms for NP-hard problems: A survey. Combinatorial Optimization - Eureka, You Shrink!, Springer-Verlag, 2003, Berlin, LNCS 2570, pp. 185–207.
12
Download