INFORMS Journal on Computing informs Vol. 17, No. 4, Fall 2005, pp. 402–412 ® issn 1091-9856 eissn 1526-5528 05 1704 0402 doi 10.1287/ijoc.1040.0075 © 2005 INFORMS

Planar Branch Decompositions I: The Ratcatcher

Illya V. Hicks Department of Industrial Engineering, Texas A&M University, College Station, Texas 77843-3131, USA, [email protected]

he notion of branch decompositions and its related connectivity invariant for graphs, branchwidth, were Tintroduced by Robertson and Seymour in their series of papers that proved Wagner’s conjecture. Branch decompositions can be used to solve NP-hard problems modeled on graphs, but finding optimal branch decom- positions of graphs is also NP-hard. This is the first of two papers dealing with the relationship of branchwidth and planar graphs. A practical implementation of an algorithm of Seymour and Thomas for only computing the branchwidth (not optimal branch decomposition) of any planar hypergraph is proposed. This implementation is used in a practical implementation of an algorithm of Seymour and Thomas for computing the optimal branch decompositions for planar hypergraphs that is presented in the second paper. Since memory requirements can become an issue with this algorithm, two other variations of the algorithm to handle larger hypergraphs are also presented. Key words: planar graph; branchwidth; branch decomposition; carvingwidth History: Accepted by Jan Karel Lenstra, former Area Editor for Design and Analysis of Algorithms; received December 2002; revised August 2003, January 2004; accepted February 2004.

1. Introduction Seymour conceived of two new ways to decompose a A planar graph is a graph that canbe drawnona graph that were beneficial toward the proof. Decom- sphere or plane without having edges that cross. posing a graph by a branch decomposition is one of A subdivisionof a graph G is a graph obtained from these ideas. G by replacing its edges by internally vertex disjoint Branch decompositions open algorithmic possibil- paths. Inthe 1930s, Kuratowski (1930) proved that a ities for intractable problems that can be modeled graph G is planar if and only if G does not contain a ongraphs. Arnborg et al. (1991) showed that sev- eral NP-complete problems canbe solved inpoly- subdivisionof K5 or K3 3. Wagner (1937) later proved that a graph G is planar if and only if G does not con- nomial time using dynamic-programming techniques on input graphs with bounded treewidth, another tain K5 or K3 3 as a minor of G. A graph H is a minor of a graph G if H canbe obtainedfrom a subgraph related connectivity invariant for graphs introduced by RobertsonandSeymour (1983). Actually, the work of G by contracting edges. Let  be a class of graphs. of Arnborg et al. was spurred from the work of Cour-  is minor closed when all the minors of any member celle (1990). Inaddition,similar results have been of  also belong to  . Givena minorclosed class of obtained by Borie et al. (1992). The Arnborg et al. graphs  , the obstruction set of  is the set of minor result is also equivalent to graphs with bounded minimal graphs that are not elements of  . Clearly, branchwidth since the branchwidth and treewidth of a anyclass of graphs embeddable ona givensurface graph bound each other by constants (Robertson and is a minor closed class. The question of characteriz- Seymour 1991). Inaddition,there is a plethora of the- ing the obstruction set for other surfaces remained ory about branchwidth and branch decompositions. openuntil1979–1980 whenArchdeacon(1980) and For example, branchwidth and branch decomposi- Glover et al. (1979) solved the case for the projec- tionshave beenshownuseful inproducingmatroid tive plane where they proved that there are 35 minor analogs of the graph minors theorem and shorter minimal “nonprojective-planar” graphs. In the 1930s, proofs of the graph minors theorem related to graphs Erdös posed the questionof whether the obstruc- with bounded branchwidth/treewidth (Geelen et al. tionset for a givensurface is finite.Archdeaconand 2002). Also, Seymour and Thomas (1994) proposed Huneke (1989) proved that the obstruction set for a polynomial-time algorithm to compute the branch- any nonorientable surface is finite, and Robertson and width for planar graphs, which will be referred to as Seymour (1985) proved the case for any surface as a the ratcatcher method. corollary of the graph minors theorem, which proved Despite the number of theoretical results about Wagner’s conjecture, every minor closed class has branch decompositions and branch decomposition- a finiteobstructionset. Inaddition,Robertsonand based algorithms for solving NP-hard problems, there

