Expanding the expressive power of Monadic Second-Order logic on restricted graph classes
aa r X i v : . [ c s . D S ] J un Expanding the expressive power of MonadicSecond-Order logic on restricted graph classes
Robert Ganian and Jan Obdrˇz´alek Vienna University of Technology, Austria ⋆ ⋆ ⋆ [email protected] Faculty of Informatics, Masaryk University, Brno, Czech Republic † [email protected] Abstract.
We combine integer linear programming and recent advancesin Monadic Second-Order model checking to obtain two new algorithmicmeta-theorems for graphs of bounded vertex-cover. The first shows thatcardMSO , an extension of the well-known Monadic Second-Order logicby the addition of cardinality constraints, can be solved in FPT timeparameterized by vertex cover. The second meta-theorem shows thatthe MSO partitioning problems introduced by Rao can also be solved inFPT time with the same parameter.The significance of our contribution stems from the fact that these for-malisms can describe problems which are W[1]-hard and even NP-hardon graphs of bounded tree-width. Additionally, our algorithms have onlyan elementary dependence on the parameter and formula. We also showthat both results are easily extended from vertex cover to neighborhooddiversity. It is a well-known result of Courcelle, Makowski and Rotics that MSO (andLinEMSO ) model checking is in FPT on graphs of bounded clique-width [4].However, this leads to algorithms which are far from practical – the time com-plexity includes a tower of exponents, the height of which depends on the MSO formula. Recently it has been shown that much faster model checking algorithmsare possible if we consider more powerful parameters such as vertex cover [15] –with only an elementary dependence of the runtime on both the MSO formulaand parameter.Vertex cover has been generally used to solve individual problems for whichtraditional width parameters fail to help (see e.g. [1,6,9,10]). Of course, none ofthese problems can be described by the standard MSO or LinEMSO formalism.This raises the following, crucial question: would it be possible to naturally ex-tend the language of MSO to include additional well-studied problems withoutsacrificing the positive algorithmic results on graphs of bounded vertex-cover? ⋆ ⋆ ⋆ Robert Ganian acknowledges support by ERC (COMPLEX REASON, 239962). † Jan Obdrˇz´alek is supported by the research centre Institute for Theoretical Com-puter Science (ITI), project No. P202/12/G061. e answer this question by introducing cardMSO (Definition 2.3) as the ex-tension of MSO by linear cardinality constraints – linear inequalities on vertexset cardinalities and input-specified variables. The addition of linear inequalitiessignificantly increases the descriptive power of the logic, and allows to capture in-teresting problems which are known to be hard on graphs of bounded tree-width.We refer to Section 4 for a discussion of the expressive power and applicationsof cardMSO , including a new result for the c -balanced partitioning problem(Theorem 4.1).The first contribution of the article lies in providing an FPT-time modelchecking algorithm for cardMSO on graphs of bounded vertex cover. This ex-tends the results on MSO model checking obtained by Lampis in [15], whichintroduce an elementary-time FPT MSO model checking algorithm parame-terized by vertex cover. However, the approach used there cannot be straight-forwardly applied to formulas with linear inequalities (cf. Section 3 for furtherdiscussion). Theorem 1.1.
There exists an algorithm which, given a graph G with vertexcover of size k and a cardMSO formula ϕ with q variables, decides if G | = ϕ intime O ( k + q ) + | ϕ | + 2 k | V ( G ) | . The core of our algorithm rests on a combination of recent advances in MSO model checking and the use of Integer Linear Programming (ILP). While usingILP to solve individual difficult graph problems is not new [9], the goal here wasto obtain new graph-algorithmic meta-theorems for frameworks containing awide range of difficult problems. The result also generalizes to the neighborhooddiversity parameter introduced in [15] and to MSO (as discussed in Section 6).In the second part of the article, we turn our attention to a different, alreadystudied extension of MSO : the MSO partitioning framework of Rao [19]. MSOpartitioning asks whether a graph may be partitioned into an arbitrary numberof sets so that each set satisfies a fixed MSO formula, and has been shownto be solvable in XP time on graphs of bounded clique-width. Although MSOpartitioning is fundamentally different from cardMSO and both formalisms ex-pand the power of MSO in different directions, we show that a combination ofMSO model checking and ILP may also be used to provide an efficient FPTmodel-checking algorithm for MSO partitioning parameterized by vertex-coveror neighborhood diversity. Theorem 1.2.
There exists an algorithm which, given a graph G with vertexcover of size k and a MSO partitioning instance ( ϕ, r ) with q variables, decidesif G | = ( ϕ, r ) in time O ( q k ) · | ( ϕ, r ) | + 2 k | V ( G ) | . In the following text all graphs are simple and without loops. For a graph G weuse V ( G ) and E ( G ) to denote the sets of its vertices and edges, and use N ( v )to denote the set of neighbors of a vertex v ∈ V ( G ).2he graph parameter we are primarily interested in is vertex cover. A keynotion related to graphs of bounded vertex cover is the notion of a vertex type. Definition 2.1 ([15]).
Let G be a graph. Two vertices u, v ∈ V are of the same type T if N ( u ) \ { v } = N ( v ) \ { u } . We use T G to denote the set of all types of G (or just T if G is clear from the context). Since each type is associated with its vertices, we also use T to denote theset of vertices of type T . Note that then T G forms a partition of the set V ( G ).For the sake of simplicity, we adopt the convention that, on a graph witha fixed vertex cover X , we additionally separate each cover vertex into its owntype. Then it is easy to see that each type is an independent set, and a graphwith vertex cover of size k has at most 2 k + k types.It is often useful to divide vertices of the same type further into subtypes.The subtypes are usually identified by a system of sets, and all subtypes of agiven type form a partition of that type: Definition 2.2.
Let G be a graph and U ⊆ V ( G ) a set of subsets of V ( G ) . Thentwo vertices u, v ∈ V ( G ) are of the same subtype (w.r.t. U ) if u, v ∈ T for some T ∈ T G and ∀ U ∈ U .u ∈ U ⇐⇒ v ∈ U . We denote by S U T the set of all subtypesof a type T ∈ T G , and also define the set of all subtypes of (w.r.t. U ) as S U G . (If G and U are clear form the context, we may write S instead of S U G ) Finally, notice that |S U G | ≤ |U| |T G | . and its cardinality extensions Monadic Second Order logic (MSO ) is a well established logic of graphs. It isthe extension of first order logic with quantification over vertices and sets ofvertices. MSO in its basic form can only be used to describe decision problems.To solve optimization problems we may use LinEMSO [4], which is capable offinding maximum- and minimum-cardinality sets satisfying a certain MSO for-mula. This is useful for providing simple descriptions of well-known optimizationproblems such as Minimum Dominating Set ( adj is the adjacency relation):Min( X ) : ∀ a ∃ b ∈ X : ( adj ( a, b ) ∨ a = b )The crucial point is that LinEMSO only allows the optimization of set car-dinalities over all assignments satisfying a MSO formula. It is not possible touse LinEMSO to place restrictions on cardinalities of sets considered in theformula. In fact, such restrictions may be used to describe problems which areW[1]-hard on graphs of bounded tree-width, whereas all LinEMSO -definableproblems may be solved in FPT time even on graphs of bounded clique-width[4]. In this paper we define cardMSO , an extension of MSO which allows re-strictions on set cardinalities. Definition 2.3 ( cardMSO ). The language of cardMSO logic consists of ex-pressions built from the following elements: variables x, y . . . for vertices, and X, Y . . . for sets of vertices – the predicates x ∈ X and adj ( x, y ) with the standard meaning – equality for variables, quantifiers ∀ , ∃ and the standard Boolean connectives – tt and ff as the standard valuation constants representing true and false – the expressions [ ρ ≤ ρ ] , where the syntax of the ρ expressions is defined as ρ ::= n | | X | | ρ + ρ , where n ∈ Z ranges over integer constants and X over(vertex) set variables.We call expressions of the form [ ρ ≤ ρ ] linear (cardinality) constraints ,and write [ ρ = ρ ] as a shorthand for [ ρ ≤ ρ ] ∧ [ ρ ≤ ρ ] , and [ ρ < ρ ] for [ ρ ≤ ρ ] ∧ ¬ [ ρ ≤ ρ ] . A formula ϕ of cardMSO is an expression of the form ϕ = ∃ Z . . . ∃ Z m .ϕ such that ϕ is a MSO formula and Z , . . . , Z m are the onlyvariables which appear in the linear constraints.To give the semantics of cardMSO it is enough to define the semanticsof cardinality constraints, the rest follows the standard MSO semantics. Let V : X → Z be a valuation of set variables. Then the truth value of [ ρ ≤ ρ ] isobtained be replacing each occurrence of | X | with the cardinality of V ( X ) andevaluating the expression as standard integer inequality. To give an example, the following cardMSO formula is true if, and only if,a graph is bipartite and both parts have the same cardinality: ∃ X ∃ X . ( ∀ v ∈ V. ( v ∈ X ⇐⇒ ¬ v ∈ X )) ∧ [ | X | = | X | ] ∧ ( ∀ u ∈ V. ( adj ( u, v ) = ⇒ (( u ∈ X ∧ v ∈ X ) ∨ ( u ∈ X ∧ v ∈ X )))For a cardMSO formula ϕ = ∃ Z . . . ∃ Z m .ϕ we call ∃ Z . . . ∃ Z m the prefix of ϕ , and the variables Z i prefix variables . We also put Z ( ϕ ) = { Z , . . . , Z m } ,and often write just Z if ϕ is clear from the context. Note that, since all prefixvariables are existentially quantified set variables, checking whether G | = ϕ (forsome graph G ) is equivalent to finding a variable assignment χ : Z → V ( G ) such that G | = χ ϕ . We call such χ the prefix assignment (for G and ϕ ). Notethat the sets χ ( Z i ) can be used to determine subtypes, and therefore we oftenwrite S χG with the obvious meaning. Integer Linear Programming (ILP) is a well-known framework for formulatingproblems, and will be used extensively in our approach. We provide only a briefoverview of the framework:
Definition 2.4 (p-Variable ILP Feasibility (p-ILP)).
Given matrices A ∈ Z m × p and b ∈ Z m × , the p-Variable ILP Feasibility (p-ILP) problem is whetherthere exists a vector x ∈ Z p × such that A · x ≤ b . The number of variables p isthe parameter. Lenstra [16] showed that p-ILP, together with its optimization variant p-OPT-ILP, can be solved in FPT time. His running time was subsequently im-proved by Kannan [14] and Frank and Tardos [11].4 heorem 2.5 ([16,14,11,9]). p-ILP and p-OPT-ILP can be solved using O ( p . p + o ( p ) · L ) arithmetic operations in space polynomial in L , L being thenumber of bits in the input. Model Checking
The main purpose of this section is to give a proof of Theorem 1.1. The proofbuilds upon the following result of Lampis:
Lemma 3.1 ([15]).
Let ϕ be an MSO formula with q S set variables and q v vertex variables. Let G be a graph, v ∈ V ( G ) a vertex of type T such that | T | > q S · q v , and G a graph obtained from G by deleting v . Then G | = ϕ iff G | = ϕ . In other words, a formula ϕ of MSO cannot distinguish between two graphs G and G which differ only in the cardinalities of some types, as long as thecardinalities in both graphs are at least 2 q S · q v .This gives us an efficient algorithm for model checking MSO on graphs ofbounded vertex cover: We first “shrink” the sizes of types to 2 q S · q v and thenrecursively evaluate the formula, at each quantifier trying all possible choices foreach set and vertex variable . Theorem 3.2 ([15]).
There exists an algorithm which, for a
MSO sentence ϕ with q variables and a graph G with n vertices and vertex cover of size at most k , decides G | = ϕ in time O ( k + q ) + O (2 k n ) . However, a straightforward adaptation of the approach sketched above doesnot work with linear constraints. To see this, simply consider e.g. the formula ∃ Z ∃ Z . [ | Z | = | Z | + 1]. Changing the cardinality of Z by even a single vertexcan alter whether the linear constraint is evaluated as true or false, even if | Z ∩ T | is large for some type T . On the other hand, observe that the truth value of alinear inequality [ ρ ≤ ρ ] depends only on the prefix variables, not on the restof the formula. With this in mind, we continue by sketching the general strategyfor proving Theorem 1.1:Given a graph G and a formula ϕ we begin by creating the graph G ϕ from G by reducing the size of each type to 2 q S · q v . Since this construction can impactthe possible values of linear constraints in ϕ , we replace each linear constraintwith either tt or ff , effectively claiming which linear constraints we expect to besatisfied in G (for some assignment to prefix variables). We try all 2 l possibletruth valuations of linear constraints.For each MSO formula ψ obtained from ϕ by fixing some truth valuationof linear constraints we now check whether G ϕ | = ψ , generating all prefix as-signments χ for which G ϕ | = χ ψ . The remaining step is to check whether someprefix assignment (in G ϕ ) can be extended to a prefix assignment in G in such Note that both Lemma 3.1 and Theorem 3.2 implicitly utilize the symmetry betweenvertices of the same type. ψ would still hold in G and all linear cardinality constraints wouldevaluate to their guessed values. This check is performed by the construction ofan p-ILP formulation which is feasible if, and only if, there is such an extension.We will now formalize the proof we have just sketched. First, we need a fewdefinitions. We start by formalizing the process of “shrinking” (some types of)a graph. Definition 3.3.
Given a graph G and a cardMSO formula ϕ = ∃ Z . . . ∃ Z m .ϕ with q v vertex and m + q S set variables, we define the reduced graph G ϕ to bethe graph obtained from G by the following prescription:1. For each type T ∈ T G s.t. | T | > q S + m q v we delete the “extra” vertices oftype T so that exactly q S + m q v vertices of this type remain, and2. we take the subgraph induced by the remaining vertices. Note that vertices of a type with cardinality at most 2 q S + m q v are neverdeleted in the process of “shrinking” G , and | V ( G ϕ ) | ≤ |T G ϕ | · q S + m q v . Next weformalize the process of fixing the truth values of linear cardinality constraints. Definition 3.4.
Let l ( ϕ ) = { l , . . . , l k } be the list of all linear cardinality con-straints in the formula ϕ . Let α : l ( ϕ ) → { tt , ff } , called the pre-evaluation func-tion , be an assignment of truth values to all linear constraints. Then by α ( ϕ ) we denote the formula obtained from ϕ by replacing each linear constraint l i by α ( l i ) , and call α ( ϕ ) the pre-evaluation of ϕ . Note that α ( ϕ ) is a MSO formula. As we mentioned earlier, the truth value for each linear cardinality constraintdepends only on the values of prefix variables. Therefore all linear constraintscan be evaluated once we have fixed a prefix assignment. We say that a prefixassignment χ , of a cardMSO formula ϕ , complies with a pre-evaluation α if eachlinear constraint l ∈ l ( ϕ ) evaluates to true (under χ ) if, and only if, α ( l ) = tt .We also need a notion of extending a prefix assignment for G ϕ to G . In thefollowing definition we use the implicit matching between the subtypes S of G and the subtypes S ϕ of its subgraph G ϕ . Definition 3.5.
Given a graph G and a cardMSO formula ϕ = ∃ Z . . . ∃ Z m .ϕ with q v vertex and q S set variables in ϕ , we say that a prefix assignment χ for G extends a prefix assignments χ ϕ for G ϕ if for all S ∈ S χG :1. S = S ϕ if | S ϕ | ≤ q S q v S ⊇ S ϕ if | S ϕ | > q S q v Finally we will need the following statement, which directly follows from theproof of Lemma 3.1 [15]:
Lemma 3.6.
Let ϕ = ∃ Z . . . ∃ Z m .ϕ be an MSO formula, with q S set variablesin ϕ and q v vertex variables, and let χ : Z → V ( G ) be a prefix assignment in G . Let v ∈ V ( G ) be a vertex of subtype S ∈ S χG such that | S | > q s q v , and G a graph obtained from G by deleting v . Then G | = χ ϕ iff G | = χ ϕ , where χ is the prefix assignment induced by χ on G . formula ϕ = ∃ Z . . . ∃ Z m .ϕ with q v vertex variables, q S set variables in ϕ and with linearcardinality constraints l ( ϕ ) = { l , . . . , l k } . We are now ready to state the mainlemma: Lemma 3.7.
Let G be a graph, ϕ be a cardMSO formula, χ ϕ be a prefix as-signment for G ϕ , and α a pre-evaluation such that G ϕ | = χ ϕ α ( ϕ ) . Then we can,in time O ( |T G | · m | l ( ϕ ) | ) , construct a p-ILP formulation which is feasible iff χ ϕ can be extended to a prefix assignment χ for G such that (a) χ complies with α ,and (b) G | = χ ϕ . Moreover, the formulation has |T G | · m variables. Proof.
We start by showing the construction of the p-ILP formulation. Theset of variables is created as follows: For each subtype S ∈ S χ ϕ G ϕ we introducea variable x S which will represent the cardinality of S in G . There are threegroups of constraints:1. We need to make sure that, for each type T ∈ T G , the cardinalities of allsubtypes of T sum up to the cardinality of a type T . This is easily achieved byincluding a constraint P S ⊆ T x S = | T | for each type T (note that here | T | is aconstant).2. We need to guarantee that χ extends χ ϕ . Therefore we include x S = | S ϕ | for each subtype with | S ϕ | ≤ q S q v , and x S > | S ϕ | if | S ϕ | > q S q v .3. We need to check that χ complies with α , i.e. that each linear constraint l is either true or false based on the value of α ( l ). For each constraint l wefirst replace each occurrence of | Z i | with the sum of cardinalities of all subtypeswhich are contained in Z i , i.e. by P S ϕ ⊆ Z i x S . Then if α ( l ) = tt , we simplyinsert the modified constraint into the formulation. Otherwise we first reversethe inequality (e.g. > instead of ≤ ), and then also insert it.To prove the forward implication, let us assume that the p-ILP formulation isfeasible. To define χ we start with χ = χ ϕ . Then for each subtype S ∈ S G if x S > | S ϕ | we add x S − | S ϕ | unassigned vertices of type T , where T is the supertypeof S . This is always possible thanks to constraints in 1. and 2. The constraintsin 3. guarantee that χ complies with α . Finally G | = χ ϕ by Lemma 3.6.For the reverse implication let S ∈ S G be the subtype identified by the set Y ⊂ Z . Then we put x S = |{ v ∈ V ( G ) |∀ Z ∈ Z .v ∈ χ ( Z ) ⇐⇒ Z ∈ Y} , and thep-ILP formulation is satisfiable by our construction. Finally, it is easy to verifythat the size of this p-ILP formulation is at most O ( |T G | · q S | l ( ϕ ) | ). Proof of Theorem 1.1.
We start by constructing G ϕ from G , which may bedone by finding a vertex cover in time O (2 k · n ), dividing vertices into at most2 k + k types (in linear time once we have a vertex cover) and keeping at most2 q S + m q v vertices in each type.Now for each pre-evaluation α : l ( ϕ ) → { tt , ff } we do the following: Werun the trivial recursive MSO model checking algorithm on G ϕ , by trying allpossible assignments of vertices of G ϕ to set and vertex variables. Each time wefind a satisfying assignment, we remember the values of the prefix variables Z ,and proceed to finding the next satisfying assignment. Since the prefix variables7f ϕ (and α ( ϕ )) are existentially quantified, their value is fixed before α ( ϕ ) startsbeing evaluated and therefore is the same at any point of evaluating α ( ϕ ). Atthe end of this stage we end up with at most (2 | V ( G ϕ ) | ) m different satisfyingprefix assignments of Z , . . . , Z m for each pre-evaluation α .We now need to check whether some combination of a pre-evaluation α andits satisfying prefix assignment χ ϕ from the previous step can be extended to asatisfying assignment for ϕ and G . This can be done by Lemma 3.7.To prove correctness, assume that there exists a satisfying assignment χ for G .We create G ′ ϕ by, for each T ∈ T G such that | T | > q S + m q v , inductively deletingvertices from subtypes S ⊆ T such that | S | > q s q v , until | T | = 2 q S + m q v for every T . Observe that G ′ ϕ is isomorphic to G ϕ and that there is a satisfying assignment χ ′ induced by χ on G ′ ϕ . Then applying the isomorphism to χ ′ creates a satisfyingassignment χ on G ϕ , and Lemma 3.7 ensures that our p-ILP formulation isfeasible for χ .To compute the time complexity of this algorithm, note that we first needtime O (2 k · n ) to compute G ϕ . Then for each of the 2 | l | pre-evaluations we com-pute all the satisfying prefix assignments in time 2 O ( k + qS + m ) q v by Theorem 3.2.For each of the at most (2 | V ( G ϕ ) | ) m = (2 (2 k + k ) · qS + m q v ) m satisfying prefix as-signments for G ϕ , we check whether it can be extended to an assignment for G , which can be done in time at most 2 O ( k + qS + m ) by applying Theorem 2.5on the p-ILP formulation constructed by Lemma 3.7. We therefore need time O (2 k · n ) + 2 m · (2 O ( k + qS + m ) q v + | l | + (2 (2 k + k ) · qS + m q v ) m · O ( k + qS + m ) ), and thebound follows. Remark:
The space complexity of the algorithm presented above may beimproved by successively applying Lemma 3.7 to each iteratively computed sat-isfying prefix assignment (for each pre-evaluation).Before moving on to the next section, we show how these results can be ex-tended towards well-structured dense graphs. It is easy to verify that the onlyreference to an actual vertex cover of our graph is in Theorem 3.2 – all otherproofs rely purely on bounding the number of types. In [15] Lampis also con-sidered a new parameter called neighborhood diversity , which is the number ofdifferent types of a graph. I.e. graph G has neighborhood diversity k iff |T G | = k .Since there exist classes of graphs with unbounded vertex cover but boundedneighborhood diversity (for instance the class of complete graphs), parameter-izing by neighborhood diversity may in some cases lead to better results thanusing vertex cover. Corollary 3.8.
There exists an algorithm which, given a graph G with neighbor-hood diversity k and a cardMSO formula ϕ with q variables, decides if G | = ϕ in time k O ( q ) + | ϕ | + k · poly ( | V ( G ) | ) . Proof.
The proof is nearly identical to the proof of Theorem 1.1. The onlychange is that we begin by computing the neighborhood diversity and the asso-ciated partition into types (which may be done in polynomial time, cf. Theorem8 in [15]), and we of course use the fact that the number of types is now at most k instead of 2 k + k . Perhaps the most natural class of problems which may be captured by cardMSO but not by MSO (or even MSO ) are equitable problems. Equitable problemsgenerally ask for a partitioning of the graph into a (usually fixed) number ofspecific sets of equal ( ±
1) cardinality.
Equitable c-coloring [18] is probably the most extensively studied example of anequitable problem. It asks for a partitioning of a graph into c equitable indepen-dent sets and has applications in scheduling, garbage collection, load balancingand other fields (see e.g. [5,3]). While even equitable 3-coloring is W[1]-hard ongraphs of bounded tree-width [8], equitable c-coloring may easily be expressedin cardMSO : ∃ A, B, C : partition ( A, B, C ) ∧∀ x, y : (( x, y ∈ A ∨ x, y ∈ B ∨ x, y ∈ C ) = ⇒ ¬ adj ( x, y )) ∧ equi ( A, B ) ∧ equi ( A, C ) ∧ equi ( B, C ), where • partition ( A, B, C ) = (cid:0) ∀ x : ( x ∈ A ∨ ¬ x ∈ B ∨ ¬ x ∈ C ) ∧ ( ¬ x ∈ A ∨ x ∈ B ∨ ¬ x ∈ C ) ∧ ( ¬ x ∈ A ∨ ¬ x ∈ B ∨ x ∈ C ) (cid:1) . • equi ( T, U ) = ( (cid:2) | T | = | U | + 1 (cid:3) ∨ (cid:2) | T | + 1 = | U | (cid:3) ∨ (cid:2) | T | = | U | (cid:3) ). Equitable connected c-partition [6] is another studied equitable problem which isknown to be W[1]-hard even on graphs of bounded path-width but which admitsa simple description in cardMSO : ∃ A, B, C : partition ( A, B, C ) ∧ conn ( A ) ∧ conn ( B ) ∧ conn ( C ) ∧ equi ( A, B ) ∧ equi ( A, C ) ∧ equi ( B, C ), where • conn ( U ) = (cid:0) ∀ T : ( ∀ x : x ∈ T = ⇒ x ∈ U ) = ⇒ ( T = U ∨ ( ¬∃ a : a ∈ T ) ∨ ∃ a, b : a ∈ U ∧ ¬ a ∈ T ∧ b ∈ T ∧ adj ( a, b ) (cid:1) . cardMSO allows us to restrict the set cardinalities by constants given as partof the input. For instance, the formula below expresses the existence of an Inde-pendent Dominating Set of cardinality k : ∃ X : ( ∀ a, b ∈ X. ¬ adj ( a, b )) ∧∧ ( ∀ b ∈ V.b ∈ X ∨ ( ∃ a ∈ X. adj ( a, b ))) ∧ [ | X | = k ]Notice that there is an equivalent MSO formula for any fixed k . However,the number of variables in the MSO formula would depend on k , which wouldnegatively impact on the runtime of model checking. On the other hand, usingan input-specified variable only requires us to change a constant in the p-ILPformulation, with no impact on runtime.9 .3 c-balanced partitioning Finally, we show an example of how our approach can be used to obtain newresults even for optimization problems, which are (by definition) not expressibleby cardMSO . While the presented algorithm does not rely directly on Theorem1.1, it is based on the same fundamental ideas.The problem we focus on is c -balanced partitioning, which asks for a parti-tion of the graph into c equitable sets such that the number of edges betweendifferent sets is minimized. The problem was first introduced in [17], has appli-cations in parallel computing, electronic circuit design and sparse linear solversand has been studied extensively (see e.g. [7,2]). The problem is notoriously hardto approximate, and while an exact XP algorithm exists for the c -balanced par-titioning of trees parameterized by c [7,17], no parameterized algorithm is knownfor graphs of bounded tree-width. Theorem 4.1.
There exists an algorithm which, given a graph G with vertexcover of size k and a constant c , solves c -balanced partitioning in time O ( k + c ) +2 k | V ( G ) | . Proof.
We begin by applying the machinery of Theorem 1.1 to the cardMSO formula ϕ for equitable c -partitioning ϕ : ∃ A, B, C : partition ( A, B, C ) ∧ equi ( A, B ) ∧ equi ( A, C ) ∧ equi ( B, C )Recall that this means trying all possible assignments of the c set variablesin G ϕ and testing whether each assignment can be extended to G in a mannersatisfying ϕ . Unlike in Theorem 1.1 though, we need to tweak the p-ILP formu-lations to not only check the existence of an extension χ for our pre-evaluation α , but also to find the χ which minimizes the size of the cut between vertex sets.To do so, we add one variable β into the formulation and use a p-OPT-ILPformulation minimizing β . We also add a single equality into the formulationto make β equal to the size of the cut between the c vertex sets. While it isnot possible to count the edges directly, the fact that we always have a fixedsatisfying prefix assignment in G ϕ allows us to calculate β as: β = const + P S ∈ U const S x S , where – const is the number of edges between all pairs of cover vertices with differenttypes (this is obtained from the prefix assignment in G ϕ ), – U is the set of subtypes which do not contain cover vertices (recall that eachcover vertex has its own subtype), – x S is the ILP variable for the cardinality of subtype S (cf. Lemma 3.7), – For each subtype S , const S is the number of adjacent vertices in the coverassigned to a different vertex set than S . The values of const S depend onlyon the subtype S and the chosen prefix assignment χ ϕ in G ϕ .For each satisfying prefix assignment χ ϕ in G ϕ , the p-OPT-ILP formulationwill not only check that this may be extended to an assignment χ in G , but also10nd the assignment in G which minimizes β . All that is left is to store the bestcomputed β for each satisfying prefix assignment and find the satisfying prefixassignment with minimum β after the algorithm from Theorem 1.1 finishes.For correctness, assume that there exists a solution which is smaller thanthe minimal β found by the algorithm. Such a solution would correspond to anassignment of ϕ in G , which may be reduced to a prefix assignment χ of a pre-evaluation α ( ϕ ) in G ϕ . If we construct the p-ILP formulation for χ and α ( ϕ ),then the obtained β would equal the size of the cut. However, our algorithmcomputes the β for all pre-evaluations and satisfying prefix assignments in G ϕ ,so this gives a contradiction. The MSO (or MSO ) partitioning framework was introduced by Rao in [19]and allows the description of many problems which cannot be formulated inMSO, such as Chromatic number, Domatic number, Partitioning into Cliquesetc. While a few of these problems (e.g. Chromatic number) may be solvedon graphs of bounded tree-width in FPT time by using additional structuralproperties of tree-width, MSO partitioning problems in general are W[1]-hardon such graphs. Definition 5.1 (MSO partitioning).
Given a MSO formula ϕ , a graph G and an integer r , can V ( G ) be partitioned into sets X , X , . . . X r such that ∀ i ∈ { , , . . . , r } : X i | = ϕ ?Similarly to Section 3, we will show that a combination of ILP and MSOmodel checking allows us to design efficient FPT algorithms for MSO partitioningproblems on graphs of bounded vertex cover. However, here the total number ofsets is specified on the input and so the number of subtypes is not fixed, whichprevents us from capturing the cardinality of subtypes by ILP variables. Insteadwe use the notion of shape : Definition 5.2.
Given a graph G and a MSO formula ϕ with q S , q v set andvertex variables respectively, two sets A, B ⊆ V ( G ) have the same shape iff foreach type T it holds that either | A ∩ T | = | B ∩ T | or both | A ∩ T | , | B ∩ T | > q S q v . Let A be any set of shape s . We define | s ∩ T | , for any type T , as: | s ∩ T | = ( | A ∩ T | if | A ∩ T | ≤ q S q v ⊤ otherwiseSince ϕ is a MSO formula, from Lemma 3.1 we immediately get: (5.3) For any two sets
A, B ⊆ V ( G ) of the same shape, it holds that A | = ϕ iff B | = ϕ , and 11 Given a MSO formula with q variables, a graph G with vertex cover ofsize k has at most (2 q S q v ) k + k distinct shapes.With these in hand, we may proceed to: Proof of Theorem 1.2.
First, we consider all at most (2 q S q v ) k + k shapes ofa set X . For each such shape s , we decide whether a set X s of shape s satisfies ϕ by Theorem 3.2. We then create an ILP formulation with one variable x s foreach shape s satisfying ϕ . The purpose of x s is to capture the number of sets X s of shape s in the partitioning of G .Two conditions need to hold for the number of sets of various shapes. First,the total number of sets needs to be r . This is trivial to model in our formulationby simply adding the constraint that the sum of all x s equals r .Second, it must be possible to map each vertex in G to one and only one set X (to ensure that the sets form a partition). Notice that if a partition were toonly contain shapes with at most 2 q S q v vertices in each T , then the cardinalityof s ∩ T would be fixed and so the following set of constraints for each T ∈ T would suffice: P ∀ s x s · | s ∩ T | = | T | However, in general the partition will also contain shapes with more than2 q S q v vertices in T , and in this case we do not have access to the exact cardinalityof their intersection with T . To this end, for each T ∈ T we add the followingtwo sets of constraints:a) P ∀ s : | s ∩ T |≤ qS q v x s · | s ∩ T | + P ∀ s : | s ∩ T | = ⊤ x s · (2 q S q v ) ≤ | T | b) P ∀ s : | s ∩ T |≤ qS q v x s · | s ∩ T | + P ∀ s : | s ∩ T | = ⊤ x s · | T | ≥ | T | Here a) ensures that a partitioning of G into P ∀ s x s sets of shape s can “fit”into each T and b) ensures that there are no vertices which cannot be mapped toany set. Notice that if the partition contains any shape s which intersects with T in over 2 q S q v vertices then b) is automatically satisfied, since all unmappedvertices in T can always be added to s without changing X s | = ϕ .If the p-ILP formulation specified above has a feasible solution, then we canconstruct a solution to ( ϕ, r ) on G by partitioning G as follows: For each shape s we create sets X s, . . . X s,x s . Then in each type T in G , we map | T ∩ s | yet-unmapped vertices to each set X s,i . Constraints a) make sure this is possible. Ifthere are any vertices left unmapped in T , then due to constraint b) there mustexist some set X ′ such that | X ′ ∩ T | > q S q v . We map the remaining unmappedvertices in T to any such set X ′ , resulting in a partition of G . Finally, the factthat each of our sets satisfies ϕ follows from our selection of shapes.On the other hand, if a solution to ( ϕ, r ) on G exists, then surely each set inthe partition has some shape and so it would be found by the p-ILP formulation.The total runtime is the sum of finding the vertex cover, the time of model-checking all the shapes and the runtime of p-ILP, i.e. O (2 k | V ( G )) + 2 O ( k + q ) · q (2 k + k ) + q (2 k + k ) · q O (2 k + k ) . 12heorem 1.2 straightforwardly extends to neighborhood diversity as well.Directly bounding the number of types by k results in a bound of (2 q S q v ) k onthe number of distinct shapes in Claim 5.4, and so we get: Corollary 5.5.
There exists an algorithm which, given a graph G with neighbor-hood diversity at most k and a MSO partitioning instance ( ϕ, r ) with q variables,decides if G | = ( ϕ, r ) in time O ( qk ) · | ( ϕ, r ) | + k | V ( G ) | . The article provides two new meta-theorems for graphs of bounded vertex cover.Both considered formalisms can describe problems which are W[1]-hard ongraphs of bounded clique-width and even tree-width. On the other hand, weprovide FPT algorithms for both cardMSO and MSO partitioning which havean elementary dependence on both the formula and parameter (as opposed tothe results of Courcelle et al. for tree-width).The obtained time complexities are actually fairly close to the lower boundsprovided in [15] for MSO model checking (already 2 o ( k + q ) · poly ( n ) would violateETH); this is surprising since the considered formalisms are significantly morepowerful than MSO . Our methods may also be of independent interest, as theyshow how to use p-ILP as a powerful tool for solving general model checkingproblems.Let us conclude with future work and possible extensions of our results. Ascorrectly observed by Lampis in [15], any MSO formula can be expressed byMSO on graphs of bounded vertex cover. This means that an (appropriatelydefined) cardMSO or MSO partitioning formula could be translated to anequivalent cardMSO or MSO partitioning formula on graphs of bounded vertexcover. However, the details of these formalisms would need to be laid out infuture work.Another direction would be to extend the results of Theorems 1.1 and 1.2to more general parameters, such as twin-cover [12] or shrub-depth [13]. Finally,it would be interesting to extend cardMSO to capture more hard problems.Theorem 4.1 provides a good indication that the formalism could be adapted toalso describe a number of optimization problems on graphs. References
1. A. Adiga, R. Chitnis, and S. Saurabh. Parameterized algorithms for boxicity. In
ISAAC (1) , pages 366–377, 2010.2. K. Andreev and H. R¨acke. Balanced graph partitioning.
Theory Comput. Syst. ,39(6):929–939, 2006.3. J. Bazewicz and E. Al.
Scheduling Computer and Manufacturing Processes .Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2nd edition, 2001.4. B. Courcelle, J. A. Makowsky, and U. Rotics. Linear time solvable optimizationproblems on graphs of bounded clique-width.
Theory Comput. Syst. , 33(2):125–150, 2000. . S. K. Das, I. Finocchi, and R. Petreschi. Conflict-free star-access in parallel memorysystems. J. Parallel Distrib. Comput. , 66(11):1431–1441, Nov. 2006.6. R. Enciso, M. R. Fellows, J. Guo, I. Kanj, F. Rosamond, and O. Such´y. What makesequitable connected partition easy. In
Parameterized and Exact Computation ,pages 122–133. Springer-Verlag, 2009.7. A. E. Feldmann and L. Foschini. Balanced Partitions of Trees and Applications.In
STACS 2012 , volume 14 of
Leibniz International Proceedings in Informatics(LIPIcs) , pages 100–111, Dagstuhl, Germany, 2012. Schloss Dagstuhl.8. M. Fellows, F. V. Fomin, D. Lokshtanov, F. Rosamond, S. Saurabh, S. Szeider,and C. Thomassen. On the complexity of some colorful problems parameterizedby treewidth. In
COCOA’07 , pages 366–377. Springer-Verlag, 2007.9. M. R. Fellows, D. Lokshtanov, N. Misra, F. A. Rosamond, and S. Saurabh. Graphlayout problems parameterized by vertex cover. In
ISAAC (1) , pages 294–305.Springer-Verlag, 2008.10. J. Fiala, P. A. Golovach, and J. Kratochv´ıl. Parameterized complexity of coloringproblems: Treewidth versus vertex cover.
Theor. Comput. Sci. , 412(23):2513–2523,2011.11. A. Frank and ´E. Tardos. An application of simultaneous diophantine approxima-tion in combinatorial optimization.
Combinatorica , 7(1):49–65, 1987.12. R. Ganian. Twin-cover: Beyond vertex cover in parameterized algorithmics. In
IPEC , number 7112 in LNCS, 2011.13. R. Ganian, P. Hlinˇen´y, J. Neˇsetˇril, J. Obdrˇz´alek, P. O. de Mendez, and R. Ra-madurai. When trees grow low: Shrubs and fast MSO . In MFCS’12 , volume 7464of
LNCS , pages 419–430. Springer, 2012.14. R. Kannan. Minkowski’s convex body theorem and integer programming.
Math.Oper. Res. , 12:415–440, 1987.15. M. Lampis. Algorithmic meta-theorems for restrictions of treewidth.
Algorithmica ,64(1):19–37, 2012.16. H. Lenstra. Integer programming with a fixed number of variables.
Math. Oper.Res. , 8:538–548, 1983.17. R. M. MacGregor.
On partitioning a graph: a theoretical and empirical study . PhDthesis, University of California, Berkeley, 1978.18. W. Meyer. Equitable coloring.
American Mathematical Monthly , 80:920–922, 1973.19. M. Rao. MSOL partitioning problems on graphs of bounded treewidth and clique-width.
Theoret. Comput. Sci. , 377:260–267, 2007., 377:260–267, 2007.