A new approach on locally checkable problems
aa r X i v : . [ c s . D M ] J un THE GENERALIZED LOCALLY CHECKABLE PROBLEMIN BOUNDED TREEWIDTH GRAPHS
FLAVIA BONOMO-BRABERMAN AND CAROLINA LUC´IA GONZALEZ
Abstract.
We introduce a new problem that generalizes some previous attempts ofcovering locally checkable problems under the same umbrella. Optimization and deci-sion problems such as { k } -dominating set, b-coloring, acyclic coloring and connecteddominating set, can be seen as instances of this new problem.We prove that this new problem can be solved, under mild conditions, in polyno-mial time for bounded treewidth graphs. As a consequence, we obtain polynomial-time algorithms to solve, for bounded treewidth graphs, Grundy domination anddouble Roman domination, among other problems for which no such algorithm waspreviously known. Moreover, by proving that (fixed) powers of bounded degree andbounded treewidth graphs are also bounded degree and bounded treewidth graphs,we can enlarge the family of problems that can be solved in polynomial time for thesegraph classes, including distance coloring problems and distance domination problems(for bounded distances). Introduction
Many combinatorial optimization problems in graphs can be classified as vertexpartitioning problems. The partition classes have to verify inner-properties and/orinter-properties, and there is an objective function to minimize or maximize. Someof these properties are locally checkable , that is, the property that each vertex has tosatisfy with respect to the partition involves only the vertex and its neighbors. This isthe case of stable set, dominating set and k -coloring, among others.In the spirit of generalizing this kind of problems, in [61] Telle defines the locallycheckable vertex partitioning (LCVP) problems. In [14], Bui-Xuan, Telle and Vatshellepresent dynamic programming algorithms for LCVP problems that run in polyno-mial time on many graph classes, including interval graphs, permutation graphs andDilworth k graphs, and in fixed-parameter single-exponential time parameterized byboolean-width. In [16], Cattan´eo and Perdrix define a different generalization of LCVPproblems that allows us to deal with properties of the subset that are not necessarilylocally checkable, as for example being connected, and prove hardness results for LCVPproblems and such generalizations.However, none of these generalizations allows to model problems like { k } –domination(at least not in a straightforward way).In this paper, we define the generalized locally checkable (GLC) problem that suc-cessfully deals with the previously mentioned issue. In this new problem, every vertexhas a list of colors that it can receive along with the cost of receiving each color. Foreach vertex and each coloring of its neighborhood, we have a function that checks theneighborhood, i.e., determines if the colors of the neighbors and itself are permittedfor the vertex in question. Other simple operators are also required, such as one thatcombines the costs and one that compares them. We include edge labels, whose values Key words and phrases. graph theory, locally checkable problems, vertex partitioning problems,domination, coloring, treewidth, computational complexity. may be involved in the checking functions. We also consider a set of global properties(for example, that certain sets of the partition induce a connected or an acyclic sub-graph). In this way, problems like acyclic coloring or connected dominating set can bemodeled as instances of the GLC problem.Let us give an example. Imagine there is a city where we need to build hospitals,schools and police stations. Of course, the cost of building a hospital is not the same asbuilding a school, and the cost of building in some areas may be higher than in others,so, for each place and each type of building permitted in that place, we have the costof raising such building there. Also, some streets might be easier to transit than others(this information is stored in the edge labels). There are some rules as well, such as “ahospital needs to be near a police station” (these rules are what the checking functionfor each vertex controls, using the edge labels). As a global property, we can requestthat hospitals induce a connected subgraph. Finally, we are interested in a feasiblesolution of minimum cost.A key notion to our paper is the treewidth of a graph, which was introduced byRobertson and Seymour [56]. Graphs of treewidth at most k are called partial k -trees .Some graph classes with bounded treewidth include: forests (treewidth 1); pseudo-forests, cacti, outerplanar graphs, and series-parallel graphs (treewidth at most 2);Halin graphs and Apollonian networks (treewidth at most 3) [7, 10, 50, 56]. In addi-tion, control flow graphs arising in the compilation of structured programs also havebounded treewidth (at most 6) [63].We give a polynomial-time algorithm for the GLC problem, under mild condi-tions, for bounded treewidth graphs. Furthermore, by proving that (fixed) powers ofbounded degree and bounded treewidth graphs are also bounded degree and boundedtreewidth graphs, we can enlarge the family of problems (modeled as instances ofthe GLC problem) that can be solved in polynomial time for these graph classes, in-cluding distance coloring problems (packing chromatic number [13, 29, 36, 60], L ( p, HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 3 remarks and future research lines are in Section 9. We include in Appendix A thedefinition of the problems mentioned in Section 7.2.
Basic definitions and preliminary results
Basic definitions on sets and operations.
Let S be a set. A closed binaryoperation on S is a function ⋆ : S × S → S . It is usual to write ⋆ ( s , s ) as s ⋆ s .Such an operation is commutative if s ⋆ s = s ⋆ s for all s , s ∈ S , and it is associative if ( s ⋆ s ) ⋆ s = s ⋆ ( s ⋆ s ) for all s , s , s ∈ S . An element e ∈ S is neutral if e ⋆ s = s ⋆ e = s for all s ∈ S . An element a ∈ S is absorbing if a ⋆ s = s ⋆ a = a for all s ∈ S . It is easy to prove that if s ∈ S is a neutral(resp. absorbing) element, then this element is unique. A commutative and associativeoperation ⋆ can be naturally extended to any nonempty finite subset of S , writing ⋆ x ∈ X P ( x ) when { P ( x ) : x ∈ X } ⊆ S and X is finite and nonempty, moreover, if theoperation also has a neutral element e then we define ⋆ x ∈∅ P ( x ) = e .A binary relation R on a set S is a subset of the Cartesian product S × S . Itis usual to write ( s , s ) ∈ R as s R s . We say that R is reflexive if s R s for all s ∈ S , antisymmetric if s R s ∧ s R s ⇒ s = s for all s , s ∈ S , and transitive if s R s ∧ s R s ⇒ s R s for all s , s , s ∈ S . If R is reflexive, antisymmetric andtransitive, then ( S, R ) is called a partial order (or partially ordered set ). If in addition s R s ∨ s R s for every s , s ∈ S , then ( S, R ) is a total order (or totally ordered set ).Let ( S, (cid:22) ) be a totally ordered set. A maximum element is an element m ∈ S suchthat s (cid:22) m for all s ∈ S . Note that not every totally ordered set has a maximumelement, and it is easy to prove that if it does have a maximum element then thiselement is unique. The minimum operation , min, is the closed binary operation on S such that min( s , s ) = s if s (cid:22) s and min( s , s ) = s if s (cid:22) s . It is easy to provethat min is commutative and associative.A set of natural numbers is co-finite if its complement with respect to the set ofnatural numbers is finite.We denote by [[ a, b ]], with a, b ∈ Z and a < b , the set of all integer numbers greateror equal a and less or equal b , that is { a, a + 1 , . . . , b } .Given a set S and a function f : S → R , the weight of the function f (finite orinfinite) is defined as P s ∈ S f ( s ).Throughout this paper we will work with the set Bool = { True , False } of booleanvalues and all the usual logical operators, such as ¬ , ∧ , ∨ and ⇒ .2.2. Basic definitions on automata. A deterministic finite-state automaton is afive-tuple ( Q, Σ , δ, q , F ) that consists of • Q : a finite set of states , • Σ: a finite set of input symbols (often called the alphabet ), • δ : Q × Σ → Q : a transition function , • q ∈ Q : an initial or start state , and • F ⊆ Q : a set of final or accepting states .We say that an automaton M = ( Q, Σ , δ, q , F ) accepts a string s . . .s n , with n ≥ s i ∈ Σ for all 1 ≤ i ≤ n and δ ( . . . δ ( q , s ) . . . , s n ) ∈ F .For example, the automaton M = ( { q , q } , { } , δ, q , { q } ) where δ ( q ,
1) = q and δ ( q ,
1) = q , is the automata that accepts sequences of an odd number of 1s.For more about automata theory we refer the reader to [46]. F. BONOMO-BRABERMAN AND C.L. GONZALEZ
Basic definitions on graphs.
Let G be a finite, simple and undirected graph.We denote by V ( G ) and E ( G ) the vertex set and edge set, respectively, of G . For any W ⊆ V ( G ), we denote by G [ W ] the subgraph of G induced by W . Let N G ( v ) ( openneighborhood of v ) be the set of neighbors of v ∈ V ( G ) and let N G [ v ] = N G ( v ) ∪ { v } ( closed neighborhood of v ). The closed neighborhood of a set S is N G [ S ] = S v ∈ S N G [ v ].The degree of a vertex v is d G ( v ) = | N G ( v ) | . The maximum degree of a vertex in G isdenoted by ∆( G ).A graph class is a collection of graphs that is closed under isomorphism. Given agraph class G , we say that G is of bounded degree if sup { ∆( G ) | G ∈ G} < ∞ .A graph G is connected if for every pair of vertices u, v in V ( G ) there exists a pathin G from u to v . A connected component of a graph is an inclusion-wise maximalconnected subgraph of it. For two vertices x, y in a connected graph G , we denote bydist G ( x, y ) the distance between x and y , that is, the length (number of edges) of ashortest x, y -path in G . The k -th power of G is the graph denoted by G k such that forall distinct vertices x, y in V ( G ), x is adjacent to y in G k if and only if dist G ( x, y ) ≤ k .A complete graph is a graph whose vertices are pairwise adjacent. We denote by K r the complete graph on r vertices. A clique (resp. stable set or independent set ) in agraph is a set of pairwise adjacent (resp. nonadjacent) vertices. The maximum size ofa clique (resp. independent set) in the graph G is denoted by ω ( G ) (resp. α ( G )).A graph G is bipartite if V ( G ) can be partitioned into two stable sets V and V ,and G is complete bipartite if every vertex of V is adjacent to every vertex of V . Wedenote by K r,s the complete bipartite graph with | V | = r and | V | = s . The star S n isthe complete bipartite graph K ,n − .A proper k -coloring of a graph is a partition of its vertices into at most k stable sets,each of them called color class . Equivalently, a proper k -coloring is an assignment ofcolors to vertices such that adjacent vertices receive different colors, and the numberof colors used is at most k . The chromatic number χ ( G ) of a graph G is the minimum k that allows a proper k -coloring of G . In the more general List-coloring problem,each vertex v has a list L ( v ) of available colors for it.A pair of vertices or a pair of edges dominate each other when they are either equalor adjacent, while a vertex and an edge dominate each other when the vertex be-longs to the edge. We will denote by γ U,W ( G ), for U, W sets of elements of G , theminimum cardinality or weight of a subset S of U which dominates W . The pa-rameter γ V,V is also denoted simply by γ , and the associated problem is known as Minimum Dominating Set . Parameters γ V,E and γ E,V are associated with the
Min-imum Vertex Cover and
Minimum Edge Cover , respectively. In the
Minimum { k } -domination problem, given a graph G we want to find the minimum weight of afunction f : V ( G ) → { , , . . . , k } such that P u ∈ N G [ v ] f ( u ) ≥ k for all v ∈ V ( G ).Let σ and ρ be finite or co-finite subsets of non-negative integer numbers. A subset S of vertices of a graph G is a sigma-rho set , or simply ( σ, ρ )-set, of G if for every v in S , | N ( v ) ∩ S | ∈ σ , and for every v in V ( G ) \ S , | N ( v ) ∩ S | ∈ ρ . The locallycheckable vertex subset problems [61] consist of finding a minimum or maximum ( σ, ρ )-set in an input graph G , possibly on vertex weighted graphs. A generalization of theseproblems asks for a partition of V ( G ) into q classes, with each class satisfying a certain( σ, ρ )-property, as follows. A degree constraint matrix D q is a q × q matrix with entriesbeing finite or co-finite subsets of non-negative integer numbers. A D q -partition ofa graph G is a partition { V , V , . . . , V q } of V ( G ) such that for 1 ≤ i, j ≤ q it holdsthat for every v ∈ V i , | N ( v ) ∩ V j | ∈ D q [ i, j ]. A locally checkable vertex partitioningproblem [61] consists of deciding if G has a D q partition. Optimization versions can HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 5 be defined, possibly on vertex weighted graphs. The distance- r LCVP problems [48]further generalize LCVP problems by considering, for each vertex v , the set of verticesof a subgraph centered at v with radius r ( N r ( v )) instead of N ( v ).For a graph G and uv ∈ E ( G ), the graph obtained by subdividing uv in G arisesfrom G by adding a new vertex w , making w adjacent to u and v , and then deletingthe edge uv . The subdivision graph S ( G ) of G is obtained by subdividing each of theedges of G .The line graph of a graph G is denoted by L ( G ) and has as vertex set E ( G ), wheretwo vertices are adjacent in L ( G ) if and only if the corresponding edges have a commonendpoint (i.e., are adjacent) in G . The total graph of G , denoted by T ( G ), is definedsimilarly: its vertex set is V ( G ) ∪ E ( G ), V ( G ) induces G , E ( G ) induces L ( G ), and v ∈ V ( G ), uw ∈ E ( G ) are adjacent in T ( G ) if and only if either v = u or v = w .A graph, or a subgraph of a graph, is acyclic if it does not contain a cycle of lengthat least three. An acyclic graph is called a forest . A tree is a connected acyclic graph.In a tree T , we usually call the elements in V ( T ) nodes . A node with degree at most 1is called a leaf and a node of degree at least 2 is called an internal node . A tree iscalled a rooted tree if one vertex has been designated the root , in which case the edgeshave a natural orientation, towards or away from the root. For a rooted tree T and u ∈ V ( T ), the neighbor of u on the path to the root is called the parent of u and avertex v is a child of u if u is the parent of v . A binary tree is a rooted tree whereevery internal node has at most two children.2.4. Definitions and preliminary results on treewidth. A tree-decomposition ofa graph G is a family { X i : i ∈ I } of subsets of V ( G ) (called bags ), together with atree T with V ( T ) = I , satisfying the following properties:(W1) S i ∈ I X i = V ( G ).(W2) Every edge of G has both its ends in X i for some i ∈ I .(W3) For all v ∈ V ( G ), the set of nodes { i ∈ I : v ∈ X i } induces a subtree of T .The width of the tree-decomposition is max {| X i | − i ∈ I } . The treewidth of G ,denoted tw ( G ), is the minimum w ≥ G has a tree-decomposition of widthless or equal w .Given a graph class G , the treewidth of G is tw ( G ) = sup { tw ( G ) | G ∈ G} . We saythat G is of bounded treewidth if tw ( G ) < ∞ .We will often make use of the following basic properties of the treewidth, some ofwhich can be easily deduced. Proposition 2.4.1.
Let G be a family of graphs of bounded treewidth. If G ∈ G then | E ( G ) | is O ( | V ( G ) | ) . Proposition 2.4.2. If H is a subgraph of a graph G then tw ( H ) ≤ tw ( G ) . Theorem 2.4.3 ([57, pages 1 and 2]) . For every graph G , tw ( G ) ≥ ω ( G ) − . Moreover, tw ( G ) ≥ χ ( G ) − . Theorem 2.4.4 ([50, page 76]) . The treewidth of S ( G ) is equal to the treewidth of G . A tree-decomposition ( T, { X t } t ∈ V ( T ) ) is nice [50, Definition 13.1.4] if • T is a rooted binary tree; • if a node i has two children j and k then X i = X j = X k ; ( join node) • if a node i has one child j , then either • | X i | = | X j | − X i ⊂ X j , or ( forget node) • | X i | = | X j | + 1 and X i ⊃ X j . ( introduce node) F. BONOMO-BRABERMAN AND C.L. GONZALEZ
Let T i be the subtree of T rooted at node i . We will denote by G i the subgraph of G induced by S j ∈ V ( T i ) X j . Theorem 2.4.5 ([8, Theorem 1]) . There exists an algorithm, that given an n -vertexgraph G and an integer k , in time O ( c k n ) for some c ∈ N , either outputs that thetreewidth of G is larger than k , or constructs a tree-decomposition of G of width atmost k + 4 . Theorem 2.4.6 ([50, Lemma 13.1.3]) . For constant k , given a tree-decomposition ofa graph G of width k and O ( n ) nodes, where n is the number of vertices of G , one canfind a nice tree-decomposition of G of width k and with at most n nodes in O ( n ) time. However, we will work with a slight modification of nice tree decompositions, wherethe bags of the root and leaves have only one vertex each.
Definition 2.4.7.
A tree-decomposition ( T, { X t } t ∈ V ( T ) ) is called easy if • T is a binary tree rooted at r such that | X r | = 1; • if a node i has two children j and k then X i = X j = X k ; ( join node) • if a node i has one child j , then either • | X i | = | X j | − X i ⊂ X j , or ( forget node) • | X i | = | X j | + 1 and X i ⊃ X j ; ( introduce node) • if a node i has no children, then | X i | = 1. ( leaf node)It is straightforward to prove that, given a nice tree-decomposition ( T, { X t } t ∈ V ( T ) ) ofwidth k and O ( n ) nodes, one can construct in O ( kn ) time an easy tree-decompositionof width k and O ( kn ) nodes.3. The generalized locally checkable problem
Let G be a simple undirected graph such that each edge e ∈ E ( G ) has a label ℓ e .Then suppose we have the following: • for every vertex v ∈ V ( G ), a nonempty set (also called list) L v of possible colorsfor v ; • a totally ordered set ( Weights , (cid:22) ) with a maximum element (called Error ),together with the minimum operation of the order (cid:22) (called min) and a closedbinary operation on
Weights (called ⊕ ) that is commutative and associative,has a neutral element (called e ⊕ ) and an absorbing element that is equal to Error , and is such that s (cid:22) s ⇒ s ⊕ s (cid:22) s ⊕ s for all s , s , s ∈ Weights ; • for every vertex v ∈ V ( G ) and for every color i ∈ L v , a weight (or cost) w v,i ∈ Weights − {
Error } of assigning color i to vertex v ; • a function check that, given a vertex v ∈ V ( G ) and given a color assignment c : N G [ v ] → S u ∈ N G [ v ] L u such that c ( u ) ∈ L u for all u ∈ N [ v ], returns True ifthe vertex v together with its neighborhood (considering the labels of the edges uv with u ∈ N G ( v )) satisfies a certain condition, and False otherwise; and • a set of global properties Π.We say that an assignment of colors to vertices c is valid in V if c ( v ) ∈ L v forall v ∈ V , and it is proper if it is valid in V ( G ) and check ( v, c v ) is true for every v ∈ V ( G ), where c v is the function c restricted to the domain N G [ v ]. The weight of acolor assignment c : V → S v ∈ V L v valid in V is w ( c ) = L v ∈ V w v,c ( v ) .The main object of study in this paper is the following problem: HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 7
Generalized locally checkable (GLC) problem
Instance:
A simple undirected graph G , ℓ e for all e ∈ E ( G ), L v for all v ∈ V ( G ),( Weights , (cid:22) ) together with ⊕ , w v,i for all v ∈ V ( G ) and all i ∈ L v , check and Π. Question:
What is the minimum weight (according to the order (cid:22) ) of a properassignment of colors to vertices that satisfies the properties in Π?Many different optimization problems can be modeled as instances of the GLC prob-lem. Some decision problems can be modeled as well, using weights only to determineif the answer is “yes” or “no” (if the output is
Error then the answer is “no”, oth-erwise is “yes”). For the examples shown throughout this paper, we will assume that,otherwise stated, the definitions of L v are for all v ∈ V ( G ), of w v,i for all v ∈ V ( G )and all i ∈ L v , and of check ( v, c ) for all v ∈ V ( G ) and all color assignments c valid in N G [ v ]. Also, if the labels ℓ e are not specified, we can assume they are all equal to 1.For example, for list-coloring we can set: • L v is part of the input; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = 0 (notice that in this case we are not interested in the minimum weightbut only in the existence of such coloring); • check ( v, c ) = ( c ( v ) = c ( u ) ∀ u ∈ N G ( v )); and • Π = ∅ .We can also model the problem of deciding if G has a D q partition as an instance ofthe GLC problem in the following way: • L v = [[1 , q ]]; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = 0; • check ( v, c ) = V ≤ j ≤ q ( |{ u : u ∈ N ( v ) ∧ c ( u ) = j }| ∈ D q [ c ( v ) , j ]); and • Π = ∅ .Therefore, the GLC problem is indeed a generalization of LCVP problems. Further-more, it allows us to model more problems, like { k } –domination, for which we canset: • L v = [[1 , k ]]; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = i ; • check ( v, c ) = (cid:16) k ≤ P u ∈ N G [ v ] c ( u ) (cid:17) ; and • Π = ∅ .We give more examples in Section 7.Notice that we can model problems where the input graph is directed by consideringedge labels that also carry the direction of the edge, and the check function can use itto distinguish in-neighbors and out-neighbors.4. The GLC problem in complete graphs
It is easy to see that we can polynomially reduce NP-complete problems in graphsto the GLC problem in a complete graph, even when restricting the sets of colors andedge labels to { , } . Indeed, we can transform the classical domination problem in agraph G to the GLC problem in a complete graph in the following way. We construct F. BONOMO-BRABERMAN AND C.L. GONZALEZ a complete graph G ′ such that V ( G ′ ) = V ( G ) and ℓ uv = 1 if uv ∈ E ( G ) and ℓ uv = 0otherwise. Then, for the GLC problem we set • L v = { , } ; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = i ; • check ( v, c ) = (cid:16) c ( v ) + P u ∈ N G ′ ( v ) ( c ( u ) · ℓ vu ) ≥ (cid:17) ; and • Π = ∅ .It is clear that the minimum weight of a proper coloring in this instance equals γ ( G ),and this transformation can be performed in polynomial time.We can even find a polynomial-time reduction from the domination problem in agraph G to the GLC problem in a complete graph G ′ such that V ( G ′ ) = V ( G ) andwhere ℓ e = 1 for all e ∈ E ( G ′ ). Indeed, we can set • L v = {∅ , N G [ v ] } ; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v, ∅ = 0 and w v,N G [ v ] = 1; • check ( v, c ) = (cid:16) v ∈ S u ∈ N G ′ [ v ] c ( u ) (cid:17) ; and • Π = ∅ .However, the GLC problem in a complete graph G ′ is polynomial-time solvable when: • ℓ e = 1 for all e ∈ E ( G ′ ); • the number of all possible colors (that is, (cid:12)(cid:12)(cid:12)S v ∈ V ( G ′ ) L v (cid:12)(cid:12)(cid:12) ) is bounded by a con-stant; • check ( v, c ) can be computed in polynomial time and only depends on v , c ( v )and the number of neighbors of each color that v has (informally, check ( v, c )“does not care about” the names of the neighbors of v ); and • Π = ∅ .Let Colors = S v ∈ V ( G ′ ) L v , C = | Colors | and assume Colors = { c , . . . , c C } .Notice that since G ′ is a complete graph then N G ′ [ v ] = V ( G ′ ) for all v ∈ V ( G ′ ).Therefore, by the restrictions imposed to check , we can assume there exists a function check ′ such that check ′ ( v, c ( v ) , ( k , . . . , k C )) = check ( v, c ), where k i = |{ u ∈ V ( G ′ ) : c ( u ) = c i }| for all i ∈ [[1 , C ]].For every distribution of colors ( k , . . . , k C ), with k i ∈ N for all i ∈ [[1 , C ]] and suchthat P C i =1 k i = | V ( G ′ ) | , we need to verify if it can actually be achieved (that is, thereexists a proper color assignment c such that k i = |{ u ∈ V ( G ′ ) : c ( u ) = c i }| for all i ∈ [[1 , C ]]), and if so, find one such proper assignment of colors to vertices of minimumweight. To this end, we construct a directed capacitated network F with vertices i for all i ∈ Colors , ( v, i ) for all v ∈ V ( G ′ ) and all i ∈ L v , v for all v ∈ V ( G ′ ),and s and t . There is a directed edge of capacity k σ ( i ) and cost 0 from s to i for all i ∈ Colors . There is a directed edge of capacity 1 and cost 0 from i to ( v, i ) if k i ≥ check ′ ( v, i, ( k , . . . , k C )) is true. There is a directed edge of capacity 1 and cost w v,i from ( v, i ) to v for all v ∈ V ( G ′ ) , i ∈ L v . There is a directed edge of capacity 1and cost 0 from v to t for all v ∈ V ( G ′ ). There are no more edges than these ones.Note that the distribution ( k , . . . , k C ) is achievable if and only if the maximum flow in F is | V ( G ′ ) | , and in this case the proper assignment of colors to vertices of minimumweight corresponds to the maximum flow in F of minimum cost.Finally, the answer to the problem is obtained by finding the minimum proper colorassignment among the ones found for all achievable distributions of colors. HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 9
Since C is bounded by a constant, the number of distributions of colors is polynomialin | V ( G ′ ) | (because it is (cid:0) | V ( G ′ ) | + C− C− (cid:1) < ( | V ( G ′ ) | + 1) C ), check ′ ( v, i, ( k , . . . , k C )) can becomputed in polynomial time, constructing F takes polynomial time, and the problemof finding the maximum flow of minimum cost is polynomial-time solvable, then thisinstance of the GLC problem on a complete graph is polynomial-time solvable.5. The GLC problem with
Π = ∅ in bounded treewidth graphs We first give a polynomial-time algorithm to solve the GLC problem with Π = ∅ forbounded treewidth graphs. In Section 6 we will explain how to modify this algorithmin order to add some global properties.Assume we are given an easy tree decomposition ( T, { X t } t ∈ V ( T ) ) of the input graph G . We will solve the problem in a dynamic programming fashion and describe thealgorithm by explaining what happens in each type of node of the tree decomposition.For every node t of T , the algorithm computes a function λ t that receives a tuple( S, c, ω, η, ˇ c ) and returns an element of Weights , where • S ⊆ X t , • c is a color assignment valid in X t , • ω : X t → Weights , • η is a valid partial neighborhood mapping for c (to be defined in the followingsubsection), and • ˇ c is a function that given a vertex v ∈ X t returns a checking function for ( v, c ( v ))(to be defined in the following subsection).Throughout the following subsections, we will note ˇ c v instead of ˇ c ( v ) to make thenotation less cumbersome.5.1. Partial neighborhoods.
In order to define the parameters ˇ c and η , we first needthe following definitions and notation. Definition 5.1.1. A partial neighborhood system for an instance of the GLC problemconsists of: • A set N v,i , for every v ∈ V ( G ) and i ∈ L v , together with a closed binaryoperation ⊞ v,i on N v,i that is commutative and associative and has a neutralelement e v,i . • A function newN v,i , for every v ∈ V ( G ) and i ∈ L v , that given u ∈ N G ( v ) and j ∈ L u returns an element of N v,i (possibly making use of the label of the edge vu ). • A function check v,i : N v,i → Bool , for every v ∈ V ( G ) and i ∈ L v . Thisfunction must satisfy check v,c ( v ) (cid:16) ⊞ v,c ( v ) u ∈ N G ( v ) newN ( u, c ( u )) (cid:17) = check ( v, c ) forevery vertex v ∈ V ( G ) and every color assignment c valid in N G [ v ].Roughly speaking, a partial neighborhood system gives us tools to accumulate in-formation from the neighbors of a vertex v , for every vertex v and every color i ∈ L v .With newN v,i ( u, j ) we create new information, that says how u having color j affects v when having color i . The operation ⊞ v,i combines two pieces of information. For acolor assignment c valid in N G [ v ], check v,c ( v ) (cid:16) ⊞ v,c ( v ) u ∈ N G ( v ) newN ( u, c ( u )) (cid:17) simply verifiesa condition over all the information collected from the neighbors of v . Finally, werequire the equality check v,c ( v ) (cid:16) ⊞ v,c ( v ) u ∈ N G ( v ) newN ( u, c ( u )) (cid:17) = check ( v, c ) to make thesetools analogous to the use of check ( v, c ). We refer to the elements of N v,i as partialneighborhoods of vertex v with color i . Remark . For every instance of the GLC problem there exists a partial neigh-borhood system. Indeed, we will show one. The idea behind the following partialneighborhood system is to store all the colors assigned to the neighbors of v , where ⊥ represents that a neighbor has not yet been assigned a color, and × can be thought asan error sign.Let v ∈ V ( G ), i ∈ L v and assume N G ( v ) = { u , . . . , u d G ( v ) } . Let N v,i be the set ofall d G ( v )-tuples x such that x h ∈ L u h ∪ {⊥ , ×} for all h ∈ [[1 , d G ( v )]]. Let ⊞ v,i be suchthat ( n ⊞ v,i n ′ ) h = n h if n h = n ′ h or n ′ h = ⊥ n ′ h if n h = ⊥ and n ′ h = ⊥× otherwisefor all h ∈ [[1 , d G ( v )]]. Let newN v,i ( u h , j ) be the d G ( v )-tuple that has j in its position h and ⊥ in all its other positions. Let x ∈ N v,i . If x = ( j , . . . , j d G ( v ) ) with j h ∈ L u h for all h ∈ [[1 , d G ( v )]], let c be the color assignment in N G [ v ] such that c ( v ) = i and c ( u h ) = j h for all h ∈ [[1 , d G ( v )]], and then define check v,i ( x ) = check ( v, c ). Otherwise,let check v,i ( x ) = False .Of course, finding partial neighborhood systems that have smaller sets N v,i is ofextreme importance because it reduces the time complexity of the algorithm given inSection 5.3. For a large number of problems, we can use a “bounded sum”, that is, N v,i = [[0 , k v,i ]] for some k v,i ∈ N and n ⊞ v,i n ′ = min( n + n ′ , k v,i ). For example, forthe { k } –domination problem we can set N v,i = [[0 , k ]], newN v,i ( u, j ) = j , n ⊞ v,i n ′ =min( n + n ′ , k ) and check v,i ( n ) = ( n + i ≥ k ), for all v ∈ V ( G ), i ∈ L v and n, n ′ ∈ N v,i .Another key concept is the following. Let X ⊆ V ( G ) and c be a color assignmentvalid in X . Given a partial neighborhood system, a valid partial neighborhood mappingfor c is a function η of domain X such that η ( v ) ∈ N v,c ( v ) for all v ∈ X .Finally, given v ∈ V ( G ) and i ∈ L v , any function f : N v,i → Bool is called a checking function for ( v, i ).5.2. Notation and definitions.
The following definitions and notation will be usefulthroughout the rest of the article. • Extension of a function.
Let f : X → Y and x / ∈ X . Then the function f x → y : X ∪ { x } → Y ∪ { y } is such that f x → y ( x ) = y and f x → y ( z ) = f ( z ) for all z ∈ X . • Restriction of a function.
Let f : X → Y and x ∈ X . Then the function f − x : X − { x } → Y is such that f − x ( z ) = f ( z ) for all z ∈ X − { x } . • Graph with removed edges.
Let H be a graph. Then H ¬ S is the graphsuch that V ( H ¬ S ) = V ( H ) and E ( H ¬ S ) = E ( H ) − { uv : u, v ∈ S } . • Neutral weight mapping.
Let X ⊆ V ( G ). Then the function ω eX : X → Weights is such that ω eX ( v ) = e ⊕ for all v ∈ X . • Equality checking function.
For every v ∈ V ( G ), every i ∈ L v and every n ∈ N v,i , let eq n : N v,i → Bool be the function such that eq n ( n ′ ) = ( n = n ′ )for all n ′ ∈ N v,i . • Function of equality checking functions.
Let X ⊆ V ( G ), c be a colorassignment valid in X and η be a valid partial neighborhood mapping for c .Then let ˇ c η be the function of domain X such that ˇ c ηv is eq η ( v ) for all v ∈ X . • Reduction of a partial neighborhood mapping.
Let X ⊆ V ( G ), c bea color assignment valid in X , η be a valid partial neighborhood mappingfor c and v ∈ X . Then the function η ∼ v of domain X − { v } is such that HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 11 η ∼ v ( u ) = η ( u ) ⊞ u,c ( u ) newN ( v, c ( v )) if u ∈ X ∩ N G ( v ) and η ∼ v ( u ) = η ( u )otherwise. • Neutral partial neighborhood mapping.
Let X ⊆ V ( G ) and c be a colorassignment valid in X . Then the function η ec of domain X is such that η ec ( v ) = e v,c ( v ) for all v ∈ X . Observe that η ec is a valid partial neighborhood mappingfor c . • Partial neighborhood in a subgraph.
Let H be a subgraph of G and c bea color assignment valid in V ( H ). Then we define ns such that ns ( v, c, H ) = ⊞ v,c ( v ) u ∈ N H ( v ) newN v,c ( v ) ( u, c ( u )) for all v ∈ V ( H ). Roughly speaking, ns ( v, c, H )is the information we can obtain from the neighbors of v in H and the colorassignment c .5.3. Algorithm.
Now we will merely describe the algorithm, whose proof and timecomplexity are given in the following subsections.Let G be the input graph and let ( T, { X t } t ∈ V ( T ) ) be an easy tree decomposition of G . Assume we are given a partial neighborhood system.For every node t , we define a function λ t : D t → Weights , where D t is the set of alltuples ( S, c, ω, η, ˇ c ) such that • S ⊆ X t , • c is a color assignment valid in X t , • ω : X t → Weights is such that ω ( v ) ∈ { e ⊕ , w v,c ( v ) } for all v ∈ X t , • η is a valid partial neighborhood mapping for c , and • ˇ c is such that ˇ c v ∈ { check v,c ( c ) } ∪ { eq n : n ∈ N v,c ( v ) } for all v ∈ X t ,and its definition is as follows. • Leaf node.
Suppose t is a leaf node and X t = { v } . Then λ t ( S, c, ω, η, ˇ c ) = (cid:26) ω ( v ) if ˇ c v ( η ( v )) Error otherwise • Forget node.
Suppose t is a forget node, s is the child of t and X s − X t = { v } .Then λ t ( S, c, ω, η, ˇ c ) = min i ∈ L v { λ s ( S, c v → i , ω v → w v,i , η v → e v,i , ˇ c v → check v,i ) } . • Introduce node.
Suppose t is an introduce node, s is the child of t and X t − X s = { v } . Let n v = η ( v ) ⊞ v,c ( v ) ns ( v, c, G t ¬ S [ X t ]). Then λ t ( S, c, ω, η, ˇ c ) = (cid:26) ω ( v ) ⊕ λ s ( S − { v } , c − v , ω − v , η ∼ v , ˇ c − v ) if ˇ c v ( n v ) Error otherwise • Join node.
Suppose t is a join node and r, s are the children of t .We say that a pair ( η r , η s ) of valid partial neighborhood mappings for c is good ifˇ c v ( η ( v ) ⊞ v,c ( v ) ns ( v, c, G t ¬ S [ X t ]) ⊞ v,c ( v ) η r ( v ) ⊞ v,c ( v ) η s ( v )) is true for all v ∈ X t . Let W = L v ∈ X t ω ( v ). Then λ t ( S, c, ω, η, ˇ c ) = min ( η r ,η s ) is good { W ⊕ λ r ( X r , c, ω eX r , η ec , ˇ c η r ) ⊕ λ s ( X s , c, ω eX s , η ec , ˇ c η s ) } . The algorithm is executed in a bottom-up fashion (that is, first for all the leaf nodes,then for their parents, and so on) by computing λ t ( S, c, ω, η, ˇ c ) ∈ Weights for everynode t and every ( S, c, ω, η, ˇ c ) ∈ D t . Finally, the result is obtained by finding theminimum among all λ r ( ∅ , c, ω, η ec , ˇ c ) such that r is the root of T , c is a color assignmentvalid in X r , ω : X r → Weights is such that ω ( v ) = w v,c ( v ) for all v ∈ X r , andˇ c v = check v,c ( v ) for all v ∈ X r . Correctness.
We will prove that the above algorithm is correct.Consider an instance of the GLC problem with a partial neighborhood system, whoseinput graph is G . Definition 5.4.1.
For every X ⊆ V ( G ), every G ′ subgraph of G such that X ⊆ V ( G ′ )and N G [ V ( G ′ ) − X ] ⊆ V ( G ′ ), every color assignment c valid in X , every η that is a validpartial neighborhood mapping for c , and every ˇ c such that ˇ c v ∈ { check v,c ( v ) } ∪ { eq n : n ∈ N v,c ( v ) } for all v ∈ X , we say that a function f is a ( X, c, η, ˇ c ) –coloring in G ′ if • f is a color assignment valid in V ( G ′ ), • f ( v ) = c ( v ) for all v ∈ X , • ˇ c v (cid:0) η ( v ) ⊞ v,f ( v ) ns ( v, f, G ′ ) (cid:1) = True for all v ∈ X , and • check ( u, f u ) = True for all u ∈ V ( G ′ ) − X , where f u is the restriction of f to N G [ u ].For a ( X, c, η, ˇ c )–coloring f in G ′ and a function ω : X → Weights , we define the weight under ω of f as w ω ( f ) = (cid:0)L v ∈ X ω ( v ) (cid:1) ⊕ (cid:16)L v ∈ V ( G ′ ) − X w v,f ( v ) (cid:17) . Lemma 5.4.2.
Let G be a graph with an easy tree decomposition ( T, { X i } i ∈ V ( T ) ) . Let t ∈ V ( T ) . For every ( S, c, ω, η, ˇ c ) ∈ D t we have λ t ( S, c, ω, η, ˇ c ) = min { w ω ( f ) : f is a ( X t , c, η, ˇ c ) –coloring in G t ¬ S } . Proof.
First of all, notice that if there are no ( X t , c, η, ˇ c )–colorings in G t ¬ S then wehave min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } = Error .We will proceed by induction on t . Let ( S, c, ω, η, ˇ c ) ∈ D t . The base case is when t is a leaf node. • Leaf node.
Suppose t is a leaf node and X t = { v } . Notice that in this case V ( G t ¬ S ) = { v } = X t .If ˇ c v ( η ( v )) = False then λ t ( S, c, ω, η, ˇ c ) = Error . Moreover, by definition, thereare no ( X t , c, η, ˇ c )–colorings in G t ¬ S , leading to the desired equality.If ˇ c v ( η ( v )) = True then, by definition, c is the only possible ( X t , c, η, ˇ c )–coloringin G t ¬ S . Therefore,min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } = w ω ( c ) = ω ( v ) = λ t ( S, c, ω, η, ˇ c ) . Now assume that t is not a leaf node and that the statement is true for every child s of t in T . We will analyze the three remaining cases for t . • Forget node.
Suppose t is a forget node, s is the child of t and X s − X t = { v } .Notice that v / ∈ S and also G t ¬ S = G s ¬ S .By definition of λ t and the induction hypothesis we have λ t ( S, c, ω, η, ˇ c )= min i ∈ L v { λ s ( S, c v → i , ω v → w v,i , η v → e v,i , ˇ c v → check v,i ) } = min i ∈ L v { min { w ω v → w v,i ( f ) : f is a ( X s , c v → i , η v → e v,i , ˇ c v → check v,i )–coloring in G s ¬ S }} = min { w ω v → w v,i ( f ) : i ∈ L v ∧ f is a ( X s , c v → i , η v → e v,i , ˇ c v → check v,i )–coloring in G s ¬ S } . Let i ∈ L v . We claim that every f that is a ( X s , c v → i , η v → e v,i , ˇ c v → check v,i )–coloring in G s ¬ S is also a ( X t , c, η, ˇ c )–coloring in G t ¬ S . Conversely, every f that is a ( X t , c, η, ˇ c )–coloring in G t ¬ S is also a ( X s , c v → f ( v ) , η v → e v,f ( v ) , ˇ c v → check v,f ( v ) )–coloring in G s ¬ S . Weprove the first claim (the second one is similar) by showing each of the items of thedefinition of ( X t , c, η, ˇ c )–coloring in G t ¬ S holds: HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 13 • f ( w ) = c ( w ) for all w ∈ X t (because it is true for all w ∈ X s ), • f is a color assignment valid in V ( G s ¬ S ) = V ( G t ¬ S ), • check ( u, f ) = True for all u ∈ V ( G s ¬ S ) − X s = V ( G t ¬ S ) − X t − { v } and check ( v, f ) = check v,i (cid:0) ns ( v, f, G s ¬ S ) (cid:1) = check v,i (cid:0) e v,i ⊞ v,i ns ( v, f, G s ¬ S ) (cid:1) = ˇ c v → check v,i v (cid:0) η ( v ) ⊞ v,i ns ( v, f, G s ¬ S ) (cid:1) = True (because f ( v ) = i ), and • ˇ c w (cid:0) η ( w ) ⊞ w,f ( w ) ns ( w, f, G t ¬ S ) (cid:1) = True for all w ∈ X t (because it is true forall w ∈ X s and E ( G t ¬ S ) = E ( G s ¬ S )).Clearly, w ω v → w v,f ( v ) ( f ) = w ω ( f ) for every f that is a ( X t , c, η, ˇ c )–coloring in G t ¬ S .Thereforemin { w ω v → w v,i ( f ) : i ∈ L v ∧ f is a ( X s , c v → i , η v → e v,i , ˇ c v → check v,i )–coloring in G s ¬ S } = min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } as we wanted. • Introduce node.
Suppose t is an introduce node, s is the child of t and X t − X s = { v } . First of all, observe that v / ∈ V ( G s ¬ ( S −{ v } ) ) and N G t ¬ S [ v ] ⊆ X t (because( T, { X i } i ∈ V ( T ) ) is a tree-decomposition), and that this implies that ns ( v, c, G t ¬ S ) = ns ( v, c, G t ¬ S [ X t ]).If ˇ c v ( η ( v ) ⊞ v,c ( v ) ns ( v, c, G t ¬ S [ X t ])) = False then there are no ( X t , c, η, ˇ c )–coloringsin G t ¬ S (by Definition 5.4.1) and we also have λ t ( S, c, ω, η, ˇ c ) = Error (by definitionof λ t ).Now assume that ˇ c v ( η ( v ) ⊞ v,c ( v ) ns ( v, c, G t ¬ S [ X t ])) = True . It is straightforwardto prove that if a function f is a ( X s , c − v , η ∼ v , ˇ c − v )–coloring in G s ¬ ( S −{ v } ) then thefunction f v → c ( v ) is a ( X t , c, η, ˇ c )–coloring in G t ¬ S and w ω ( f v → c ( v ) ) = ω ( v ) ⊕ w ω − v ( f ).Furthermore, it is also straightforward to prove that for every ( X t , c, η, ˇ c )–coloring g in G t ¬ S , the function g − v is a ( X s , c − v , η ∼ v , ˇ c − v )–coloring in G s ¬ ( S −{ v } ) and ω ( v ) ⊕ w ω − v ( g − v ) = w ω ( g ). Thereforemin { w ω ( g ) : g is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } = min { ω ( v ) ⊕ w ω − v ( f ) : f is a ( X s , c − v , η ∼ v , ˇ c − v )–coloring in G s ¬ ( S −{ v } ) } = ω ( v ) ⊕ min { w ω − v ( f ) : f is a ( X s , c − v , η ∼ v , ˇ c − v )–coloring in G s ¬ ( S −{ v } ) } = ω ( v ) ⊕ λ s ( S − { v } , c − v , ω − v , η ∼ v , ˇ c − v )= λ t ( S, c, ω, η, ˇ c ) . • Join node.
Suppose t is a join node and r, s are the children of t . Recall that X t = X r = X s .For every color assignment f valid in V ( G t ¬ S ), denote by f | r (resp. f | s ) therestriction of f to V ( G r ¬ X r ) (resp. V ( G s ¬ X s )). Let W = L v ∈ X t ω ( v ). Notice that w ω ( f ) = W ⊕ w ω eXr ( f | r ) ⊕ w ω eXs ( f | s ) for every color assignment f valid in V ( G t ¬ S ).Suppose there exists a ( X t , c, η, ˇ c )–coloring in G t ¬ S and let f be one of them.Let η r and η s be functions of domain X t such that η r ( v ) = ns ( v, f, G r ¬ X r ) and η s ( v ) = ns ( v, f, G s ¬ X s ) for all v ∈ X t .Since V ( G r ¬ X r ) ∩ V ( G s ¬ X s ) = X t then V ( G r ¬ X r ) ∩ V ( G s ¬ X s ) ∩ N G ¬ Xt ( v ) = ∅ .Moreover, since f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S then we know that, for all v ∈ X t , ns ( v, c, G t ¬ S [ X t ]) ⊞ v,c ( v ) η r ( v ) ⊞ v,c ( v ) η s ( v ) = ns ( v, f, G t ¬ S ) and thus ˇ c v ( η ( v ) ⊞ v,c ( v ) ns ( v, c, G t ¬ S [ X t ]) ⊞ v,c ( v ) η r ( v ) ⊞ v,c ( v ) η s ( v )) = True . Therefore, the functions η r and η s form a good pair of valid partial neighborhood mappings for c .It is straightforward to prove that f | r is a ( X r , c, η ec , ˇ c η r )–coloring in G r ¬ X r , andthat f | s is a ( X s , c, η ec , ˇ c η s )–coloring in G s ¬ X s . Hence, w ω ( f ) = W ⊕ w ω eXr ( f | r ) ⊕ w ω eXs ( f | s ) ≥ W ⊕ λ r ( X r , c, ω eX r , η ec , ˇ c η r ) ⊕ λ s ( X s , c, ω eX s , η ec , ˇ c η s ) ≥ λ t ( S, c, ω, η, ˇ c ) . Since min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } = Error if there are no( X t , c, η, ˇ c )–colorings in G t ¬ S , we obtainmin { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } ≥ λ t ( S, c, ω, η, ˇ c ) . To conclude, we will show that the other inequality holds.If λ t ( S, c, ω, η, ˇ c ) = Error then the statement trivially holds. Otherwise, by defini-tion of λ t , the minimum is realized by a good pair ( b η r , b η s ), and λ r ( X r , c, ω eX r , η ec , ˇ c b η r ) = Error and λ s ( X s , c, ω eX s , η ec , ˇ c b η s ) = Error . Therefore there exists a ( X r , c, η ec , ˇ c b η r )–coloring b f r in G r ¬ X r and a ( X s , c, η ec , ˇ c b η s )–coloring b f s in G s ¬ X s such that w ω eXr ( b f r ) = λ r ( X r , c, ω eX r , η ec , ˇ c b η r ) and w ω eXs ( b f s ) = λ s ( X s , c, ω eX s , η ec , ˇ c b η s ).Let b f be a function of domain V ( G t ¬ S ) such that • b f ( v ) = c ( v ) for all v ∈ X t , • b f ( v ) = b f r ( v ) for all v ∈ V ( G r ¬ X r ) − X r , and • b f ( v ) = b f s ( v ) for all v ∈ V ( G s ¬ X s ) − X s .It is straightforward to prove that b f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S , and also that b f r (resp. b f s ) is the restriction of b f to V ( G r ¬ X r ) (resp. V ( G s ¬ X s )). Therefore, λ t ( S, c, ω, η, ˇ c ) = W ⊕ λ r ( X r , c, ω eX r , η ec , ˇ c b η r ) ⊕ λ s ( X s , c, ω eX s , η ec , ˇ c b η s )= W ⊕ w ω eXr ( b f r ) ⊕ w ω eXs ( b f s )= w ω ( b f ) ≥ min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } . Consequently, λ t ( S, c, ω, η, ˇ c ) = min { w ω ( f ) : f is a ( X t , c, η, ˇ c )–coloring in G t ¬ S } .As a result, the statement holds. (cid:3) Now the following result is immediate.
Corollary 5.4.3. If r is the root of T then the minimum weight of a proper coloringfor this instance of the GLC problem is min { λ r ( ∅ , c, ω, η ec , ˇ c ) : ( ∅ , c, ω, η ec , ˇ c ) ∈ D r , and ω ( v ) = w v,c ( v ) and ˇ c v = check v,c ( v ) for all v ∈ X r } . Time complexity.
Now that we know that the algorithm is correct, we focus onits time complexity.Let k = max {| X t | : t ∈ V ( T ) } , N = max {|N v,i | : v ∈ V ( G ) , i ∈ L v } and C =max {| L v | : v ∈ V ( G ) } . Let t ˇ c , t ⊞ , t newN , t ⊕ , and t min be upper bounds for the executingtime of all the functions check v,i and eq n , ⊞ v,i , newN v,i , ⊕ , and min, respectively. Otheroperations are assumed to run in constant time. In particular, we are assuming that HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 15 we access w v,i in O (1)-time (because it either is part of the input or can be computedin O (1)).Traversing the tree T requires O ( | V ( T ) | ) time. In O ( k | V ( T ) | + k | E ( G ) | ) time we canconstruct the adjacency matrices of all the graphs G [ X t ] with t ∈ V ( T ) (by traversing T top-down and computing N G t ( v ) ∩ X t only for nodes t that are the child of a forgetnodes s with X t − X s = { v } ). Also, in O ( k ) time we can construct each of the necessaryfunction extensions and restrictions, and in O (( t ⊞ + t newN ) k ) we can construct each ofthe necessary η ∼ v .We analyze four separate cases, and the proof in each one of them is straightforward. • Leaf node: O ( t ˇ c ) • Forget node: O ( k + ( k + t min ) C ) • Introduce node: O (( t ⊞ + t newN ) k + t ˇ c + t ⊕ + k ) • Join node: O (( t ⊞ + t newN ) k + t ⊕ k + (( t ⊞ + t ˇ c ) k + t ⊕ + t min ) N k )Each one of them is computed for every possible tuple ( S, c, ω, η, ˇ c ). We know thatthere are no more than 2 k · C k · k · N k · (1 + N ) k of such tuples, and that constructingeach of them requires O ( k ) operations.In summary, the time complexity of this algorithm is O (( t ⊕ k + ( k + t min ) C + ( t ⊞ + t newN ) k + (( t ⊞ + t ˇ c ) k + t ⊕ + t min ) N k )4 k C k N k ( N + 1) k k | V ( T ) | + k | E ( G ) | ).5.6. Special instances.
Since for a graph of treewidth upper bounded by a constant q we can construct an easy tree-decomposition of width k ≤ q + 4 with O ( | V ( G ) | )nodes in O ( | V ( G ) | ) time, the next result easily follows. Theorem 5.6.1.
Let F be a family of graphs of bounded treewidth. Consider a familyof instances of the GLC problem with Π = ∅ and a partial neighborhood system, where • G ∈ F , • C = max {| L v | : v ∈ V ( G ) } and N = max {|N v,i | : v ∈ V ( G ) , i ∈ L v } arepolynomial in | V ( G ) | , and • all the functions check v,i , eq n , ⊞ v,i , newN v,i , ⊕ and min can be computed inpolynomial time.Then there exists an algorithm that solves these instances in polynomial time. Fur-thermore, if C and N are bounded by a constant, and all the mentioned functions canbe computed in constant time, then the time complexity of such algorithm is O ( | V ( G ) | ) . In particular, there are some instances of the GLC problem for which we can give“good” partial neighborhood systems.
Corollary 5.6.2.
Let F be a family of graphs of bounded treewidth. Consider a familyof instances of the GLC problem with Π = ∅ and where • G ∈ F , • | S v ∈ V ( G ) L v | is bounded by a constant, • ⊕ and min can be computed in polynomial time, and • check ( v, c ) can be computed in polynomial time and only depends on v , c ( v ) andthe number of neighbors of each color that v has.Then such instances of the GLC problem can be solved in polynomial time.Proof. For each instance, let
Colors = S v ∈ V ( G ) L v and define the following partialneighborhood system: • N v,i = [[0 , d G ( v )]] | Colors | ; • ( n ⊞ v,i n ′ ) j = min( n j + n ′ j , d G ( v )) for all j ∈ Colors ; • newN v,i ( u, j ) h = 0 for all h ∈ Colors − { j } and newN v,i ( u, j ) j = 1; • check v,i ( n ) = check ( v, c ) where c is any color assignment valid in N G [ v ] suchthat c ( v ) = i and |{ u : u ∈ N G ( v ) ∧ c ( u ) = j }| = n j for all j ∈ Colors . Notethat we can construct c in polynomial time using flow algorithms.By Theorem 5.6.1, the statement holds. (cid:3) Dealing with global properties in bounded treewidth graphs
In this section we explain how to modify the previous algorithm in order to handlesome cases of Π = ∅ . The general idea in all of these cases is to modify λ t in theoriginal algorithm extending it with new parameters. Thus, at each node t we compute λ t ( S, c, ω, η, ˇ c, . . . ).For simplicity, in the following subsections we omit some parts of the original algo-rithm, writing only the necessary changes.6.1. The size of a color class is an element of a particular set.
Suppose wewant the class of color j to have a size that is an element of a set σ ⊆ N .Consider a deterministic finite-state automaton ( Q, { } , δ, q , F ) that accepts a stringof n consecutive characters 1 if and only if n ∈ σ . Notice that for all finite sets σ ⊆ N there exists such an automaton. Indeed, let m be the maximum element of σ , Q = { s , . . . , s m +1 } , q = s , F = { s i : i ∈ σ } , and δ ( s i ,
1) = s i +1 for all 0 ≤ i ≤ m and δ ( s m +1 ,
1) = s m +1 . Although, for time complexity issues, when m is not a constant wemight be interested in another automata, with O (1) number of states (for example, if σ is the set of odd numbers in [[0 , | V ( G ) | ]], we only need two states).In the algorithm, at each node t , we add a parameter state j that stores the state ofthe partial size of the color class j , and also a parameter accept j that checks if we arein the desired state, and then proceed in the following way. • Leaf node:
Now we also need to check if accept j ( state j ) is true. • Forget node:
For all i ∈ L v , let state ij = state j if i = j and state ij = δ ( state j , λ t ( . . . , state j , accept j ) = min { λ s ( . . . , state ij , accept j ) : i ∈ L v } . • Introduce node:
Remains the same (with state j and accept j added to λ s ). • Join node:
For all q ∈ Q , let eq q : Q → Bool be such that eq q ( q ′ ) = ( q = q ′ ) for all q ′ ∈ Q . Then λ t ( . . . , state j , accept j ) = min { W ⊕ λ r ( . . . , state j , eq q ) ⊕ λ s ( . . . , q, accept j ) : q ∈ Q ∧ . . . } . At the root r where X r = { v } , we compute all λ r ( . . . , a, s r ), with a such that a ( s ) = ( s ∈ F ), and s r = q if c ( v ) = j and s r = δ ( q ,
1) otherwise.Note that it is easy to generalize this idea to more classes by simply adding as many state j and accept j as needed (each of them with its own automaton), and even to a set J of classes by replacing statements of the form “ i = j ” with “ i / ∈ J ”.The time complexity now depends on the number of states and color classes torestrict. We can assume that checking if a state is an accepting one is a O (1) operationand so is computing δ ( s, R be the number of color classes (or sets of colorclasses) to restrict and let S be the size of the largest set of states among all consideredautomata. The only changes in complexity are: • Leaf node: add R . • Forget node: add 2 RC . • Introduce node: add 2 R . HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 17 • Join node: multiply by S R . • When we multiply by the number of all possible combinations of the parametersof λ t : add a factor ( S ( S + 1)) R .In particular, the complexity of the algorithm remains polynomial in | V ( G ) | if R isbounded by a constant, allowing us to, for example, ask for a color class to be non-empty or to have at most one element.6.2. One color class is connected.
Suppose we want the class of color j to beconnected.At each node t , we add the parameter comp j : X t → [[1 , k ]] that maps vertices ofcolor j to natural numbers that represent connected components.For the following items, let X jt = { u : u ∈ X j ∧ c ( u ) = j } and N jt ( v ) = N G ( v ) ∩ X jt . • Leaf node:
Remains the same. • Forget node: λ t ( . . . , comp j ) = min { λ s ( . . . , comp ij ) : i ∈ L v } where comp ij is suchthat: • if i = j then comp ij ( u ) = comp j ( u ) for all u ∈ X jt , and • comp jj ( v ) = ( min u ∈ N jt ( v ) { comp j ( u ) } if N jt ( v ) = ∅ any value in [[1 , k ]] − { comp j ( u ) : u ∈ X jt } otherwiseand, for all u ∈ X jt , comp jj ( u ) = comp jj ( v ) if there exists z ∈ N jt ( v ) such that comp j ( u ) = comp j ( z ), and comp jj ( u ) = comp j ( u ) otherwise.The idea behind this is that if v is a neighbor of two or more vertices of differentconnected components, then those connected components can be unified, and if v isnot a neighbor of any other vertex of color j then it is in a new connected component. • Introduce node: If c ( v ) = j then it remains the same (adding comp j to λ s ).Otherwise, we split the case related to ˇ c v ( n v ) = True in the following: • If there exists u ∈ X js such that comp j ( v ) = comp j ( u ) then λ t ( . . . , comp j ) = . . . λ s ( . . . , comp − vj ). • If there does not exist u ∈ X js such that comp j ( v ) = comp j ( u ), and X js = ∅ then λ t ( . . . , comp j ) = Error . • If X js = ∅ then let M = ( { q , q } , { } , δ, q , { q } ) be an automaton such that δ ( q ,
1) = q and δ ( q ,
1) = q . We use M to request that the class of color j isempty in G s , therefore λ t ( . . . , comp j ) = . . . λ s ( . . . , q , eq q ).The idea is that if v belongs to a different connected component than all the verticesof color j in X s , then there is no way to connect v with them and we get an error.Also, if there are no vertices of color j in X s then there cannot be any vertices ofcolor j in G s , because N G ( V ( G ) − V ( G s )) ∩ V ( G s ) ⊆ X s . • Join node:
For every S ⊆ { comp j ( v ) : v ∈ X jt } let comp Sj be a function such that,for all v ∈ X jt , comp sj ( v ) = ( min( S ) if comp j ( v ) ∈ Scomp j ( v ) otherwise.Here we need to unify the different connected components, and one branch takescare of unifying a set S of them while the other branch unifies a set R of them, suchthat S ∪ R = { comp j ( v ) : v ∈ X jt } and | S ∩ R | = 1. Then λ t ( . . . , comp j ) = min { W ⊕ λ r ( . . . , comp Sj ) ⊕ λ s ( . . . , comp Rj ) : S ∪ R = { comp j ( v ) : v ∈ X jt } ∧ | S ∩ R | = 1 ∧ . . . } .At the root r where X r = { v } , the function comp j is such that comp j ( v ) = 1.As before, notice that it is easy to generalize this idea to more classes or sets ofclasses by adding as many comp j functions as needed. Let J be the number of color classes (or sets of color classes) to restrict. The onlychanges in complexity are: • Leaf node: add J . • Forget node: add (
C − k ) J . • Introduce node: add k J . • Join node: multiply by ( k k ) J . • When we multiply by the number of all possible combinations of the parametersof λ t : add a factor ( k k ) J .Note that because in the introduce node we require that the class of color j is empty,we also need to compute λ t ( . . . , q , eq q ) for all t ∈ T , but this addition does not changethe time complexity here (due to the fact that both S and R are bounded by a constantin this case).6.3. One color class is acyclic. (For undirected graphs.)It can be done in essentially the same way as for the connected property. The onlydifference is that in the introduce node we do as in the original algorithm, and in theforget node we check if v is a neighbor of at least two vertices that belong to the samecomponent (in which case there is a cycle and we raise an error).7. Classical problems as instances of the GLC problem in boundedtreewidth graphs
In this section we show how to model different problems as instances of the GLCproblem with a partial neighborhood system. As a result, we obtain polynomial-timealgorithms to solve these problems for bounded treewidth graphs or bounded treewidthand bounded degree graphs. For problems in Subsection 7.1, no such algorithms werepreviously known (until the date and to the best of our knowledge).In Subsection 7.2 we study other problems that were already known to be polynomial-time solvable for the before-mentioned classes. It is worth to mention how to restatethese problems as instances of the GLC problem, even when the time complexity of theproposed solution is worse than the best one known, because problems modeled thisway can be easily modified or combined, adding global properties or more restrictions,or even dealing with some distance versions. On the other hand, they can inspire thestatement of other problems as instances of the GLC problem.Throughout this section, we will assume that, otherwise stated, the definitions of N v,i are for all v ∈ V ( G ) and i ∈ L v , of n ⊞ v,i n ′ for all v ∈ V ( G ), i ∈ L v and n, n ′ ∈ N v,i ,of newN v,i ( u, j ) for all v ∈ V ( G ), i ∈ L v , u ∈ N G ( v ) and j ∈ L u , and of check v,i ( n ) forall v ∈ V ( G ), i ∈ L v and n ∈ N v,i .7.1. New results.
Double Roman domination.
This problem was first defined in [6] and proved tobe NP-complete for bipartite and chordal graphs in [2].A double Roman dominating function on a graph G is a function f : V ( G ) →{ , , , } having the property that if f ( v ) = 0, then vertex v must have at leasttwo neighbors assigned 2 under f or one neighbor w with f ( w ) = 3, and if f ( v ) = 1,then vertex v must have at least one neighbor w with f ( w ) ≥
2. The weight of a doubleRoman dominating function f is the sum f ( V ( G )) = P v ∈ V ( G ) f ( v ), and the minimumweight of a double Roman dominating function on G is the double Roman dominationnumber of G . HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 19
We can model the Double Roman domination problem as an instance of the GLCproblem with a partial neighborhood system in the following way: • L v = { , , , } ; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = i ; • check ( v, c ) = ( c ( v ) = 0 ⇒ ( ∃ u, w ∈ N G ( v ) / u = w ∧ c ( u ) = c ( w ) = 2) ∨ ( ∃ u ∈ N G ( v ) / c ( u ) = 3)) ∧ ( c ( v ) = 1 ⇒ ∃ u ∈ N G ( v ) / c ( u ) ≥ • Π = ∅ ; • N v,i = { , , } × { , } ; • ( n , n ) ⊞ v,i ( n ′ , n ′ ) = (min( n + n ′ , , min( n + n ′ , • newN v,i ( u, j ) = (0 ,
0) if j ≤ ,
0) if j = 2(0 ,
1) if j = 3; • check v,i ( n , n ) = ( i = 0 ⇒ n ≥ ∨ n ≥ ∧ ( i = 1 ⇒ n + n ≥ C and N are bounded by a constant, the time complexity in this case is O ( | V ( G ) | ) for a graph G in a family of graphs of bounded treewidth.7.1.2. b-coloring problem. In [47], this problem was defined and proved to be NP-complete for general graphs.Given a graph G and a positive integer k , the b-coloring problem asks if there exista proper k –coloring of the vertices of G such that every color class contains a vertexthat has neighbors in all the other color classes.We restate the problem in such a way that now we consider 2 k colors: the ones greaterthan k represent the “b-vertices”, that are requested to have a closed neighborhoodincluding colors i or i + k for every 1 ≤ i ≤ k . Then we can model the b-coloringproblem as an instance of the GLC problem with a partial neighborhood system in thefollowing way: • L v = [[1 , k ]]; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = 0 (actually, we do not care about weights in this case); • check ( v, c ) = (cid:0) c ( v ) ≤ k ⇒ V u ∈ N G ( v ) ( c ( u ) = c ( v ) ∧ c ( u ) = c ( v ) + k ) (cid:1) ∧ (cid:0) c ( v ) > k ⇒ V u ∈ N G ( v ) ( c ( u ) = c ( v ) ∧ c ( u ) = c ( v ) − k ) ∧ V ki =1 ( ∃ u ∈ N G [ v ] / c ( u ) = i ∨ c ( u ) = i + k ) (cid:1) ; • (Π) for every i ∈ [[1 , k ]], the set of vertices with color i + k has at least 1 element; • N v,i = 2 L v ; • n ⊞ v,i n ′ = n ∪ n ′ ; • newN v,i ( u, j ) = { j } ; • check v,i ( n ) = ( i ≤ k ⇒ i / ∈ n ∧ i + k / ∈ n ) ∧ ( i > k ⇒ i / ∈ n ∧ i − k / ∈ n ∧ V kj =1 ( j + k = i ⇒ j ∈ n ∨ j + k ∈ n )) . For a graph G in a family of graphs of bounded treewidth, the time complexity is O ( k c c k | V ( G ) | ) for some constants c , c . Since k is at most ∆( G ) + 1, then when ∆( G )is bounded by a constant or O (log | V ( G ) | ) we can solve this problem in polynomialtime on | V ( G ) | .7.1.3. Minimum chromatic violation problem.
This NP-hard problem was first definedin [9] as a generalization of the k -coloring problem.Given a graph G , a set of weak edges F ⊆ E ( G ) and a positive integer k , the mini-mum chromatic violation problem asks for a k –coloring of the graph G ′ = ( V ( G ) , E ( G ) − F ) minimizing the number of weak edges with both endpoints receiving the same color.Let b G = ( V ( G ) ∪ E ( G ) , E ( b G )) be the graph obtained by subdividing the edges of G .Assume that there is an ordering of the vertices, and that edges are named as orderedpairs of its endpoints. Then we can set • L v = [[1 , k ]] for all v ∈ V ( G ), L uv = L u × L v for all uv ∈ E ( G ); • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,i = 0 for all v ∈ V ( G ) , i ∈ L v , w uv, ( i,i ) = 1 for all uv ∈ E ( G ) , i ∈ L u ∩ L v , w uv, ( i,j ) = 0 for all uv ∈ E ( G ) , i ∈ L u , j ∈ L v − { i } ; • check ( v, c ) = True for all v ∈ V ( G ), check ( uv, c ) = ( c ( uv ) = ( c ( u ) , c ( v ))) for all uv ∈ F , and check ( uv, c ) = ( c ( uv ) = ( c ( u ) , c ( v )) ∧ c ( u ) = c ( v )) for all uv ∈ E ( G ) − F ; • Π = ∅ ; • N v,i = Bool for all v ∈ V ( b G ) , i ∈ L v ; • n ⊞ v,i n ′ = ( n ∧ n ′ ) for all v ∈ V ( b G ) , i ∈ L v and n, n ′ ∈ N v,i ; • newN v,i ( e, j ) = True for all v ∈ V ( G ) , i ∈ L v , e ∈ N b G ( v ) , j ∈ L e , newN uv, ( c u ,c v ) ( u, j ) = ( j = c u ) for all uv ∈ E ( G ) , c u ∈ L u , c v ∈ L v , j ∈ L u , newN uv, ( c u ,c v ) ( v, j ) = ( j = c v ) for all uv ∈ E ( G ) , c u ∈ L u , c v ∈ L v , j ∈ L v ; • check v,i ( n ) = True for all v ∈ V ( G ) , i ∈ L v , n ∈ N v,i , check uv, ( i,j ) ( n ) = n for all uv ∈ F, i ∈ L u , j ∈ L v , n ∈ N uv, ( i,j ) , check uv, ( i,j ) ( n ) = ( n ∧ i = j ) for all uv ∈ E ( G ) − F, i ∈ L u , j ∈ L v , n ∈ N uv, ( i,j ) .Basically, every edge in G is colored with a pair of colors and checks if these are thecolors of its endpoints. Edges in F are allowed to have endpoints of the same color,while edges not in F always produce an error when colored with a pair of equal colors.If an edge is colored with a pair of equal colors then its weight is 1, otherwise is 0.In this way we have C = k , N = 2 and all the t ’s bounded by a constant. Therefore,when k is bounded by a constant the problem can be solved in O ( | V ( G ) | ) time for agraph G in a family of graphs of bounded treewidth.7.1.4. Grundy domination number.
This problem was introduced in [11] and proved tobe NP-complete even for chordal graphs.A sequence S = ( v , . . . , v k ) of distinct vertices of a graph G is a dominating sequence if { v , . . . , v k } is a dominating set of G , and S is called a legal (dominating) sequence if(in addition) N [ v i ] − S i − j =1 N [ v j ] = ∅ for each i . We say that v i footprints the verticesin N [ v i ] − S i − j =1 N [ v j ], and that v i is the footprinter of every u ∈ N [ v i ] − S i − j =1 N [ v j ](notice that every vertex in V ( G ) has a unique footprinter). We are interested in themaximum length of a legal dominating sequence in G . HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 21
Given a legal sequence S , every vertex v ∈ V ( G ) can be associated with a pair( p v , f v ), where p v is the position of v in S (or ⊥ if v is not in S ) and f v is the positionin S of the footprinter of v .Directly from the definition of legal sequences we can deduce the following statement.A set { ( p v , f v ) : v ∈ V ( G ) } determines a legal sequence if and only if the followingconditions are satisfied: p v = p u for all u, v ∈ V ( G ) such that u = v and p u = ⊥ (i.e.,two vertices that appear in the sequence cannot have the same position in it), and also,for all v ∈ V ( G ), we have f v = min { p u : u ∈ N G [ v ] } (i.e., v is properly footprinted)and p v = ⊥⇒ ∃ u ∈ N G [ v ] / f u = p v (i.e., if v appears in the sequence then it footprintsat least one vertex).Let n = | V ( G ) | and ⊥ = n + 1. We can model the Grundy domination problem asan instance of the GLC problem with a partial neighborhood system as follows: • L v = { , . . . , n + 1 } × { , . . . , n } ; • ( Weights , (cid:22) ) = ( R ∪ {−∞} , ≥ ) and ⊕ = +; • for all f ∈ { , . . . , n } , w v, ( ⊥ ,f ) = 0 and w v, ( p,f ) = 1 for all p = ⊥ ; • check ( v, c ) = ( ∃ ! u ∈ N G [ v ] / c ( v ) = c ( u ) ) ∧ ( ∄ u ∈ N G [ v ] / c ( v ) > c ( u ) ) ∧ ( c ( v ) = ⊥⇒ ∃ u ∈ N G [ v ] / c ( v ) = c ( u ) ) ∧ ( c ( v ) = ⊥⇒ ∄ u ∈ N G ( v ) / c ( v ) = c ( u ) ); • Π = ∅ ; • N v, ( p,f ) = { , , } × { , } ; • ( η, φ ) ⊞ v, ( p,f ) ( η ′ , φ ′ ) = (min( η + η ′ , , min( φ + φ ′ , • newN v, ( p v ,f v ) ( u, ( p u , f u )) = (0 ,
0) if p u = p v = ⊥ (1 ,
0) if p u < p v and f v = p u (0 ,
0) if p u < p v and f v < p u (0 ,
1) if p u > p v and f u = p v (0 ,
0) if p u > p v and f u < p v (2 ,
0) otherwise; • check v, ( p,f ) ( η, φ ) = ( f = p ∧ η = 0) ∨ ( η = 1 ∧ ( p = ⊥⇒ φ = 1)).In this instance we want to maximize the number of vertices in the sequence, hencethe weights are defined as 1 for vertices that appear in the sequence and 0 otherwise. Wehave a function check that checks if a vertex v either footprints itself, or has a uniquefootprinter and if v is in the sequence then it footprints another vertex. The partialneighborhoods of each vertex v keep track of whether v was properly footprinted andwhether v has footprinted another vertex, and the function newN v, ( p v ,f v ) ( u, ( p u , f u ))tells us what happens when v “sees” a neighbor u considering the following cases: • If p u < p v and f v = p u then v found its footprinter. • If p u < p v and f v < p u then nothing happens. The vertex u cannot footprint v because there is another vertex before u that footprints v . • If p u < p v and f v > p u then there is an error because v cannot have a neighborthat appears before its footprinter in the sequence. • If p u = p v = ⊥ then there is an error because two vertices should not be in thesame position. • If p u = p v = ⊥ then nothing happens. • If p u > p v and f u = p v then v found a vertex to footprint. • If p u > p v and f u < p v then nothing happens. The vertex v cannot footprint u because there is another vertex before v that footprints u . • If p u > p v and f u > p v then there is an error because u cannot have a neighborthat appears before its footprinter in the sequence.Since we apply newN v, ( p v ,f v ) ( u, ( p u , f u )) to every ordered pair of neighbors ( v, u ) andthe check function checks if the vertex footprints itself, at some point we will knowif every vertex was properly footprinted and has properly footprinted itself or anothervertex.Notice that for this instance we actually do not require that, for every p such that1 ≤ p ≤ n , the set of vertices with a color in { ( p, f ) : 1 ≤ f ≤ n } has at most 1 element.Indeed, suppose that after running the algorithm there are two different vertices u, v such that p u = p v = ⊥ . Then we know that u / ∈ N G [ v ] (because, among all the calls to newN v, ( p v ,f v ) , we check that there is no neighbor w of v with p w = p v = ⊥ ), and that ifthere exists a vertex w such that f w > p v = p u then w / ∈ N G [ v ] and w / ∈ N G [ u ] (becausewe check this in newN w, ( p w ,f w ) ), and also that if f w = p v = p u and w ∈ N G [ u ] then w / ∈ N G [ v ] (because we check if w has two footprinters). Therefore, N G [ u ] ∩ N G [ v ] = F such that f w < p u = p v for all w ∈ F . Now we can assign colors ( p ′ w , f ′ w ) for every w ∈ V ( G ), such that: • p ′ w = p w if p w ≤ p u and w = v , • p ′ w = p w + 1 if p w > p u or w = v , • f ′ w = f w if f w < p u , • f ′ w = f w if f w = p u and w / ∈ N G [ v ], • f ′ w = f w + 1 if f w = p u and w ∈ N [ v ], and • f ′ w = f w + 1 if p w > p u .That is, we move one position forward all the vertices that appear after u in S andincrease the necessary f w . It is easy to see that this new assignment preserves the“legality” of u (i.e., if N G [ u ] − { z : z ∈ N G [ w ] ∧ p w < p u } 6 = ∅ then N G [ u ] − { z : z ∈ N G [ w ] ∧ p ′ w < p ′ v } 6 = ∅ ) and also of all the other vertices.We can also model the Grundy total domination problem (defined in [12]) in a verysimilar way, by simply removing the cases where a vertex can footprint itself.For both problems, since C is O ( | V ( G ) | ), and N and all the t ’s are bounded by aconstant, the time complexity is polynomial in | V ( G ) | for a graph G in a family ofbounded treewidth graphs.7.2. Well known problems.
The following problems are well known to be polynomial-time solvable in bounded treewidth graphs (or even in larger graph classes). Many ofthem have been studied in [4, 5, 26, 33, 62] and their definitions can be found in Appen-dix A.In tables 1, 2 and 3 we show some examples of coloring, domination, independenceand packing problems as instances of the GLC problem without global properties (thatis, Π = ∅ ) and with a partial neighborhood system. Observe that for list-coloring and H -coloring we are only interested in determining whether such coloring exists or not,so we do not use the weights for optimizing the solution, instead we use them preciselyfor determining if a solution is valid. For k -coloring we can make use of weights todetermine the smallest j ≤ k for which there exists a j -coloring in G (in particular,by Theorem 2.4.3, we could set k = tw ( G ) + 1 to obtain the chromatic number in O ( | V ( G ) | ) time). For the total version of most of these domination problems we onlyneed to replace N [ v ] by N ( v ) and expressions like n + i ≥ k by n ≥ k . Assuming k constant, the time complexity is O ( | V ( G ) | ) in all these cases. For weighted versions ofthese problems, weights are part of the input. H E G L C P R O B L E M I N B O UN D E D T R EE W I D T H G R A P H S Problem L v Weights , (cid:22) , ⊕ w v,i check ( v, c ) N v,i n ⊞ v,i n ′ newN v,i ( u, j ) check v,i ( n ) k -coloring [[1 , k ]] R ∪ { + ∞} , ≤ , max i V u ∈ N G ( v ) ( c ( u ) = c ( v )) Bool n ∧ n ′ j = i nk -chromatic sum [[1 , k ]] R ∪ { + ∞} , ≤ , + i V u ∈ N G ( v ) ( c ( u ) = c ( v )) Bool n ∧ n ′ j = i n List-coloring from input R ∪ { + ∞} , ≤ , + 0 V u ∈ N G ( v ) ( c ( u ) = c ( v )) Bool n ∧ n ′ j = i nH -coloring V ( H ) R ∪ { + ∞} , ≤ , + 0 V u ∈ N G ( v ) c ( u ) ∈ N H ( c ( v )) Bool n ∧ n ′ j ∈ N H ( i ) n Table 1.
Coloring problems modeled as instances of the GLC problem with Π = ∅ and with a partial neighborhood system. Problem L v Weights , (cid:22) , ⊕ w v,i check ( v, c ) N v,i n ⊞ v,i n ′ newN v,i ( u, j ) check v,i ( n ) k -tuple domination { , } R ∪ { + ∞} , ≤ , + i P u ∈ N G [ v ] c ( u ) ≥ k [[0 , k ]] min( n + n ′ , k ) j n + i ≥ k Total k -tuple domination { , } R ∪ { + ∞} , ≤ , + i P u ∈ N G ( v ) c ( u ) ≥ k [[0 , k ]] min( n + n ′ , k ) j n ≥ kk -domination { , } R ∪ { + ∞} , ≤ , + i c ( v ) = 0 ⇒ P u ∈ N G ( v ) c ( u ) ≥ k [[0 , k ]] min( n + n ′ , k ) j i = 0 ⇒ n ≥ k { k } -domination [[0 , k ]] R ∪ { + ∞} , ≤ , + i P u ∈ N G [ v ] c ( u ) ≥ k [[0 , k ]] min( n + n ′ , k ) j n + i ≥ kk -rainbow domination 2 [[1 ,k ]] R ∪ { + ∞} , ≤ , + | i | (cid:12)(cid:12)(cid:12)S u ∈ N G [ v ] c ( u ) (cid:12)(cid:12)(cid:12) = k [[1 ,k ]] n ∪ n ′ j | n ∪ i | = k Roman domination { , , } R ∪ { + ∞} , ≤ , + i c ( v ) = 0 ⇒ W u ∈ N G ( v ) ( c ( u ) = 2) Bool n ∨ n ′ j = 2 i = 0 ⇒ n Table 2.
Domination problems modeled as instances of the GLC problem with Π = ∅ and with a partial neighborhoodsystem. Problem L v Weights , (cid:22) , ⊕ w v,i check ( v, c ) N v,i n ⊞ v,i n ′ newN v,i ( u, j ) check v,i ( n )Independent set { , } R ∪ {−∞} , ≥ , + i i = 1 ⇒ P u ∈ N G ( v ) c ( u ) = 0 { , } min( n + n ′ , j i = 1 ⇒ n = 0 { k } -packing function [[0 , k ]] R ∪ {−∞} , ≥ , + i P u ∈ N G [ v ] c ( u ) ≤ k [[0 , k + 1]] min( n + n ′ , k + 1) j n ≤ k { k } -limited packing { , } R ∪ {−∞} , ≥ , + i P u ∈ N G [ v ] c ( u ) ≤ k [[0 , k + 1]] min( n + n ′ , k + 1) j n ≤ k Table 3.
Miscellaneous problems modeled as instances of the GLC problem with Π = ∅ and with a partial neighborhoodsystem. Additive coloring.
Let η be an upper bound of the additive chromatic number.It was shown in [3] that the additive chromatic number is at most ∆( G ) − ∆( G ) + 1.To model the additive coloring problem as an instance of the GLC problem witha partial neighborhood system, we change the numbers assigned to the vertices withpairs of integers ( n, s ), where n represents the number assigned to the vertex and s thesum of the numbers assigned to its neighbors. Then • L v = [[1 , η ]] × [[1 , ∆( G ) η ]]; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = max; • w v,i = i ; • check ( v, c ) = (cid:16)V u ∈ N G ( v ) c ( u ) = c ( v ) (cid:17) ∧ (cid:16) c ( v ) = P u ∈ N G ( v ) c ( u ) (cid:17) ; • Π = ∅ ; • N v,i = [[1 , ∆( G ) η + 1]]; • n ⊞ v,i n ′ = min( n + n ′ , ∆( G ) η + 1); • newN v,i ( u, j ) = ( j if i = j ∆( G ) η + 1 otherwise; • check v,i ( n ) = ( n = i ).Then C is O (∆( G ) η ) and N is O (∆( G ) η ), implying that there exists a polynomial-time algorithm to compute η ( G ) when G is in a class of graphs of bounded treewidth.Another polynomial time algorithm was obtained by R. Grappe, L. N. Grippo, and M.Valencia-Pabon (personal communication).7.2.2. Distance domination problems.
We will start by showing how to model the dis-tance k -domination problem. To do this, we restate the problem in the following way:vertices receive integers from 0 to k (that represent their distance to a vertex of thedistance k -dominating set), and vertices with a number greater than 0 must satisfy thecondition of having a neighbor with the preceding number assigned. Then • L v = [[0 , k ]]; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v, = 1 and w v,i = 0 for all i ∈ [[1 , k ]]; • check ( v, c ) = (cid:16) c ( v ) > ⇒ W u ∈ N G ( v ) c ( u ) = c ( v ) − (cid:17) ; • Π = ∅ ; • N v,i = Bool ; • n ⊞ v,i n ′ = n ∨ n ′ ; • newN v,i ( u, j ) = ( j = i − • check v,i ( n ) = ( i > ⇒ n ).We have C = k + 1, N = 2 and the t ’s bounded by a constant. Therefore, assuming k is bounded by a constant and G is in a class of graphs of bounded treewidth, thetime complexity of the algorithm in this case is O ( | V ( G ) | ).Notice that with a similar argument we can model a distance domination prob-lem involving more than two sets. The idea is to make the colors indicate how farthe vertices are from every other color. For example, if we have to color the graphwith { r, g, b } in such a way that every vertex is at distance at most 3 from a ver-tex of color r and at distance at most 2 from a vertex of color g , following thisidea to model the problem as an instance of the GLC problem, our set of colors is { r , , r , , g , , g , , g , , b , , b , , b , , b , , b , , b , } . HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 25
D D i D D i D D ∗ D i Figure 1.
Semitotal domination problemHowever, when there are restrictions over the distance between vertices of the samecolor, the previous approach would not work. We will now explain how to model theseproblems when the required distance is 2.Let us work with the semitotal domination problem. We first restate the problemin order to differentiate the two possible situations for a vertex in D (that is, havinga neighbor in D or being at distance 2 of another vertex in D ) and the two possiblesituations for a vertex not in D (that is, being the nexus between two vertices in D or not), as you can see Figure 1. In this way, a vertex of color D ∗ needs at least twoneighbors in D , a vertex of color D needs one neighbor in D , a vertex of color D needsone neighbor in D , and a vertex of color D needs one neighbor of color D ∗ . Then wecan set • L v = { D , D , D, D ∗ } ; • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v,D = w v,D = 1, and w v,D = w v,D ∗ = 0; • check ( v, c ) = ( c ( v ) ∈ { D, D } ⇒ ∃ u ∈ N G ( v ) / c ( u ) ∈ { D , D } ) ∧ ( c ( v ) = D ⇒ ∃ u ∈ N G ( v ) / c ( u ) = D ∗ ) ∧ ( c ( v ) = D ∗ ⇒ ∃ u, w ∈ N G ( v ) / u = w ∧ c ( u ) , c ( w ) ∈ { D , D } ); • Π = ∅ ; • N v,i = { , , } ; • n ⊞ v,i n ′ = min( n + n ′ , • If i ∈ { D , D, D ∗ } : newN v,i ( u, j ) = ( j ∈ { D , D } i = D : newN v,i ( u, j ) = ( j = D ∗ • check v,i ( n ) = ( i ∈ { D, D , D } ⇒ n ≥ ∧ ( i = D ∗ ⇒ n ≥ D is at distance 2of another vertex in D are now the vertices of color D ∗ .Combining the ideas of the two previous problems we can solve a large number ofrelated problems, such as total distance 2-domination.7.2.3. Problems involving edges.
We consider two kind of problems: when edges do nothave requirements over other edges, and when they do.
For the first class of problems, consider the graph G ′ = ( V ( G ) ∪ E ( G ) , E ′ ( G )) ob-tained by subdividing each edge and (possibly, depending on the requirements of theproblem) also keeping the original edge (note that tw ( G ′ ) ≤ tw ( G ) + 1). We mightneed to duplicate the colors in order to differentiate the colors assigned to edges fromthe colors assigned to vertices, so that the checking functions can distinguish them. Asan example, we show how to model vertex cover: • L v = { , } for all v ∈ V ( G ) and L uv = { } for all uv ∈ E ( G ); • ( Weights , (cid:22) ) = ( R ∪ { + ∞} , ≤ ) and ⊕ = +; • w v ′ ,i = i for all v ′ ∈ V ( G ′ ) , i ∈ L v ′ ; • check ( v, c ) = True for all v ∈ V ( G ), and check ( uv, c ) = ( c ( u ) + c ( v ) ≥
1) for all uv ∈ E ( G ); • Π = ∅ ; • N v ′ ,i = { , } ; • n ⊞ v ′ ,i n ′ = min( n + n ′ , • newN v ′ ,i ( u ′ , j ) = j ; and • check v,i ( n ) = True for all v ∈ V ( G ) , i ∈ L v , and check uv, ( n ) = ( n ≥
1) for all uv ∈ E ( G ).Edge cover is basically the same as vertex cover but interchanging vertices and edges.As regards the second class of problems involving edges, we illustrate the maximummatching problem, for which we can set: • L v = { } for all v ∈ V ( G ) and L uv = { , } for all uv ∈ E ( G ); • ( Weights , (cid:22) ) = ( R ∪ {−∞} , ≥ ) and ⊕ = +; • w v ′ ,i = i for all v ′ ∈ V ( G ′ ) , i ∈ L v ′ ; • check ( v, c ) = (cid:16)P u ∈ N G ( v ) c ( uv ) ≤ (cid:17) for all v ∈ V ( G ), and check ( uv, c ) = True for all uv ∈ E ( G ); • Π = ∅ ; • N v ′ ,i = { , } ; • n ⊞ v ′ ,i n ′ = min( n + n ′ , • newN v ′ ,i ( u ′ , j ) = j ; and • check v, ( n ) = ( n ≤
1) for all v ∈ V ( G ), and check uv,i ( n ) = True for all uv ∈ E ( G ) , i ∈ L uv .Notice that the idea is more similar to the one of semitotal domination, in the sensethat the neighbors of the edges (the vertices) are the ones in charge of checking therequirements of the edges (in the case of matching, that not two chosen edges share anendpoint).7.2.4. LCVP problems.
Let m ( S ) be the maximum of S if S is finite or the maximumof S if S is co-finite.We have already seen (in Section 3) how to model the problem of deciding if G hasa D q partition as an instance of the GLC problem, so now we only need to extend itwith a partial neighborhood system: • N v,i is the Cartesian product of the sets [[1 , m ( D q [ i, j ])]] for all 1 ≤ j ≤ q ; • n ⊞ v,i n ′ is such that ( n ⊞ v,i n ′ ) j = min( n j + n ′ j , m ( D q [ i, j ])) for all 1 ≤ j ≤ q ; • newN v,i ( u, j ) is the tuple such that its j th entry is 1 and all its other entriesare 0; and • check v,i ( n ) = V ≤ j ≤ q ( n j ∈ D q [ i, j ]). HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 27 The GLC problem in bounded treewidth and bounded degree graphs
Recall the partial neighborhood system defined in Remark 5.1.2, for which
N ≤ ( C + 2) ∆( G ) . Hence, the next result easily follows. Theorem 8.0.1.
Let F be a family of graphs of bounded treewidth and bounded degree,and let G ∈ F . Then there exists a polynomial-time algorithm that solves the GLCproblem with C polynomial in | V ( G ) | , Π = ∅ , and all functions check , min and ⊕ computable in polynomial time. Furthermore, the next lemma shows that fixed powers of bounded treewidth andbounded degree graphs are also bounded treewidth and bounded degree graphs, there-fore extending the results of the previous sections to more problems in these graphclasses.
Lemma 8.0.2.
Let G be a graph and p ≥ . Then ∆( G ) ≤ ∆( G p ) ≤ ∆( G ) p and max( tw ( G ) , ∆( G )) ≤ tw ( G p ) ≤ ( tw ( G ) + 1)(∆( G ) + 1) ⌈ p ⌉ − . Proof.
The inequality ∆( G ) ≤ ∆( G p ) ≤ ∆( G ) p follows easily from the definition ofpower of a graph. Let v be a vertex of G of maximum degree. In G p , the graphinduced by N G [ v ] is a clique of size ∆( G ) + 1 and, by Theorem 2.4.3, we get that tw ( G p ) ≥ ∆( G ). Since G is a subgraph of G p and by Proposition 2.4.2, we have tw ( G p ) ≥ tw ( G ).Now assume ( T, { X t } t ∈ V ( T ) ) is a tree decomposition of G . For every t ∈ V ( T ), let Y t be the set of vertices that are at distance less than or equal to ⌈ p ⌉ from a vertex of X t . We will prove that ( T, { Y t } t ∈ V ( T ) ), is a tree decomposition of G p .Clearly, S t ∈ V ( T ) Y t = V ( G ) = V ( G p ), so property (W1) holds.Let u, v be two vertices that are neighbors in G p . If they are also neighbors in G ,then there exists a bag X t that contains both of the vertices and since X t ⊆ Y t , weget that property (W2) holds in this case. If not, there exists a vertex w that is atdistance at most ⌈ p ⌉ from both u and v in G . Therefore, since there exists a bag X t that contains w , this implies that w ∈ Y t (because X t ⊆ Y t ) and u, v ∈ Y t (because u, v are at distance at most ⌈ p ⌉ from w ∈ X t ). Consequently, property (W2) also holds inthis remaining case.Now we will prove that (W3) holds. For all u ∈ V ( G ), let T Xu = T [ { t ∈ V ( T ) : u ∈ X t } ] and T Yu = T [ { t ∈ V ( T ) : u ∈ Y t } ]. Applying property (W3) to ( T, { X t } t ∈ V ( T ) ),we obtain that T Xu is a subtree of T for every u ∈ V ( G ). Let v ∈ V ( G ). We willprove that T Yv is connected. By definition of the bags Y t , we know that v ∈ Y t if andonly if t ∈ V ( T Xv ) or t ∈ V ( T Xu ) for some u such that d ( v, u ) ≤ ⌈ p ⌉ . Let t ∈ V ( T Xv ).Notice that in order to prove that T Yv is connected it is sufficient to prove that thereexists a path in T between t and every s ∈ V ( T Yv ) − V ( T Xv ). Let s ∈ V ( T Yv ) − V ( T Xv )and let v s ∈ Y s be such that d ( v, v s ) ≤ ⌈ p ⌉ . Since T Xu is a subtree of T for every u ∈ V ( G ), and V ( T Xu ) ∩ V ( T Xw ) = ∅ for all uw ∈ E ( G ) (because of property (W2)applied to ( T, { X t } t ∈ V ( T ) ) and the edge uw ), and there exists a path in G between v and v s , we get that there exists a path in T between t and s . Therefore (W3) holds for( T, { Y t } t ∈ V ( T ) ).Since every bag Y t has at most ( tw ( G )+1)(∆( G )+1) ⌈ p ⌉ vertices, we obtain tw ( G p ) ≤ ( tw ( G ) + 1)(∆( G ) + 1) ⌈ p ⌉ − (cid:3) The next result follows directly from the previous lemma, the results in Section 5and the ideas in Section 7.
Corollary 8.0.3.
Let F be a family of graphs of bounded treewidth and bounded degree.Given G ∈ F with a tree-decomposition of width k , and a fixed number p , label the edgesof G p with the distance of their endpoints in G . Then the algorithm of Section 5 can beinstantiated to solve, in polynomial time, distance coloring problems [13, 17, 18, 29, 36,38,39,60], distance independence [28], distance domination problems [42], and distanceLCVP problems [48], for bounded distances, for the input graph G . A similar result has been obtained by Jaffke, Kwon, Strømme and Telle for thedistance versions of the LCVP problems in bounded MIM-width graphs [48].9.
Conclusions and further work
We introduced the generalized locally checkable problem which encompasses manyproblems with locally checkable restrictions, and showed that it generalizes some pre-vious attempts of doing so. While in these former frameworks the restrictions haveto be expressed using logic formulas or matrices, in the generalized locally checkableproblem they are expressed as functions . This feature brings our problem statementcloser to natural language, making it easier to employ.We introduced the concept of partial neighborhood system , which is very naturaldespite its technical definition. A partial neighborhood system allows us to restructurethe function check in simpler terms, and provides us with tools to collect and compressthe information of the neighbors of a vertex.In Theorem 5.6.1 we proved that, for bounded treewidth graphs, there exists apolynomial-time algorithm that solves the generalized locally checkable problem witha given partial neighborhood system (under appropriate conditions, such as havingthe number of colors and partial neighborhoods polynomial in | V ( G ) | , and havingfunctions check v,i computable in polynomial time). Moreover, in Corollary 5.6.2 weprove that, for some instances, we do not need to describe the partial neighborhoodsystem in order to obtain a polynomial-time algorithm. The conditions required arein fact very natural and many well known locally checkable problems satisfy them(for example, k -coloring, { k } -domination and { k } -packing function, for constant k ).Nonetheless, better choices of the partial neighborhood systems can lead to algorithmswith a better time complexity (linear in most cases, as we show in Section 7).We also showed how to solve instances including some global properties (Section 6).As a result, we can solve problems like acyclic coloring and connected dominating setin polynomial-time for bounded treewidth graphs.By modeling double Roman domination (and some of its variants), minimum chro-matic violation, and Grundy (total) domination as instances of the GLC problem, weproved that these problems are polynomial time solvable in bounded treewidth graphs(Section 7.1). In addition, we proved that b-coloring is polynomial time solvable inbounded treewidth and bounded degree graphs.Finally, we proved that for any instance of the GLC problem where G is in a class ofgraphs of bounded treewidth and bounded degree, the number of colors is polynomialin V ( G ), Π = ∅ , and all functions check , min and ⊕ are computable in polynomial time,there exists a polynomial-time algorithm that solves it (Theorem 8.0.1). Furthermore,by proving that (fixed) powers of bounded degree and bounded treewidth graphs arealso bounded degree and bounded treewidth graphs (Lemma 8.0.2), we were able toenlarge the family of problems that can be solved in polynomial time for these graph HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 29 classes, including, for example, distance coloring problems and distance dominationproblems for bounded distances (Corollary 8.0.3).Possible future lines of research include developing polynomial-time algorithms forother graph classes (and analyzing what restrictions are necessary for the other param-eters of the problem), providing classes of global properties for which we can extend thealgorithm in Section 5, studying NP-complete instances, and modeling more problemsas instances of the GLC problem.
Acknowledgements
This work was partially supported by ANPCyT PICT-2015-2218, and UBACyTGrants 20020170100495BA and 20020160100095BA (Argentina). Carolina L. Gonzalezis partially supported by a CONICET doctoral fellowship.
References [1] H. Abdollahzadeh Ahangar, M. Chellali, and S. Sheikholeslami. Outer independent double Romandomination.
Applied Mathematics and Computation , 364:124617, 2020.[2] H. A. Ahangar, M. Chellali, and S. M. Sheikholeslami. On the double Roman domination ingraphs.
Discrete Applied Mathematics , 232:1–7, 2017.[3] S. Akbari, M. Ghanbari, R. Manaviyat, and S. Zare. On the lucky choice number of graphs.
Graphs and Combinatorics , 29(2):157–163, Mar. 2013.[4] G. Argiroffo, V. Leoni, and P. Torres. { k } -domination for chordal graphs and related graphclasses. Electronic Notes in Discrete Mathematics , 44:219–224, 2013.[5] S. Arnborg, J. Lagergren, and D. Seese. Easy problems for tree-decomposable graphs.
Journal ofAlgorithms , 12(2):308–340, 1991.[6] R. A. Beeler, T. W. Haynes, and S. T. Hedetniemi. Double Roman domination.
Discrete AppliedMathematics , 211:23–29, 2016.[7] H. L. Bodlaender. A partial k -arboretum of graphs with bounded treewidth. Theoretical ComputerScience , 209(1):1–45, 1998.[8] H. L. Bodlaender, P. G. Drange, M. S. Dregi, F. V. Fomin, D. Lokshtanov, and M. Pilipczuk.An O ( c k n ) 5-approximation algorithm for treewidth. In , pages 499–508, 2013.[9] M. Braga, D. Delle Donne, M. Escalante, J. Marenco, M. Ugarte, and M. Varaldo. The minimumchromatic violation problem: a polyhedral study. Electronic Notes in Discrete Mathematics ,62:309–314, 2017. LAGOS’17 – IX Latin and American Algorithms, Graphs and Optimization.[10] A. Brandst¨adt, V. B. Le, and J. P. Spinrad.
Graph Classes: A Survey , volume 3 of
SIAM Mono-graphs on Discrete Mathematics . Society for Industrial and Applied Mathematics, Philadelphia,1999.[11] B. Breˇsar, T. Gologranc, M. Milaniˇc, D. F. Rall, and R. Rizzi. Dominating sequences in graphs.
Discrete Mathematics , 336:22–36, 2014.[12] B. Breˇsar, M. A. Henning, and D. F. Rall. Total dominating sequences in graphs.
Discrete Math-ematics , 339(6):1665–1676, 2016.[13] B. Breˇsar, S. Klavˇzar, and D. F. Rall. On the packing chromatic number of Cartesian products,hexagonal lattice, and trees.
Discrete Applied Mathematics , 155(17):2303–2311, 2007.[14] B.-M. Bui-Xuan, J. A. Telle, and M. Vatshelle. Fast dynamic programming for locally checkablevertex subset and vertex partitioning problems.
Theoretical Computer Science , 511:66–76, 2013.[15] T. Calamoneri. The L ( h, k )-Labelling Problem: A Survey and Annotated Bibliography. TheComputer Journal , 49(5):585–608, 05 2006.[16] D. Cattan´eo and S. Perdrix. The parameterized complexity of domination-type problems andapplication to linear codes. In T. V. Gopal, M. Agrawal, A. Li, and S. B. Cooper, editors,
Theoryand Applications of Models of Computation - 11th Annual Conference, TAMC 2014, Chennai,India, April 11-13, 2014. Proceedings , volume 8402 of
Lecture Notes in Computer Science , pages86–103. Springer, 2014.[17] G. J. Chang and D. Kuo. The L (2 , SIAM Journal on DiscreteMathematics , 9(2):309–316, 1996. [18] G. J. Chang and C. Lu. Distance-two labelings of graphs.
European Journal of Combinatorics ,24(1):53–58, 2003.[19] G. J. Chang, J. Wu, and X. Zhu. Rainbow domination on trees.
Discrete Applied Mathematics ,158(1):8–12, 2010.[20] E. J. Cockayne, R. M. Dawes, and S. T. Hedetniemi. Total domination in graphs.
Networks ,10(3):211–219, 1980.[21] E. J. Cockayne, P. A. Dreyer, S. M. Hedetniemi, and S. T. Hedetniemi. Roman domination ingraphs.
Discrete Mathematics , 278(1):11–22, 2004.[22] B. Courcelle and M. Mosbah. Monadic second-order evaluations on tree-decomposable graphs.
Theoretical Computer Science , 109(1):49–82, 1993.[23] S. Czerwi´nski, J. Grytczuk, and W. ˙Zelazny. Lucky labelings of graphs.
Information ProcessingLetters , 109(18):1078–1081, 2009.[24] J. Edmonds. Paths, trees, and flowers.
Canadian Journal of Mathematics , 17:449–467, 1965.[25] A. T. Egunjobi and T. W. Haynes. Perfect double Roman domination of trees.
Discrete AppliedMathematics , 2020.[26] E. Eiben, R. Ganian, and J. Lauri. On the complexity of rainbow coloring problems.
DiscreteApplied Mathematics , 246:38–48, 2018. The Combinatorics of Graphs and Strings.[27] P. Erdos, A. L. Rubin, and H. Taylor. Choosability in graphs. In
Proc. West Coast Conf. onCombinatorics, Graph Theory and Computing, Congressus Numerantium , volume 26, pages 125–157, 1979.[28] H. Eto, F. Guo, and E. Miyano. Distance- d independent set problems for bipartite and chordalgraphs. J. Comb. Optim. , 27(1):88–99, Jan. 2014.[29] J. Fiala and P. A. Golovach. Complexity of the packing coloring problem for trees.
DiscreteApplied Mathematics , 158(7):771–778, 2010. Third Workshop on Graph Classes, Optimization,and Width Parameters Eugene, Oregon, USA, October 2007.[30] J. F. Fink and M. S. Jacobson. n -Domination in Graphs , pages 283–300. John Wiley & Sons,Inc., USA, 1985.[31] P. Firby and J. Haviland. Independence and average distance in graphs. Discrete Applied Math-ematics , 75(1):27–37, 1997.[32] M. Frick and M. Grohe. The complexity of first-order and monadic second-order logic revis-ited.
Annals of Pure and Applied Logic , 130(1):3–31, 2004. Papers presented at the 2002 IEEESymposium on Logic in Computer Science (LICS).[33] E. Galby, A. Munaro, and B. Ries. Semitotal domination: New hardness results and a polynomial-time algorithm for graphs of bounded mim-width.
Theoretical Computer Science , 814:28–48, 2020.[34] R. Gallant, G. Gunther, B. Hartnell, and D. Rall. Limited packings in graphs.
Discrete AppliedMathematics , 158(12):1357–1364, 2010.[35] M. R. Garey and D. S. Johnson.
Computers and Intractability: A Guide to the Theory of NP-Completeness . W. H. Freeman & Co., New York, NY, USA, 1979.[36] W. Goddard, S. M. Hedetniemi, S. T. Hedetniemi, J. M. Harris, and D. F. Rall. Broadcastchromatic numbers of graphs.
Ars Combinatoria , 86:33–49, 2008.[37] W. Goddard, M. A. Henning, and C. A. McPillan. Semitotal domination in graphs.
UtilitasMathematica , 94:67–81, 2014.[38] D. Gon¸calves. On the L ( p, , volume DMTCS Proceedingsvol. AE, European Conference on Combinatorics, Graph Theory and Applications (EuroComb’05) of DMTCS Proceedings , pages 81–86, Berlin, Germany, 2005. Discrete Mathematics andTheoretical Computer Science.[39] J. R. Griggs and R. K. Yeh. Labelling graphs with a condition at distance 2.
SIAM Journal onDiscrete Mathematics , 5(4):586–595, 1992.[40] B. Gr¨unbaum. Acyclic colorings of planar graphs.
Israel Journal of Mathematics , 14(4):390–408,1973.[41] F. Harary and T. W. Haynes. Double domination in graphs.
Ars Combinatoria , 55:201–213, 042000.[42] T. Haynes, S. Hedetniemi, and P. Slater.
Fundamentals of Domination in Graphs . Boca Raton:CRC Press, 1998.
HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 31 [43] J. He and H. Liang. Complexity of total { k } -domination and related problems. In M. Atallah,X.-Y. Li, and B. Zhu, editors, Frontiers in Algorithmics and Algorithmic Aspects in Informationand Management , pages 147–155, Berlin, Heidelberg, 2011. Springer Berlin Heidelberg.[44] M. A. Henning. Distance domination in graphs. In T. W. Haynes, S. T. Hedetniemi, and P. J.Slater, editors,
Domination in Graphs: Advanced Topics , chapter 12. Marcel Dekker, Inc., 1997.[45] M. A. Henning and A. P. Kazemi. k -tuple total domination in graphs. Discrete Applied Mathe-matics , 158(9):1006–1011, 2010.[46] J. E. Hopcroft and J. D. Ullman.
Introduction To Automata Theory, Languages, And Computa-tion . Addison-Wesley Longman Publishing Co., Inc., USA, 1st edition, 1990.[47] R. W. Irving and D. F. Manlove. The b-chromatic number of a graph.
Discrete Applied Mathe-matics , 91(1):127–141, 1999.[48] L. Jaffke, O. joung Kwon, T. J. F. Strømme, and J. A. Telle. Generalized Distance Dom-ination Problems and Their Complexity on Graphs of Bounded mim-width. In C. Paul andM. Pilipczuk, editors, , volume 115 of
Leibniz International Proceedings in Informatics (LIPIcs) , pages6:1–6:14, Dagstuhl, Germany, 2019. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.[49] R. M. Karp.
Reducibility among Combinatorial Problems , pages 85–103. Springer US, Boston,MA, 1972.[50] T. Kloks.
Treewidth , volume 842 of
Lecture Notes in Computer Science . Springer-Verlag BerlinHeidelberg, 1 edition, 1994.[51] E. Kubicka and A. J. Schwenk. An introduction to chromatic sums. In
Proceedings of the 17thConference on ACM Annual Computer Science Conference , CSC ’89, pages 39–45, New York,NY, USA, 1989. Association for Computing Machinery.[52] V. A. Leoni and E. G. Hinrichsen. { k } -packing functions of graphs. In P. Fouilhoux, L. E. N.Gouveia, A. R. Mahjoub, and V. T. Paschos, editors, Combinatorial Optimization , pages 325–335,Cham, 2014. Springer International Publishing.[53] H. Maimani, M. Momeni, S. Nazari Moghaddam, F. Rahimi Mahid, and S. Sheikholeslami.Independent double Roman domination in graphs.
Bulletin of the Iranian Mathematical Society ,46:543–555, 2020.[54] A. Meir and J. W. Moon. Relations between packing and covering numbers of a tree.
PacificJournal of Mathematics , 61(1):225–233, 1975.[55] Ø. Ore.
Theory of graphs , volume XXXVIII of
Colloquium Publications . American MathematicalSociety, Providence, 3rd edition, 1962.[56] N. Robertson and P. Seymour. Graph minors. III. Planar tree-width.
Journal of CombinatorialTheory, Series B , 36(1):49–64, 1984.[57] N. Robertson and P. Seymour. Graph minors. II. Algorithmic aspects of tree-width.
Journal ofAlgorithms , 7(3):309–322, 1986.[58] E. Sampathkumar and H. B. Walikar. The connected domination number of a graph.
Journal ofMathematical and Physical Sciences , 13:607–613, 1979.[59] Z. Shao, J. Amjadi, S. M. Sheikholeslami, and M. Valinavaz. On the total double Roman domi-nation.
IEEE Access , 7:52035–52041, 2019.[60] C. Sloper. An eccentric coloring of trees.
Australasian Journal of Combinatorics , 29:309–321,2004.[61] J. A. Telle.
Vertex Partitioning Problems: Characterization, Complexity and Algorithms on Par-tial k -Trees . PhD thesis, University of Oregon, 1994.[62] J. A. Telle and A. Proskurowski. Algorithms for vertex partitioning problems on partial k -trees. SIAM Journal on Discrete Mathematics , 10(4):529–550, 1997.[63] M. Thorup. All structured programs have small tree width and good register allocation.
Infor-mation and Computation , 142(2):159–181, 1998.[64] V. G. Vizing. Vertex colorings with given colors.
Diskret. Analiz , 29:3–10, 1976.[65] M. Yannakakis and F. Gavril. Edge dominating sets in graphs.
SIAM Journal on Applied Math-ematics , 38(3):364–372, 1980.
Appendix A. Problems definitions
We define here the decision versions of the problems mentioned along the paper.Other similar problems can also be modeled as instances of the GLC problem.A.1.
Domination problems.
Dominating set [55]
Instance:
A (weighted) graph G and a positive integer k . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most k and such that | N [ v ] ∩ S | ≥ v ∈ V ( G )? Total domination [20]
Instance:
A (weighted) graph G and a positive integer k . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most k and such that | N ( v ) ∩ S | ≥ v ∈ V ( G )? k -tuple domination [41] Instance:
A (weighted) graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most ℓ and such that | N [ v ] ∩ S | ≥ k for every v ∈ V ( G )? Total k -tuple domination [45] Instance:
A (weighted) graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most ℓ and such that | N ( v ) ∩ S | ≥ k for every v ∈ V ( G )? k -domination [30] Instance:
A (weighted) graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most ℓ and such that | N ( v ) ∩ S | ≥ k for every v ∈ V ( G ) \ S ? { k } -domination [43] Instance:
A graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist a function f : V ( G ) → { , , . . . , k } of weight at most ℓ and such that f ( N [ v ]) ≥ k for every v ∈ V ( G )? k -rainbow domination [19] Instance:
A graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist a function f : V ( G ) → { ,...,k } of weight ( P v ∈ V ( G ) | f ( v ) | )at most ℓ and such that for every vertex v ∈ V ( G ) for which f ( v ) = ∅ wehave S u ∈ N G [ v ] f ( u ) = { , . . . , k } ? Semitotal dominating set [37]
Instance:
A (weighted) graph G with no isolated vertex and a positive integer k . Question:
Does there exist a dominating set D ⊆ V ( G ) of size (weight) at most k andsuch that every vertex in D is within distance two of another vertex in D ? Distance k -domination (also called k -covering ) [44, 54] Instance:
A (weighted) graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist a set S ⊆ V ( G ) of size (weight) at most ℓ and such thatevery vertex in G is within distance k from a vertex in S ? Connected dominating set [58]
Instance:
A (weighted) graph G and a positive integer k . Question:
Does there exist a dominating set of G of size (weight) at most k thatinduces a connected subgraph of G ? HE GLC PROBLEM IN BOUNDED TREEWIDTH GRAPHS 33
Roman domination [21]
Instance:
A graph G and a positive integer k . Question:
Does there exist a function f : V ( G ) → { , , } of weight at most k andsuch that every vertex u ∈ V ( G ) for which f ( u ) = 0 is adjacent to at leastone vertex v ∈ V ( G ) for which f ( v ) = 2? Grundy total domination [12]
Instance:
A graph G and a positive integer k . Question:
Does there exist a sequence ( v , . . . , v ℓ ) of distinct vertices of G such that ℓ ≥ k , { v , . . . , v ℓ } is a dominating set of G and N ( v i ) − S i − j =1 N ( v j ) = ∅ foreach i ?A.2. Coloring problems. k -coloring [35] Instance:
A graph G and a positive integer k . Question:
Does there exist a function c : V ( G ) → { , . . . , k } such that c ( u ) = c ( v )whenever uv ∈ E ( G )? List-coloring [27, 64]
Instance:
A graph G and a set L ( v ) of colors for each vertex v ∈ V ( G ). Question:
Does there exist a proper coloring c such that c ( v ) ∈ L v for all v ∈ V ( G )? k -chromatic sum [51] Instance:
A graph G and a positive integer k . Question:
Is there a proper coloring c of the graph G such that P v ∈ V c ( v ) ≤ k ? Additive coloring (also called lucky labeling ) [23] Instance:
A graph G and a positive integer k . Question:
Does there exist a function f : V ( G ) → { , . . . , k } such that for every twoadjacent vertices u, v the sums of numbers assigned to their neighbors aredifferent (that is, P w ∈ N ( u ) f ( w ) = P z ∈ N ( v ) f ( z ))? Acyclic coloring [40]
Instance:
A graph G and a positive integer k . Question:
Does there exist a k -coloring of G such that of every subgraph of G spannedby vertices of two of the colors is acyclic (in other words, is a forest)? L ( h, k ) -labeling [15] Instance:
A graph G and positive integers h , k and s . Question:
Does there exist a labeling of its vertices by integers between 0 and s suchthat adjacent vertices of G are labeled using colors at least h apart, andvertices having a common neighbor are labeled using colors at least k apart?A.3. Independence problems.
Independent set [35]
Instance:
A (weighted) graph G and a positive integer k . Question:
Does there exist an independent set of G of size (weight) at least k ? k -independent set (also called distance d -independent set ) [28,31] Instance:
A graph G , a positive integer k and a positive integer s . Question:
Does there exist X ⊆ V ( G ) of size at least s such that the distance betweenevery two vertices of X is at least k + 1? A.4.
Packing problems. { k } -packing function [52] Instance:
A graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist a function f : V ( G ) → { , , . . . , k } of weight at least ℓ andsuch that f ( N [ v ]) ≤ k for every v ∈ V ( G )? k -limited packing [34] Instance:
A graph G , a positive integer k and a positive integer ℓ . Question:
Does there exist a function f : V ( G ) → { , } of weight at least ℓ and suchthat f ( N [ v ]) ≤ k for every v ∈ V ( G )? Packing chromatic number [13]
Instance:
A graph G and a positive integer k . Question:
Can G be partitioned into disjoint classes X , . . . , X k where vertices in X i have pairwise distance greater than i ?A.5. Problems involving edges.
Matching [24]
Instance:
A(n) (edge weighted) graph G and a positive integer k . Question:
Does there exist a set M ⊆ E ( G ) of pairwise non-adjacent edges of size(weight) at least k ? Edge domination [65]
Instance:
A(n) (edge weighted) graph G and a positive integer k . Question:
Does there exist F ⊆ E ( G ) of size (weight) at most k and such that everyedge in E ( G ) shares an endpoint with at least one edge in F ? Vertex cover [49]
Instance:
A (weighted) graph G and a positive integer k . Question:
Does there exist S ⊆ V ( G ) of size (weight) at most k and such that everyedge in E ( G ) has at least one endpoint in S ? Edge cover [35]
Instance:
A(n) (edge weighted) graph G and a positive integer k . Question:
Does there exist F ⊆ E ( G ) of size (weight) at most k and such that everyvertex in V ( G ) belongs to at least one edge in F ? Universidad de Buenos Aires. Facultad de Ciencias Exactas y Naturales. Departa-mento de Computaci´on. Buenos Aires, Argentina. / CONICET-Universidad de BuenosAires. Instituto de Investigaci´on en Ciencias de la Computaci´on (ICC). Buenos Aires,Argentina.
E-mail address : [email protected] CONICET-Universidad de Buenos Aires. Instituto de Investigaci´on en Ciencias dela Computaci´on (ICC). Buenos Aires, Argentina.
E-mail address ::