402 Hicks: Planar Branch Decompositions I: The Ratcatcher INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS 403 has beenlittle effort to develop practical algorithms. for the details of the algorithms with a proof of cor- Examples of practical branch decomposition-based rectness for the additional algorithms. Finally, §§5 algorithms are the work of Cook and Seymour (2003) and 6 contain computational results and conclusions, onthe travelingsalesmanproblem (TSP) andthe work respectively. The reader is referred to West (2001) for of Hicks (2004a) on the minor containment problem. background material on . One is also referred to the work of Christian (2003) for other examples of branch decomposition-based algo- 2. Preliminaries rithms. Similar results for decomposition-based algorithms have beengivenby Koster et al. (2002) 2.1. Branch Decompositions for their work onpartial constrainsatisfactionprob- Throughout this paper, a graph is only considered to lems, and Alber and Neidermeier (2002) for their be undirected and may have loops and multiple edges work ondominationproblems. These examples exem- unless stated otherwise. Also, we may assume that all plify the possible usefulness of branch decomposition graphs are biconnected. For instance, for a graph G, and tree decomposition-based algorithms for other onecanderive anoptimal branchdecompositionfor NP-hard problems. G from the optimal branch decompositions of G’s Seymour and Thomas (1994) proved that testing connected components. In addition, for a connected graph G , onecanderive anoptimal branchdecompo- whether a general graph has branchwidth at most k, o sitionfor G from the optimal branch decompositions some input integer, is NP-complete. However, the o of the biconnected components of G . aforementioned ratcatcher method is a polynomial- o A hypergraph H consists of a finite set VH of time algorithm used to compute the branchwidth nodes, a finite set EH of edges, and an incidence of planargraphs. Givenaninteger k, the ratcatcher relationbetweenthem that is notrestricted to two method tests whether the branchwidth of the graph is ends for each edge. Thus, hypergraphs are general- at least k by finding a structure in the graph that pro- izations of graphs where edges can have any num- hibits finding a branch decomposition of the graph ber of ends. Since this paper is about planar graphs with width at most k−1. Seymour and Thomas (1994) and planar hypergraphs, let us define planarity for also proposed a polynomial-time algorithm using the hypergraphs. Let H be a hypergraph; then IH , the ratcatcher method to compute optimal branch decom- incidence graph of H, is the simple bipartite graph positions for planar graphs, which will be referred with vertex set VH ∪ EH such that v ∈ VH is to as the edge-contraction method. Thus, the current adjacent to e ∈ EH if and only if v is anendof e knowledge base to compute optimal branch decom- in H. Seymour and Thomas (1994) define a hyper- positions for planar graphs is a two-stage process. The graph H as being planar if and only if IH is planar. two-stage process involves first finding the branch- In addition, we will denote G∗ as a planar dual of an width of the input planar graph using the ratcatcher embedding of the graph G inthe sphere or plane.Fur- method, then using the edge-contraction method in thermore, for a planar graph G drawninthe sphere, conjunction with the ratcatcher method to examine RG will denote the set of regions of G. planar hypergraphs needed to construct the optimal Let us now define branch decompositions and branch decomposition for the input planar graph. branchwidth of a graph. Let G be a graph with node A more detailed discussionof the implementationof set VG and edge set EG . Let T be a tree having the edge-contractionmethodwith the additionof a EG leaves in which every nonleaf node has heuristic, the method, for runtime speedup is three. Let  be a bijectionbetweenthe edges of G presented in the related paper (Hicks 2005). and the leaves of T . The pair T  is called a branch This paper is spurred from the Seymour and decomposition of G. Notice that removing an edge e Thomas (1994) paper; a practical implementation of of T partitions the edges of G into two subsets Ae the ratcatcher method is presented. Unfortunately, the and Be. The middle set of e, denoted by mide , is the set algorithm requires a significant amount of memory to VAe ∩ VBe . The width of a branch decomposition achieve the proposed complexity of Oe2 where e is T  is the maximum cardinality of the middle sets the number of edges in the input graph. This mem- over all edges in T . The branchwidth of G, denoted by ory requirement limits the size of the input graphs for G , is the minimum width over all branch decom- this algorithm (up to 5,000 edges). Thus, two addi- positions of G. A branch decomposition of G is opti- tional methods, the comprat method and the memrat mal if its width is equal to the branchwidth of G.If method, with complexity Oe3 , are presented to han- there exists a nonleaf node in T with degree greater dle medium (up to 20,000 edges) and large (up to thanthree, thenthe pair T  is called a partial branch 70,000 edges) graphs respectively. decomposition. Figure 1 offers anexample planargraph Foundational definitions are given in §§2.1, 2.2, with anoptimal branchdecompositionwhere some and 2.3. Section 2.4 describes the two-player game of the middle sets are given. Graphs of small branch- related to the algorithm. Sections 3 and 4 are reserved width are characterized by the following theorem. Hicks: Planar Branch Decompositions I: The Ratcatcher 404 INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS

Separation of order 0 2 3 7 8 0 a b  G Separations of order 1 {a, e, f} {f, g, h} 2 3 4 e f Gv G ∀ v ∈ VG 6 10 Separations of order 2 Gv ∪ Gw G ∀ vw ∈ VG {a, d, f, g} 1 6 7 5 GeG\e ∀ e ∈ EG Separations of order 3 Gv ∪ Gw ∪ Gu G ∀ vwu ∈ VG 5 11 8 g h Gv ∪ Ge G\e ∀ e ∈ EG and v ∈ VG {a, b, f} {a, c, g} such that v is not incident to e 9 10 Gef G\e f  ∀ pairs ef ∈ EG c d such that e and f share a node 0 4 1 9 11 G0 1 2 G\a G0 4 5 G\b Figure 1 Example Planar Graph and Optimal Branch Decomposition G1 9 11 G\c G2 3 6 G\e Theorem 1 (Robertson and Seymour 1991). Let G G3 4 7 G\f  be a graph. G5 10 11 G\d • G = 0 if and only if every of G has G6 8 9 G\g ≤1 edge. G7 8 10 G\h • G ≤ 1 if and only if every component of G has ≤1 node of degree ≥2. Figure 2 Tangle of Order Four for the Graph of Figure 1 • G ≤ 2 if and only if G has no K minor. 4 “k-connected” component of G will either be onone Therefore, 1-factors (perfect matchings) have side or the other for any separation of  . Robertson branchwidth equal to zero; stars (trees with only one and Seymour (1991) proved a strong min-max relation nonleaf node) are the only connected graphs with between tangles and branchwidth: branchwidth equal to one; all forests that are not in Theorem 2 (Robertson and Seymour 1991). For the union of one factors and stars have branchwidth any simple graph G such that EG = , maxG 2 = equal to two. Also, series-parallel and outerplanar G . graphs have branchwidth at most two because these In terms of finding branch decompositions for gen- graphs do not have K4 as a minor. The branchwidth of other familiar graphs canbe foundinHicks (2000). eral graphs, there is analgorithm inRobertsonand To achieve a better understanding of the ratcatcher Seymour (1995) to approximate the branchwidth of method, it would behoove us to discuss the min-max a graph withina factor of three. For example, the relationship associated with branchwidth. Let G be a algorithm decides whether a graph has branchwidth graph and let k ≥ 1 be aninteger. A separation of a of at least five or finds a branch decomposition with graph G is a pair G1G2 of subgraphs of G with a width at most fifteen. This algorithm has not been G1 ∪ G2 = V G1 ∪ VG2  EG1 ∪ EG2 = G and used ina practical implementationandits improve- EG1 ∩ EG2 = and the order of this separationis ments by Bodlaender (1996), Bodlaender and Kloks defined as VG1 ∩ VG2 .Atangle in G of order k (1996), and Reed (1997) have not been shown to be is a set  of separations of G, each of order

