Chapter 5 Reduction Algorithms
In this chapter we give an introduction to reduction algorithms for decision and optimization problems on graphs. A reduction algorithm is based on a finite set of reduction rules and a finite set of graphs. Each reduction rule describes a way to modify a graph locally. The idea of a reduction algorithm is to solve a decision problem by repeatedly applying reduction rules on the input graph until no more rule can be applied. If the resulting graph is in the finite set of graphs, then the algorithm returns true, otherwise it returns false. The idea of reduction algorithms originates from Duffin’s [1965] characterization of series-parallel graphs (Definition 2.3.3): a multigraph is series-parallel if and only if it can be reduced to a single edge by applying a sequence of series and parallel reductions. A series reduction is the replacement of a vertex of degree two and its incident edges by an edge be- tween its two neighbors, and a parallel reduction is the removal of one of two or more edges between the same vertices, i.e. the removal of an edge which has parallel edges (see also Figure 2.11). Valdes, Tarjan, and Lawler [1982] showed how a reduction algorithm based on this set of reduction rules can be implemented in linear time, and hence series-parallel graphs can be recognized in linear time. Inspired by the characterization of Duffin and the similarity between graphs of treewidth two and series-parallel graphs, Arnborg and Proskurowski [1986] generalized this idea for recognizing simple graphs of treewidth at most three: they gave a set of reduction rules which characterizes graphs of treewidth at most three. They also showed that these reduction rules
3 can be used to recognize partial three-trees in On time. Matou˘sek and Thomas [1991] gave a slightly different set of reduction rules, and showed that with this new set it is possible to recognize simple graphs of treewidth at most three in linear time. Additionally, they showed how to construct a tree decomposition of minimum width in linear time if the input graph has treewidth at most three. A much more general approach is taken by Arnborg, Courcelle, Proskurowski, and Seese [1993]. They gave a set of conditions that must hold for a set of reduction rules to ensure that the reduction algorithm works correctly. They have also shown that for a large class of decision problems on simple graphs of bounded treewidth, there is a set of reduction rules
for which these conditions hold, and that the algorithm based on such a set of reduction rules takes On time (but more than linear space). The results of Arnborg et al. are stated in a general, algebraic setting. Bodlaender [1994] extended the notion of reduction algorithms to optimization problems:
95 Chapter 5 Reduction Algorithms he introduced a new notion of reduction rules for optimization problems, called reduction- counter rules, and gave a set of conditions which are necessary for a set of reduction-counter rules in order to make a reduction algorithm work correctly. For simple graphs of bounded treewidth, this results again in efficient linear time algorithms. Bodlaender and Hagerup [1995] have shown that the sequential reduction algorithms of Arnborg et al. [1993] and Bodlaender [1994] can efficiently be parallelized, if some
additional conditions hold for the set of reduction rules. Their reduction algorithm uses
Olognlog n time with O n operations and space on an EREW PRAM, and O logn time
with On operations and space on a CRCW PRAM. A sequential version of this algorithm gives a reduction algorithm which uses On time and space. In this chapter, we give an overview of the results of Arnborg et al. [1993], Bodlaender [1994] and Bodlaender and Hagerup [1995] that are mentioned above. We combine the re- sults and present them in a uniform setting, in order to get a comprehensible overview. The chapter also acts as an introduction for Chapters 6 and 7: in Chapter 6, we show how the reduction algorithms presented in this chapter can be extended to constructive algorithms, i.e. algorithms which solve constructive decision or optimization problems. In Chapter 7, we apply these results to a number of optimization problems. This chapter is organized as follows. In Section 5.1 we discuss reduction algorithms for decision problems as introduced by Arnborg et al. [1993]. We do this in a more direct way, without making use of the algebraic theory. We also give a reduction algorithm which uses linear time and space, based on the ideas of Arnborg et al. [1993] and of Bodlaender and Hagerup [1995]. In Section 5.2, we describe reduction algorithms for optimization problems, as introduced by Bodlaender [1994]. In Section 5.3, we discuss the parallel reduction algo- rithms of Bodlaender and Hagerup [1995], and in Section 5.4, we mention some additional results.
5.1 Reduction Algorithms for Decision Problems In this section, we start with definitions of reduction rules and reduction systems (Sec- tion 5.1.1). Then we give an efficient reduction algorithm based on a special type of reduction system (Section 5.1.2). Finally, we show that this reduction algorithm can be used to solve a large class of decision problems on graphs of bounded treewidth (Section 5.1.3).
5.1.1 Reduction Systems The graphs we consider are simple unless stated otherwise. Recall that a graph property is a function P which maps each graph to the value true or false. We say a property is effectively decidable if an algorithm is known that decides the property.
For the definitions of terminal graphs, and the operation , see Definitions 2.2.3 and 2.2.4.
; ; h ; ; i ; ; h ; ; i
Two terminal graphs V1 E1 x1 xk and V2 E2 y1 yl are said to be isomorphic
; ;
if k = l and there is an isomorphism from V1 E1 to V2 E2 which maps xi to yi for each i, 1 i k.
96
5.1 Reduction Algorithms for Decision Problems
; Definition 5.1.1 (Reduction Rule). A reduction rule r is an ordered pair H1 H2 ,whereH1
and H2 are l-terminal graphs for some l 0.
;
A match to reduction rule r =H1 H2 in graph G is a terminal graph G1 which is iso- morphic to H1, such that there is a terminal graph G2 with G = G1 G2. If G contains a match to r,thenanapplication of r to G is an operation that replaces G
by a graph G0 , such that there are terminal graphs G1, G2 and G3, with G1 isomorphic to H1,
0
= G2 isomorphic to H2,andG = G1 G3, G G2 G3. We also say that, in G, G1 is replaced by G2. An application of a reduction rule is also called a reduction.
Figure 5.1 shows an example of a reduction rule r, and an application of r to a graph G.We
;
usually depict a reduction rule H1 H2 by the two graphs H1 and H2 with an arrow from H1
; to H2. Given a reduction rule r =H1 H2 , we call H1 the left-hand side of r,andH2 the right-hand side of r.
H H 1 2 G0 1 1
G r r !
2 ! 2
3 3
;
Figure 5.1. An example of a reduction rule r =H1 H2 , and an application of r to a 0 graph G, resulting in graph G0 . The dotted lines in G and G denote the parts of G and
G0 that are involved in the reduction.
; Let G be a graph and r =H1 H2 a reduction rule. If G contains a match G1 to r,then an application of r to G which replaces G1 by a terminal graph isomorphic to H2 is called a reduction corresponding to the match G1. Note that different applications of a reduction rule to a graph may result in different (i.e. non-isomorphic) graphs. If there is an application of rule r to graph G which results in a
r
0 0 graph G , then we write G ! G .LetR be a set of reduction rules. For two graphs G and
r
0 0
0 R
2 ! G , we write G ! G if there exists an r R with G G .WesayG contains a match G1 if there is an r 2 R such that G1 is a match to r in G.IfG contains no match, then we say that G is irreducible (for R ). The following conditions are useful for a set of reduction rules in order to get a charac- terization of a graph property P.
Definition 5.1.2. Let P be a graph property and R a set of reduction rules.
0
R 0
! , R is safe for P if, whenever G G ,thenP G P G .
R is complete for P if the set I of irreducible graphs for which P holds is finite.
R R R
! ! ! R is terminating if there is no infinite sequence G1 G2 G3 .
97
Chapter 5 Reduction Algorithms
0
R 0 ! R is decreasing if, whenever G G ,thenG contains fewer vertices than G.
Definition 5.1.3 (Reduction System). A reduction system for a graph property P is a pair
; R I , with R a finite set of reduction rules which is safe, complete and terminating for P,
and I the set of irreducible graphs for which P holds.
; A decreasing reduction system for P is a reduction system R I for P in which R is
decreasing.
; A reduction system R I for a property P gives a complete characterization of P: P G holds for a graph G if and only if any sequence of reductions from R on G leads to a graph G0 which belongs to I (i.e. is isomorphic to a graph in I ). As an example, consider the graph property of being a partial k-path for a fixed non-
negative integer k. Arnborg and Proskurowski [1986] have given reduction systems Sk =
; R k Ik for the properties that a graph is a partial k-path, for 0 k 3 (see also Arnborg
[1985]). For each k, Ik contains only the empty graph, denoted by Gempty. Furthermore,
f g = f ; g
the set of rules R k is a subset of the rules depicted in Figure 5.2: R 0 = 1 , R 1 1 2 ,
f ; ; g = f ;::: ; g R 2 = 1 2 3 and R 3 1 6 .
1
! Gempty
4 6 !
2 ! !
3 5
! !
Figure 5.2. A set of reduction rules which is safe, complete and terminating for treewidth at most three.
5.1.2 An Efficient Reduction Algorithm
; A decreasing reduction system R I for a property P corresponds to a polynomial time algorithm that decides whether property P holds for a given graph G: repeat applying rules from R starting with the input graph, until no rule from R can be applied anymore. If the resulting graph belongs to the set I ,thenP holds for the input graph, otherwise, it does not. The number of reductions that has to be performed is at most n, since each reduction reduces
c the number of vertices by at least one. Furthermore, it takes On time to check whether G contains a match, where c is the maximum number of vertices in any left-hand side of a reduction rule. In general, an algorithm as described above is not very efficient. However, there are several ways to make the algorithm more efficient. One way is to use a reduction system in which the reduction rules have a special structure, and to use this structure to efficiently determine whether a reduction rule can be applied. For example, Arnborg et al. [1993] define
98 5.1 Reduction Algorithms for Decision Problems
such a special reduction system, and show that, with such a reduction system, a property can be decided in On time on an input graph with n vertices. However, their algorithm
Θ p needs n space, where p is the maximum number of terminals in any left-hand side of a ε
1 +
ε > reduction rule (although this result can be improved to On space for any 0, with an increase in running time of only a constant factor [Hagerup, 1988]).
Another way to make a reduction algorithm more efficient is to design the reduction
; system R I such that for any graph G for which the property holds, either G belongs to I ,orG contains a match which can be found in an efficient way. As an example of this, we consider the method used by Bodlaender and Hagerup [1995], called the bounded adjacency list search method. (Bodlaender and Hagerup use their method to obtain an efficient parallel algorithm; we give an efficient sequential version of this parallel algorithm in this section.)
Definition 5.1.4. Let d be a positive integer. Let G be a graph given by some adjacency list representation and let G1 be an l-terminal graph. We say G1 is d-discoverable in G if
1. G1 is open and connected, and the maximum degree of any vertex in G1 is at most d,
2. there is an l-terminal graph G2, such that G = G1 G2,and
3. G1 contains an inner vertex v such that for all vertices w 2 V G1 there is a walk W in G1
; ;::: ; = =
with W =u1 u2 us , such that v u1, w us, and for each i,2 i s 1, in the
f ; g f ; g + adjacency list of ui in G, the edges ui 1 ui and ui ui 1 have distance at most d.
Let G be a graph, d a positive integer, and let G1 be a d-discoverable terminal graph in G.Let
; ;::: ;
v be an inner vertex of G1 satisfying condition 3 above, and let W =u1 u2 us be a walk
= f ; g f ; g +
in G1 with v u1, such that for each i,2 i s 1, the edges ui 1 ui and ui ui 1 have 0
distance at most d in the adjacency list of ui+1 in G. We show that there is a walk W from u1
f ; g
to us in G1 satisfying the same condition in which each edge e = x y occurs at most twice
0 0
f ; g
in W . If an edge e = x y occurs three times in W , then it is passed in the same direction at
; ;::: ; ;
least twice, i.e. W contains either a subsequence of the form S = x y x y or a subsequence
; ;::: ; ; ;::: ; of the form S = y x y x. In the first case, we remove the subsequence y x of S,and
in the latter case, we remove the subsequence x;::: ;y of S. The result is still a walk in G1 satisfying the stated condition. This transformation can be repeated until W does not contain any edge more than twice. In the same way we can show that if condition 3 holds, then there is a walk from any inner vertex w to any other inner vertex w0 in G1 in which two subsequent edges have distance at most d in the adjacency list of their common vertex, and each edge occurs at most twice. This, and the fact that each edge in an open terminal graph G1 is incident with an inner vertex (which has degree at most d) implies the following result.
Lemma 5.1.1. If a terminal graph G1 is d-discoverable in a graph G for some d 1,then for any inner vertex v of G1, all vertices and edges of G1 can be found from v in an amount of
time that only depends on the integer d and the size of G1, but not on the size of the graph G.
; Definition 5.1.5 (Special Reduction System). Let P be a graph property, and R I a decreas- ing reduction system for P.Letnmax be the maximum number of vertices in any left-hand
99
Chapter 5 Reduction Algorithms
;
side of a rule r 2 R . R I is a special reduction system for P if we know positive integers
nmin and d, nmin nmax d, such that the following conditions hold.
; 2 1. For each reduction rule H1 H2 R ,
(a) if H1 has at least one terminal, then H1 is connected and H1 and H2 are open, and
j <
(b) if H1 is a zero-terminal graph, then jV H2 nmin . 2. For each graph G and each adjacency list representation of G,ifPG holds, then
(a) each component of G with at least nmin vertices has a d-discoverable match, and
(b) if all components of G have less than nmin vertices, then either G 2 I or G contains a
match which is a zero-terminal graph.
j
Conditions 1a and 2a assure that each component H, with jV H nmin, of a graph G for which PG holds, contains at least one d-discoverable match to a reduction rule, which can be applied without having to remove multiple edges. Conditions 1b and 2b are only needed for graph properties which do not imply that the input graph is connected; they assure that, if no other reduction rules are applicable, then matches to reduction rules with zero terminals of which the left-hand side is not connected, can be found efficiently.
As a simple example of a special reduction system, consider the graph property P,where PG holds if and only if each component of G is a two-colorable cycle, and the number of components of G is odd. Let R be the set of reduction rules depicted in Figure 5.3 (Gempty
denotes the empty graph), and let I be the set containing just the cycle on four vertices
;
(see also Figure 5.3). It can easily be seen that R I is a special reduction system for P
= = (d = nmax 8andnmin 5).
r1 !
R I r2
! Gempty
Figure 5.3. A reduction system for property P, which is the property that a graph is two-colorable, has an odd number of components, and each of its components is a cycle.
Theorem 5.1.1. Let P be a graph property. If we have a special reduction system for P, then
we have an algorithm which decides P in On time and O n space. We prove Theorem 5.1.1 by giving the algorithm. The algorithm consists of two phases. In the first phase, the algorithm finds d-discoverable matches and executes the corresponding reductions, until there are no more d-discoverable matches. If the resulting graph is in I ,then
100 5.1 Reduction Algorithms for Decision Problems
P holds for the input graph, and true is returned. Otherwise, the algorithm proceeds with the second phase. In the second phase, the algorithm checks whether G contains a component with at least nmin vertices. If so, false is returned, since P does not hold (by condition 2a of Defini- tion 5.1.5). Otherwise, the algorithm repeats applying reduction rules of which the left-hand side has no terminals, until this is no longer possible. If the resulting graph G is in I ,then P holds and true is returned. Otherwise, there is no further applicable rule: each component of G has less than nmin vertices, since it either was already a component of the graph after phase 1, or it is the result of a reduction in phase 2, which means that it is a component of
a right-hand side of a reduction rule. Since the set of reduction rules is complete for P,this
means that PG does not hold, and hence false is returned.
; We now give the complete algorithm, given the special reduction system R I and the integers nmin and d. The algorithm is a simplified sequential simulation of the parallel algo- rithm given by Bodlaender and Hagerup [1995]. It resembles the algorithm of Arnborg et al.
p
Ω [1993], but uses On space, whereas the algorithm of Arnborg et al. uses n space, where p equals the maximum number of terminal vertices in any reduction rule. Algorithm Reduce(G)
Input: Graph G
Output: PG
fj jj 2 g
1. nmax max V H H is left-hand side of some r R
2. ( Phase 1 )
2 j g
3. S fv V G deg v d
= = 4. while S 6 o
5. do take v 2 S
6. if v is inner vertex of a d-discoverable match G1 to a rule r 2 R 7. then apply r to G: 8. let G2 be a new terminal graph isomorphic to H2, such that G1 and G2
have the same set of terminals
9. ( Remove inner vertices and edges of G1 )
f 2 j g
10. V G V G v V G1 v is inner vertex of G1
11. E G E G E G1