Extending Courcelle's Theorem with Optimality Predicates
Courcelle's theorem and its optimization variants yield fixed-parameter tractable algorithms for a wide range of graph problems on graphs of bounded treewidth or clique-width. However, the limited counting power of $\mathsf{CMSO}$ poses an obstacle to capturing certain optimization problems and properties within this framework. We introduce a new logic $\mathsf{AmCMSO}$, which extends $\mathsf{CMSO}$ with predicates for membership in the families of minimum- and maximum-cardinality sets satisfying a fixed formula $ϕ(X)$. In contrast to most previous extensions of $\mathsf{CMSO}$ with cardinality constraints, we give algorithmic meta-theorems based on fixed-parameter tractable model checking for $\mathsf{AmCMSO}_1$ parameterized by clique-width and the formula, and for $\mathsf{AmCMSO}_2$ parameterized by treewidth and the formula. Our proof is based on the combination of Feferman--Vaught-type decomposition and fundamental techniques for dynamic programming. The meta-theorems yield fixed-parameter tractable algorithms for a wide range of optimization problems involving optimal solutions, including network interdiction, pre-assignment for solution uniquification, and diversity maximization, without parameterizing by the optimum value. Finally, allowing an optimality predicate to depend on even one external set variable makes model checking hard for every level of the polynomial hierarchy, already on trees of depth four.