(T2) if A1B1 , A2B2 , A3B3 ∈  , then A1 ∪A2 ∪ shownto be practical onlyfor a particular type of A3 = G;and 3-tree. Bodlaender and Thilikos (1997) also devel- (T3) if AB ∈  then VA = VG . oped a tree decomposition-based linear-time algo- These are called the first, second,andthird tangle rithm for finding an optimal branch decomposition, axioms. The tangle number of G, denoted by G ,is but it appears to be impractical. the maximum order of any tangle in G. Figure 2 gives Under practical algorithms, Kloks et al. (1999) gave anexample of a tangleof order 4 for the graph of a polynomial-time algorithm to compute the branch- Figure 1 where GS denotes the induced subgraph width of interval graphs, but for general graphs, one of G by the set S, which could be a node set or has to rely onheuristics. Cook andSeymour (2003) anedge set. Notice inFigure 2 that the inclusionof gave a heuristic algorithm to produce branch decom- separations of the graph of order four to the tan- positions that shows promise. In addition, Hicks gle would result ina violationof oneof the tangle (2000, 2002) also found another branchwidth heuris- axioms. A tangle  of G with order k canbe thought tic that was comparable to the algorithm of Cook of as a “k-connected” component of G because some and Seymour. Recently, Tamaki (2003) has presented a Hicks: Planar Branch Decompositions I: The Ratcatcher INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS 405 linear-time heuristic for near-optimal branch decom- carving decomposition of G. Notice that removing an positions of planar graphs. This algorithm performs edge e of T partitions the nodes of G into two sub- well whencompared to the heuristics of Cook and sets Ae and Be. The cut set of e is the set of edges that Seymour (2003) and Hicks (2002) and may give some are incident to nodes in Ae and to nodes in Be (also insight to finding an algorithm for optimal branch denoted &Ae or &Be ). The width of a carving decom- decompositions of planar graphs with lower complex- position T % is the maximum cardinality of the cut ity than the currently known methods. sets for all edges in T . The carvingwidth for G, 'G ,is Robertson and Seymour (1983) conceived a new the minimum width over all carving decompositions way to decompose a graph to display the simi- of G. A carving decomposition is also known as a larities between the graph and trees. This concept, minimum-congestion routing tree and one is referred to tree decompositions, and the associated connectivity Alvarez et al. (2000) for a link between carvingwidth invariant, treewidth, have beenextensivelyresearched and network design. The ratcatcher method is really by Thomas (1990), Seymour and Thomas (1993), an algorithm to compute the carvingwidth for planar Bodlaender and Kloks (1996), Bodlaender (1996, 1998), graphs. To show the relationbetweencarvingwidth Ramachandramurthi (1997), Reed (1992, 1997) and and branchwidth we need another definition. many others (see the survey papers by Bodlaender Let G be a planar graph and denote the planar 1993, 1997). The reader is also referred to the work embedding of the graph on the sphere. For every of Koster et al. (2001, 2002), Telle and Proskurowski node v of G, the edges incident to v canbe ordered (1997), and Alber and Neidermeier (2002) for some ina clockwise or counter-clockwise order. This order- computational results related to tree decompositions ing of edges incident to v is the cyclic order of v. Let and tree decomposition-based algorithms. The dif- MG be a graph with the vertex set EG and let ference between branchwidth and treewidth is that the edges of MG be the union of cycles Cv for all v ∈ VG where C is the cycle through the nodes of branchwidth deals with edges and treewidth deals v with nodes. MG that correspond to the edges incident with v Since the ratcatcher method is related to a game, it according to v’s cyclic order. MG is called a medial was only right to discuss a game related to treewidth. graph of G. The medial graph of Figure 1 is givenin Figure 3. One can notice that every connected pla- Seymour and Thomas (1993) presented a characteriza- nar hypergraph G with EG = has a medial graph tion of treewidth of any connected graph by a search and every medial graph is planar. In addition, notice game conducted on that graph. The game consists of that their is a bijectionbetweenthe regionsof MG a robber and k cops where k is some positive inte- and the nodes and regions of G. Using this relation- ger. The robber, with immense speed, can travel from ship, Hicks (2000) proved that if a planar graph and node to node using paths of the graphs. The robber its dual are both loopless thenthey have the same cannot run through a node occupied by a cop. Each branchwidth. Figure 4 illustrates this result by pre- of the cops is either ona nodeof the graph or ina senting one branch decomposition for both cube3 and helicopter enroute to a node.Clearly, the objective the octahedron. For the relationship between branch- of the cops is for at least one cop to land on a node width and carvingwidth, Seymour and Thomas (1994) occupied by the robber; the robber’s objective is to proved: avoid capture. Inaddition,the robber canobserve a helicopter approaching a node and may run to a new Theorem 3 (Seymour and Thomas 1994). Let G be node before the helicopter lands. The game stops once a connected planar graph with EG ≥2, and let MG the robber has beencaptured. Seymour andThomas be the medial graph of G. Then the branchwidth of G is (1993) showed that the graph has treewidth of at most half the carvingwidth of MG . k if and only if k + 1 cops cancapture the robber onthe graph. For other games related to treewidth, 0 the reader is referred to anexcellentsurvey paper by Bienstock (1991). ca cb 2 3 4 2.2. CarvingDecompositions cce f Now that we have a attained a good grasp of the 1 6 7 5 definitions associated with branchwidth and branch cg ch decompositions, we can concentrate on definitions rel- 9 8 10 evant to the ratcatcher method. Let G be a graph with cc cd node set VG and edge set EG . Let T be a tree hav- ing VG leaves in which every nonleaf node has 11 degree three. Let % be a bijectionbetweenthe nodes of G and the leaves of T . The pair T % is called a Figure 3 Medial Graph of the Graph in Figure 1 Hicks: Planar Branch Decompositions I: The Ratcatcher 406 INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS

2 3 7 8 Inaddition,part of the proof of Theorem 3 is a the- orem by Robertson and Seymour (1994) that for any a b a 0 graph G that is embeddable ona surface +, a relation- 2 e f 4 6 10 3 * * 0 5* * ship is developed betweenuniform slopes of the dual 1 1 11 6 7 5 b c of the medial graph of G embedded in + and tangles 4* 8 7* g h * 3* of G restricted by the embedding. 5 11 2 d 10* 9 10 6* 8* Finally, we can define antipodalities and give the c d e f 11 9* relationship between carvingwidth, tilts, slopes, and 0 4 1 9 antipodalities. Given a planar graph G and its dual G∗, anedge e of G is incident with a region r ∈ RG Figure 4 Cube3 and the Octahedron Have Branchwidth Four if e∗ is incident to r ∈ VG∗ .Awalk in G is a sequence

v0e1v1e2///etvt, where v0v1///vt ∈ VG , Therefore, computing the carvingwidth of MG e1e2///et ∈ EG ,andvi−1vi is the set of ends of ei gives us the branchwidth of G. Also, having a carv- 1 ≤ i ≤ t . A walk is closed if v0 equals vt.Anantipo- ing decomposition of MG , T % , gives us a branch dality in G of range at least k is a function 2 with decompositionof G, T  , such that the width of domain EG ∪ RG , such that for all e ∈ EG , 2e is T  is exactly half the width of T % . The rat- a nonnull subgraph of G, and for all r ∈ RG , 2r is catcher method actually computes the carvingwidth a nonempty subset of VG , satisfying: of planar graphs. In addition, the ratcatcher method (A1) If e ∈ EG then no end of e belongs to V 2e . does not search for low cut sets in the medial graph (A2) If e ∈ EG , r ∈ RG ,ande is incident to r, but for objects that prohibit the existence of low cut then 2r ⊆ V 2e , and every component of 2e has sets. These objects are called antipodalities. a vertex in 2r . (A3) If e ∈ EG and f ∈ E2e thenevery closed 2.3. Tilts, Slopes, and Antipodalities walk of G∗ using e∗ and f ∗ has length ≥k. To discuss fully the relationship between carving- Inaddition,anantipodality 2 is called connected if width and antipodalities, more definitions are needed. 2e is connected for all edges e of G. The mainresult Let G be a graph. A tilt in G of order k is a collection  in Seymour and Thomas (1994) is the following. of subsets of VG such that the following hold: (B1) for every X ⊆ VG such that &X

(S2) If P1, P2,andP3 are three internally vertex dis- game is a rat that is content to stay in the house and joint paths of G joining the nodes u and v and the runalongthe walls of the house. The other player is a three cycles P1 ∪ P2, P2 ∪ P3,andP1 ∪ P3 all have length ratcatcher who was hired by the owners of the house to

∗ ∗ if there is no closed walk in G of p-length

and L be simple graphs and let Xi i ∈ VN be a 3. The Ratcatcher Algorithm partitionof VL such that if u ∈ Xiv∈ Xj are adja- Givena graph G, the ratcatcher algorithm constructs cent in L, then i = j and ij are adjacent in N . A set MG and MG ∗ and tests whether the carvingwidth R ⊆ VL is round if for all ij ∈ VN adjacent in of MG is at least k by testing whether there exists N , every vertex in Xi ∩ R is adjacent to some vertex an antipodality of range at least k. To test for the exis- in Xj ∩ R. tence of an antipodality of range at least k for anedge For anedge e ∈ EMG , let Ce denote the set of e of the medial graph, edges are identified that sat- components of 5e . Also, for each e ∈ EMG , let isfy (A1) and (A3). For each e ∈ EMG , let 5e be Xe be the set of all pairs e C C ∈ Ce and for each the subgraph of MG where the nodes of 5e con- r ∈ RMG , let Xr be the set of all pairs r v v ∈ sist of V MG , except the ends of e and the edges V MG . Let I = EMG ∪ RMG . Seymour and of 5e consist of all the edges f such that no end Thomas (1994) construct a graph L with vertex set ∗ of f is anendof e, and no closed walk of MG of Xi i ∈ I inwhich eC ∈ Xe is adjacent to rv in ∗ ∗ length less than k contains both e and f . For a given Xr if e ∈ EMG , r ∈ RMG , e is incident with r, graph G, let duv denote the length of the shortest and v ∈ VC . They also construct a graph N with path between u v ∈ VG .Ife∗ and f ∗ are distinct and vertex set I inwhich e ∈ EMG is adjacent to r ∈ ∗ have ends u1u2 and v1v2, respectively, in G , then RMG if e is incident with r ∈ MG . Inaddition, there is a closed walk of length

VM .Asanodeu is takenoff the stack, it is taken conducted to gather the necessary information. In out of S and for all of its neighbors v not already in addition, an array of bool (char for C users) is kept the stack, reduce the weight of the edge uv by one with the size of the nodes of the medial graph for and if the weight becomes zero, then insert v into the the 5 sets to test for membership for just one side of stack. Once the stack is empty and S is nonempty, the bipartitionof the medial graph (say the original then S is a round set for L. Otherwise, a round set nodes). For clarity, we will label these nodes red. For for L does not exist. The authors showed that L has a a regionof MG , say r, let e be an edge incident with round set if and only if MG has anantipodalityof r and let ro be the other region incident with e. To sat- range k. isfy (A2) completely, a node v in 5r has also to be

The ratcatcher method included this round-set algo- in 5ro or there must exist a path in the components rithm with the modificationof replacingthe three of 5e from v to some node in 5ro . If a node does graphs by arrays that kept all vital information. not satisfy (A2) for r thendelete that nodefrom 5r . Specifically, each region r has a set 5r initially set Once every 5r satisfies (A2) for all regions r, then to be VM . Inaddition,each edge e of the medial 2r = 5r for all regions r.If5r becomes the null graph had three arrays whose size is the number of set thenanantipodalityof rangeat least k does not nodes of the medial graph, to keep the knowledge exist. Anexample of 2r , the dashed nodes, when r of the components of 5e and the number of 5r1 is the outside regionof the medial graph inFigure 3, and 5r2 nodes on the components, where r1 and is illustrated inFigure 6. r2 are the regions incident with e. Also, each “root” Thus, to accomplish the goal of testing (A2), a of the components kept a linked list of the members queue is created containing every blue region. Once a of the components to ensure the same complexity as region r is takenout of the queue, we create its 5 set Seymour and Thomas. The stack is filled with the by the fact giveninthe previous paragraphs andwe pairs rv where r is a regionand v is a node incident test (A2) on 5r by testing the aforementioned vertex with r. Once rv is takenoff the stack, for each edge and path condition on every edge incident to r.If5r e incident with r, the number of 5r nodes on the has changed, it is put at the end of the queue. Also, ∗ same component of 5e as v is decreased by one. For if for one of r’s neighbors in MG , say ro, 5ro has anedge e incident with r and another region ro,ifthe changed, then all of ro’s neighbors are put in the stack number of 5r nodes on the same component of 5e if they are not already in the queue. We continue test- as v is zero, thenthe pair row is put inthe stack if ing members of the queue until the queue is empty row is notalready onthe stack. Inaddition,if 5r is or there exists a region r such that 5r is empty. We empty for a region r, thenthe algorithm terminates will call this procedure comptest. early because an antipodality for the input range does Theorem 5. The procedure comptest terminates and not exist (Seymour and Thomas 1994). an antipodality can be derived from the information if one exists. 4. Memrat and Comprat Proof. Since the 5 set for all regions is finite and The ratcatcher algorithm is good for small graphs the fact that a regionis put back inthe queue only (with at most 5,000 edges). However for bigger if one of its neighbors’ 5 set decreases, the proce- graphs, the algorithm will runout of memory quickly. dure terminates. It is easy to see that if the proce- Thus, for bigger graphs, a new algorithm had to be dure terminates with every region having nonempty created. The memory-friendly ratcatcher method pre- 5 sets, the resulting 5 sets for the regionsatisfy (A2) sented in this paper has complexity Oe3 , compared to the original ratcatcher method with a complexity 2 of Oe , where e is the number of edges of the origi- 0 nal graph. We will refer to this method as the memrat method. The memrat method uses two ideas: The dual of the medial graph is bipartite; and by A2 , for a region r incident with edges e e /// and neighbors 2 3 4 1 2  r r /// respectively, the set 5r = V 5 e ∀ e  1 2 ri i i 1 6 7 5 contains the antipodality set for r if one exists, where 5 e is the subgraph of 5e , where every compo- 9 8 10 ri i nent of 5 e has a node in the set 5r . ri i i For the memrat method, the all-pairs shortest- paths array and any information kept on the edges 11 for the antipodality are discarded. Thus, a number of shortest-path calculations (breadth-first-search) are Figure 6 Example r for an Antipodality of Range Eight Hicks: Planar Branch Decompositions I: The Ratcatcher INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS 409 and are indeed the corresponding 2 sets. For the tele133 ch130 antipodalities of the edges, for each e ∈ EMG and a region r incident with e, define 2e to be the union of all components of 5e that contain a node of 5r . It is clear that 2 satisfies (A1), (A2), and (A3). Since one has to compute 5e for every edge e inci- dent to r and the worst case that the antipodality does not exist, then the complexity of comptest is OV MG ∗EMG ∗V MG +EMG . Fur- thermore, this complexity result is bounded by Oe3 where e =V MG .  In addition, another algorithm was also created that 5 10 kept the all-pairs shortest path array and 5r for every region r. This algorithm is called the comprat Figure 7 Some Test Instances with Their Corresponding Branchwidth method. For each region r takenoff the queue, comprat would verify the path conditionbetweenthetwo 5 5. Computational Results sets for every edge incident to r.If5r gets changed, The test instances are partitioned into two classes: then r is put back onto the queue. If the 5 set of telecommunications (T) and Delaunay (D). The region ro, a neighbor of r, has beenchangedby the pro- members of the telecom class are maximum planar cedure and ro is not on the queue, then ro is put onthe subgraphs of test instances from the telecommuni- queue. Comprat has the same complexity as memrat cations industry provided by Bill Cook at Georgia but with addition of the array it should be inherently Tech. The maximum planar subgraphs were derived faster. For all three methods, aninitialguess is used using a branch-and-cut scheme developed by Hicks in the hope of being close to the carvingwidth. For (2004b). The other test instances are Delaunay tri- the initial guess, we find the shortest eccentricity (the angulations of some test instances from the TSPLIB length of the longest shortest path) of one side of the (Reinelt 1991). For more information about Delaunay bipartition (the original nodes) of nodes of the dual of triangulations, the reader is referred to Edelsbrunner the medial graph and initialize the guess to be twice (1987). Figures 7, 8, and 9 illustrate some of the test that amount, minus four. If there exist an antipodality instances. in MG of this range, we then proceed to increment Table 1 offers a summary of the computational this value by two until an antipodality doesn’t exist. If results by offering the runtimes (rounded to the near- the initial guess fails, then we proceed to decrease this est integer if greater than one) of the ratcatcher, com- value by two until an antipodality does exist. prat, and memrat methods on a representative group.

rd400 pcb442

17 17

Figure 8 Some Test Instances with Their Corresponding Branchwidth Hicks: Planar Branch Decompositions I: The Ratcatcher 410 INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS

u574 d657

17 22

Figure 9 Some Test Instances with Their Corresponding Branchwidth

Table 1 Comparison of the Three Methods

Graphs Class Nodes Edges G iter rat (sec) comprat (sec) memrat (sec)

tele39 T 39 81 4 3 030305 tele53 T 53 91 5 4 050509 tele56 T 56 85 3 2 020203 tele62 T 62 129 4 2 050507 tele89 T 89 136 4 3 040508 tele133 T 133 212 5 1/1/3 2 3 4 tele226 T 226 2,286 4 2 1 2 2 eil51 D 51 140 8 4 1 1 2 lin105 D 105 292 8 3 4 7 9 ch130 D 130 377 10 4 9 13 18 pr144 D 144 393 9 4 9 12 19 kroB150 D 150 436 10 4 12 18 24 pr226 D 226 586 7 3 17 22 31 tsp225 D 225 622 12 4 22 29 46 a280 D 280 788 13 4/4 17 22 35 pr299 D 299 864 11 4/3 21 34 45 rd400 D 400 1,183 17 3 65 112 136 pcb442 D 442 1,286 17 4 90 135 211 u574 D 574 1,708 17 3 145 226 298 p654 D 654 1,806 10 3 161 198 276 d657 D 657 1,958 22 4 224 396 545 pr1002 D 1,002 2,972 21 2 338 448 562 rl1323 D 1,323 3,950 22 3 876 1,519 1,590 d1655 D 1,655 4,890 29 3 1,318 1,608 2,206 rl1889 D 1,889 5,631 22 3 M 3,931 4,012 u2152 D 2,152 6,312 31 4 M 3,207 4,704 pr2392 D 2,392 7,125 29 3 M 3,813 5,167 pcb3038 D 3,038 9,101 40 4 M 13,817 15,865 fl3795 D 3,795 11,326 25 3 M 18,469 17,142 fnl4461 D 4,461 13,359 48 4 M 35,933 51,035 rl5934 D 5,934 17,770 41 3 M 73,468 66,461 pla7397 D 7,397 21,865 33 2 M 65,197 53,564 usa13509 D 13,509 40,503 63 1/2 M M 413,861 brd14051 D 14,051 42,128 68 3 M M 594,468 Hicks: Planar Branch Decompositions I: The Ratcatcher INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS 411

All three methods were implemented using the C++ bond using e and f has cardinality ≥ k.” This would language. All computations for Table 1 were per- probably be the first step toward finding an ana- formed ona SGI Power Challengewith 6 × 194 MHz logue to antipodalities for medial graphs on other processors with a gigabyte of memory and a gigabyte orientable surfaces. Another direction would be to of swap space. The columnlabeled “iter” gives the use the antipodalities to construct an optimal branch number of iterations needed to compute the branch- decomposition. For motivation, in a connected antipo- width of the graph to show performance of the initial dality, there is a bond in MG (a separationin G) guess and to offer an estimate of the runtime per iter- associated with the 2r for every region r of MG . ationfor each method. Inaddition,forward slashes Using only the ratcatcher method to produce an opti- partition the number of iterations needed for each mal branch decomposition would decrease the com- biconnected component of the input graph. Also an plexity of finding an optimal branch decomposition of “M” inthe table meansthat the code ranout of mem- a planar graph which is currently known to be Oe4 ory on that particular test instance. (Hicks 2005). In addition, recent results by Tamaki As one can see from Table 1, the initial guess works (2003) may offer insight toward this challenging prob- well (the minimum possible number for iterations is lem. Finally, another direction for research is finding two if the branchwidth is not two). In addition, rat- analgorithm to compute the optimal treewidth of a catcher is faster thanthe other methods but onlyby planar graph; see Robertson and Seymour (1984) and a factor of at most 1.77 for comprat and at most 2.43 Bouchitte et al. (2001) for related background. for memrat. Thus, each method is good for a par- ticular class of graphs depending on the number of Acknowledgments edges. With the inclusion of the all-pairs shortest-path The author would like to acknowledge Bill Cook for his matrix, comprat is good only for graphs with about guidance and patience. The author would also like to thank Nate Dean and Paul Seymour for conversations about the 20,000 edges, as illustrated in Table 1. Understand that subject. In addition, this effort could have not been accom- if the original graph is biconnected with 20,000 edges, plished without the planarity testing codes provided by thenthe medial graph has 20,000 nodes,40,000 edges David Applegate and John Boyer (see Boyer and Myrvold and 20,002 regions. Thus, the medial graph is about 1999 for a descriptionof the algorithm). Applegate’s code twice as large as the original graph. was used for earlier versions of the methods, while Boyer’s Furthermore, as the sizes of the graphs get closer code was used for the recent versions of the methods. to the memory limitations for the comprat method, This research was partially supported by NSF Grant DMI- memrat outperforms comprat. This could be due to 0217265, ONR Grant N00014-98-1-0014, and by Texas ATP the time spent using the swap space. Since the mem- Grant 99-3604-0034. The author was also supported by the rat method is structured to handle big graphs, Table 1 AT&T Labs Fellowship Program as a graduate student in the Computational and Applied Mathematics Department illustrates that the memrat method canhandlegraphs at Rice University. Finally, the author would like to thank with edges with at least 40,000 edges. For brd14051, the anonymous referees that gave valuable advice for the memrat uses about 600 megabytes of memory. Thus, presentation of the results. the estimated limit for a computer with one giga- byte of memory would be a graph with about 70,000 edges. In contrast, the runtime for the memrat method References for brd14051 is not as impressive. As illustrated in Alber, J., R. Niedermeier. 2002. Improved tree decomposition Table 1, the memrat method took over 165 hours for based algorithms for domination-like problems. Fifth Latin completion. Thus, the memrat method took about 55 American Theoret.Informatics (LATIN 2002). Springer-Verlag, Berlin, Germany, 613–627. hours per iteration for this test instance. Obviously, all Alvarez, C., R. Cases, J. Diaz, J. Petit, M. Serna. 2000. Routing three methods illustrate the classic conflict between tree problems on random graphs. Technical report LSI-01-10-R, memory and runtime speed. Software Department, Universitat Politecnica de Catalunya, Barcelona, Spain. Archdeacon, D. 1980. A Kuratowski theorem for the projec- 6. Conclusions and Future Work tive plane. Ph.D. thesis, Mathematics Department, Ohio State In conclusion, the ratcatcher method can calculate University, Columbus, OH. Archdeacon, D., P. Huneke. 1989. A Kuratowski theorem for non- the branchwidth of planar graphs having up to 5,000 orientable surfaces. J.Combin.Theory, Ser.B 46 173–231. edges while comprat and memrat can handle planar Arnborg, S., J. Lagergren, D. Seese. 1991. Easy problems for tree- graphs having up to 20,000 and 70,000 edges respec- decomposable graphs. J.Algorithms 12 308–340. tively. Thus, each method is essential for a particular Bienstock, D. 1991. Graph searching, path-width, tree-width and class of planar graphs. related problems. Reliability of Computer and Communication Networks. Series Discrete Math. Theoret. Comput. Sci. (DIMACS), There are several directions for future work in the Vol. 5. AmericanMathematical Society, Providence,RI, 33–49. area of this paper. First, it seems that anantipodal- Bodlaender, H. 1993. A tourist guide through treewidth. Acta Cyber- ity would exists if (A3) were rephrased to “every netica 11 1–21. Hicks: Planar Branch Decompositions I: The Ratcatcher 412 INFORMS Journal on Computing 17(4), pp. 402–412, © 2005 INFORMS

Bodlaender, H. 1996. A linear time algorithm for finding tree- Hicks, I. V. 2005. Planar branch decompositions II: The cycle decompositions of small treewidth. SIAM J.Comput. 25 method. INFORMS J.Comput. 17 418–421. 1305–1317. Kloks, T., J. Kratochvil, H. Müller. 1999. New branchwidth territo- Bodlaender, H. 1997. Treewidth: Algorithmic techniques and ries. Sixteenth Annual Sympos.Theoret.Aspects Comput.Sci.Trier, results. 22nd Internat. Sympos. Math. Foundations Comput. Sci. Germany, March 1999. Springer-Verlag, Berlin, 173–183. (MFCS 1997). LNCS, No. 1295. Springer-Verlag, Berlin, Ger- Koster, A., H. Bodlaender, S. van Hoesel. 2001. Treewidth: Com- many, 29–36. putational experiments. Technical report 01-38, Konrad-Zuge, Bodlaender, H. 1998. A partial k-arboretum of graphs with bounded Zentrum für Informationstechnik Berlin, Berlin, Germany. treewidth. Theoret.Comput.Sci. 209 1–45. Koster, A., S. van Hoesel, A. Kolen. 2002. Solving partial constraint Bodlaender, H., T. Kloks. 1996. Efficient and constructive algorithms satisfactionproblems with true decomposition. Networks 40 for the pathwidth and treewidth of graphs. J.Algorithms 21 170–180. 358–402. Kuratowski, K. 1930. Sur le probleme des courbes gauches en Bodlaender, H., D. Thilikos. 1997. Constructive linear time algo- topologie. Fundamenta Math. 15 271–283. rithms for branchwidth. 24th Internat. Colloquium Automata, Ramachandramurthi, S. 1997. The structure and number of obstruc- Languages, Programming. LNCS, No. 1256. Springer-Verlag, tions to treewidth. SIAM J.Discrete Math. 10 146–157. Berlin, Germany, 627–637. Reed, B. 1992. Finding approximate separators and computing tree Bodlaender, H., D. Thilikos. 1999. Graphs with branchwidth at most width quickly. Twenty Fourth Annual ACM Sympos.Theory Com- three. J.Algorithms 32 167–194. put. ACM Press, New York, 221–228. Borie, R., R. Parker, C. Tovey. 1992. Automatic generation of linear- Reed, B. 1997. Tree width and tangles: A new connectivity measure time algorithms from predicate calculus descriptions of prob- and some applications. R. Bailey, ed. Survey in Combinatorics. lems onrecursively constructed graph families. Algorithmica 7 Cambridge University Press, Cambridge, U.K. 555–581. Reinelt, G. 1991. TSPLIB—A traveling salesman library. ORSA J. Bouchitte, V., F. Mazolt, I. Todinca. 2001. Chordal embeddings Comput. 3 376–384. of planar graphs. Technical report RR-2001-03, Laboratoire d’Informatique Fondametale d’Orléans, Orleans, France. Robertson, N., P. Seymour. 1983. Graph minors I: Excluding a forest. J.Combin.Theory, Ser.B 35 39–61. Boyer, J., M. Myrvold. 1999. Stop minding your P’s and Q’s: A sim- plified O(n) planar embedding algorithm. Tenth Annual ACM- Robertson, N., P. Seymour. 1984. Graph minors III: Planar tree- SIAM Sympos.Dicrete Algorithms. ACM, New York, 140–146. width. J.Combin.Theory, Ser.B 36 49–64. Christian, W. 2003. Linear-time algorithms for graphs with bounded Robertson, N., P. Seymour. 1985. Graph minors: A survey. Survey in branchwidth. Ph.D. thesis, Computational and Applied Math- Combinatorics. Cambridge University Press, Cambridge, U.K., ematics Department, Rice University, Houston, TX. 153–171. Cook, W., P. Seymour. 2003. Tour merging via branch-decomposi- Robertson, N., P. Seymour. 1991. Graph minors X: Obstructions to tion. INFORMS J.Comput. 15 233–248. tree-decompositions. J.Combin.Theory, Ser.B 52 153–190. Courcelle, B. 1990. The monadic second-order logic of graphs I: Robertson, N., P. Seymour. 1994. Graph minors XI: Circuits on a Recognizable sets of finite graphs. Inform.Comput. 85 12–75. surface. J.Combin.Theory, Ser.B 60 72–106. Edelsbrunner,H.1987.AlgorithmsinCombinatorialGeometry.Springer- Robertson, N., P. Seymour. 1995. Graph minors XIII: The disjoint Verlag, Berlin, Germany. paths problem. J.Combin.Theory, Ser.B 63 65–110. Geelen, J., A. Gerards, G. Whittle. 2002. Branch width and well- Seymour, P., R. Thomas. 1993. Graph searching and a min-max the- quasi-ordering in matroids and graphs. J.Comb.Theory, Ser.B orem for tree-width. J.Combin.Theory, Ser.B 58 22–33. 84 270–290. Seymour, P., R. Thomas. 1994. Call routing and the ratcatcher. Com- Glover, H., P. Huneke, C. Wang. 1979. 103 graphs that are irre- binatorica 14 217–241. ducible for the projective plane. J.Comb.Theory, Ser.B 27 332– Tamaki, H. 2003. A linear time heuristic for the branch-decom- 370. position of planar graphs. Technical report MPI-I-2003-1-010, Hicks, I. V. 2000. Branch Decompositions and their Applications. Ph.D. Max-Planck-Institut für Informatik, Saarbrücken, Germany. thesis, Computational and Applied Mathematics Department, Telle, J., A. Proskurowski. 1997. Algorithms for vertex partition- Rice University, Houston, TX. ing problems on partial k-trees. SIAM J.Discrete Math. 10 Hicks, I. V. 2002. Branchwidth heuristics. Congressus Numerantium 529–550. 159 31–50. Thomas, R. 1990. A Menger-like property of tree-width: The finite Hicks, I. V. 2004a. Branch decompositions and minor containment. case. J.Combin.Theory, Ser.B 48 67–76. Networks 43 1–9. Wagner, K. 1937. Über eine Eigenschaft der ebenen Komplexe. Hicks, I. V. 2004b. New facets for the planar subgraph polytope. Mathematische Annalen 115 570–590. Working paper, Industrial Engineering Department, Texas West, D. 2001. Introduction to Graph Theory. Prentice-Hall, Upper A&M University, College Station, TX. Saddle River, NJ.