1 Introduction
The objective of many problems that can be modeled as graphs is finding a group of vertices that together satisfy some property. In this respect, one of the concepts that has been quite extensively studied is the notion of a defensive alliance [28, 27], which is a set of vertices such that for each element at least half of its neighbors are also in the alliance. The name “defensive alliance” stems from the intuition that the neighbors of an element that are also in the alliance can help out in case is attacked by its other neighbors.
Notions like this can be applied to finding groups of nations, companies or individuals that depend on each other, but also to more abstract situations like finding groups of websites that form communities [18]. Another possible application for defensive alliances are computer networks, where a defensive alliance represents computers that can provide a certain desired resource; any computer in an alliance can then, with the help of its neighbors that are also in the alliance, allow access to this resource from all of its neighbors simultaneously [20].
Several variants of defensive alliances have also been studied. The papers that originally proposed defensive alliances also propose related notions like offensive and powerful alliances. An offensive alliance is a set of vertices such that every neighbor of an element of has at least half of its neighbors in , and a powerful alliance is both a defensive and an offensive alliance. Any of these alliances is called global if it is at the same time a dominating set. Another variant is to consider alliances where, for each vertex , the difference between the number of neighbors of in and the number of other neighbors of is at most a given integer [31]. For comprehensive overviews of different kinds of alliances in graphs, we refer to the surveys [34, 17].
The Defensive Alliance problem can be specified as follows: Given a graph and an integer , is there a defensive alliance in such that ? It is known that this problem is complete [22, 23], and so is the corresponding problem for global defensive alliances [9]. However, if we restrict ourselves to trees, Defensive Alliance becomes trivial and in fact the corresponding problems for several nontrivial variants become solvable in linear time [22].
There has also been some work on the parameterized complexity of alliance problems. In particular, determining whether a defensive, offensive and powerful alliance of a given (maximum) size exists is fixedparameter tractable when parameterized by the solution size [16, 15]. Also structural parameters have been considered to some extent. Recently, [24] proved that these problems can be solved in polynomial time if the cliquewidth of the instances is bounded by a constant. The authors also provide an FPT algorithm when the parameter is the size of the smallest vertex cover. Moreover, [15] showed that the decision problems for defensive alliances and global defensive alliances are fixedparameter tractable when parameterized by the combination of treewidth and maximum degree. Despite these advances regarding, the question of whether or not Defensive Alliance parameterized by treewidth is fixedparameter tractable has so far remained open.
Treewidth [30, 5, 7] is one of the most extensively studied structural parameters and indicates how close a graph is to being a tree. It is particularly attractive because many hard problems become tractable on instances of bounded treewidth, and in several practical applications it has been observed that the considered problem instances exhibit small treewidth [5, 33, 26]. Hence it would be very appealing to obtain an FPT algorithm for the Defensive Alliance problem using this parameter.
The main contribution of this paper is a parameterized complexity analysis of Defensive Alliance with treewidth as the parameter. The question of whether or not this problem is fixedparameter tractable when parameterized by treewidth has so far been unresolved [24]. In the current chapter, we provide a negative answer to this question: We show that the problem is hard for the class , which rules out fixedparameter tractable algorithms under commonly held complexitytheoretic assumptions. This result is rather surprising for two reasons: First, the problem is tractable on trees [22] and quite often problems that become easy on trees turn out to become easy on graphs of bounded treewidth.^{2}^{2}2To be precise, [22, 21, 10] show that some variants of Defensive Alliance are tractable on trees, since Defensive Alliance on trees is trivial. Second, this puts Defensive Alliance among the very few “subset problems” that are fixedparameter tractable w.r.t. solution size but not w.r.t. treewidth. Problems with this kind of behavior are rather rare, as observed by Dom et al. [13].
We show hardness of the problem by first reducing a problem known to be hard to a variant of Defensive Alliance, where vertices can be forced to be in or out of every solution, and pairs of vertices can be specified to indicate that every solution must contain exactly one element of each such pair. In order to prove the desired complexity result, we then successively reduce this variant to the standard Defensive Alliance problem.
At the same time, we show hardness for the exact variants of these problems, where we are interested in defensive alliances exactly of a certain size. Note that a set may lose the property of being a defensive alliance by adding or removing elements, so these are nontrivial problem variants. Indeed, exact versions of alliance problems have also been mentioned as interesting variants in [16] because some algorithms that work for the nonexact case stop to work for the exact case: A graph has a defensive alliance of size at most if and only if it has a connected defensive alliance of size at most since every component of a defensive alliance is itself a defensive alliance. Algorithms that exploit this by looking only for connected solutions hence fail for the exact versions. (In fact, we will also study the complexity of other problem variants where this connectedness property does not apply even in the nonexact case.)
This paper is organized as follows: We first introduce our problems of interest and describe preliminary concepts in Section 2. In Section 3 we then show that the Defensive Alliance problem is hard when parameterized by treewidth. Section 4 concludes the paper with a discussion.
The reductions in the current work are based on ideas used in the paper [4], which analyzed the complexity of a problem related to Defensive Alliance called Secure Set. That paper has since been extended by a hardness proof for the Secure Set problem parameterized by treewidth [3]. In the current paper, we take up the ideas behind this hardness proof and apply them to the Defensive Alliance problem. Due to the different nature of these two problems, the reductions and proofs for Secure Set do not work directly for Defensive Alliance but require substantial modifications.
2 Background
All graphs are undirected and simple unless stated otherwise. We denote the set of vertices and edges of a graph by and , respectively. We denote an undirected edge between vertices and as or equivalently . It will be clear from the context whether an edge is directed or undirected. Given a graph , the open neighborhood of a vertex , denoted by , is the set of all vertices adjacent to , and is called the closed neighborhood of . If it is clear from the context which graph is meant, we write and instead of and , respectively.
The intuition behind defensive alliances is the following: If we consider a set of vertices as “good” vertices and all other vertices as “bad” ones, then being a defensive alliance means that each element of has at least as many “good” neighbors as “bad” neighbors.
Definition 1.
Given a graph , a set is a defensive alliance in if for each it holds that .
We often write “ is a defensive alliance” instead of “ is a defensive alliance in ” if it is clear from the context which graph is meant. By definition, the empty set is a defensive alliance in any graph. Thus, in the following decision problems we ask for a defensive alliances of size at least 1.
For example, in Figure 1, the set is a defensive alliance as holds for each . Note that, for instance, is no defensive alliance since is attacked by three vertices but only has the neighbor to help defend itself.
Next we introduce several variants of Defensive Alliance that we require in our proofs. The problem Defensive Alliance^{F} generalizes Defensive Alliance by designating some “forbidden” vertices that may never be in any solution. This variant can be formalized as follows:
Defensive Alliance^{F} [topsep=1mm,itemsep=1mm] A graph , an integer and a set Does there exist a set with that is a defensive alliance?
Defensive Alliance^{FN} is a further generalization that, in addition, allows “necessary” vertices to be specified that must occur in every solution.
Defensive Alliance^{FN} [topsep=1mm,itemsep=1mm] A graph , an integer , a set and a set Does there exist a set with and that is a defensive alliance?
Finally, we introduce the generalization Defensive Alliance^{FNC}. Here we may state pairs of “complementary” vertices where each solution must contain exactly one element of every such pair.
Defensive Alliance^{FNC} [topsep=1mm,itemsep=1mm] A graph , an integer , a set , a set and a set Does there exist a set with and that is a defensive alliance and, for each pair , contains either or ?
For our results on the parameter treewidth, we need a way to represent the structure of a Defensive Alliance^{FNC} instance by a graph that augments with the information in :
Definition 2.
Let be a Defensive Alliance^{FNC} instance, let be the graph in and let the set of complementary vertex pairs in . By the primal graph of we mean the undirected graph with and .
When we speak of the treewidth of an instance of Defensive Alliance, Defensive Alliance^{F} or Defensive Alliance^{FN}, we mean the treewidth of the graph in the instance. For an instance of Defensive Alliance^{FNC}, we mean the treewidth of the primal graph.
While the Defensive Alliance problem asks for defensive alliances of size at most , we also consider the Exact Defensive Alliance problem that concerns defensive alliances of size exactly . Analogously, we also define exact versions of the three generalizations of Defensive Alliance presented above.
In this paper’s figures, we often indicate necessary vertices by means of a triangular node shape, and forbidden vertices by means of either a square node shape or a superscript square in the node name. If two vertices are complementary, we often express this in the figures by putting a sign between them.
For example, in Figure 2, the vertices and are complementary and occur in no solution together; and the “anonymous” vertex adjacent to are necessary and occur in every solution; and the “anonymous” vertex adjacent to are forbidden and occur in no solution. In this figure, the unique minimum nonempty defensive alliance satisfying the conditions of forbidden, necessary and complementary vertices consists of , and the “anonymous” necessary vertex adjacent to .
The following terminology will be helpful: We often use the terms attackers and defenders of an element of a defensive alliance candidate . By these we mean the sets and , respectively. To show that an element of a defensive alliance candidate is not a counterexample to being a solution, we sometimes employ the notion of a defense of w.r.t. , which assigns to each attacker a dedicated defender: If we are able to find an injective mapping , then obviously , and we call a defense of w.r.t. . Given such a defense , we say that a defender repels an attack on by an attacker whenever . Consequentially, when we say that a set of defenders can repel attacks on from a set of attackers , we mean that there is a defense that assigns to each element of a dedicated defender in .
To warm up, we make some easy observations that we will use in our proofs. First, for every set consisting of a majority of neighbors of a vertex , whenever is in a defensive alliance, also some element of must be in it:
Observation 3.
Let be a defensive alliance in a graph, let and let . If , then contains an element of .
Proof.
Suppose that and contains no element of . Since all elements of attack , . Hence , and we obtain the contradiction . ∎
Next, if one half of the neighbors of an element of a defensive alliance attacks , then the other half of the neighbors must be in the defensive alliance:
Observation 4.
Let be a defensive alliance in a graph, let and let be partitioned into two equalsized sets . If , then .
Proof.
Since is partitioned into and such that , we get . If some element of is not in , then and . By , we get . From we now obtain the contradiction . ∎
In particular, if half of the neighbors of are forbidden, then can only be in a defensive alliance if all nonforbidden neighbors are also in the defensive alliance.
Finally, we recapitulate some background from complexity theory. In parameterized complexity theory [14, 19, 29, 11], we study problems that consist not only of an input and a question, but also of some parameter of the input that is represented as an integer. A problem is in the class (“fixedparameter tractable”) if it can be solved in time , where is the input size, is the parameter, is a computable function that only depends on , and is a constant that does not depend on or . We call such an algorithm an FPT algorithm, and we call it fixedparameter linear if . Similarly, a problem is in the class (“slicewise polynomial”) if it can be solved in time , where and are computable functions. Note that here the degree of the polynomial may depend on , so such algorithms are generally slower than FPT algorithms. For the class it holds that , and it is commonly believed that the inclusions are proper, i.e., hard problems do not admit FPT algorithms. hardness of a problem can be shown using FPT reductions, which are reductions that run in FPT time and produce an equivalent instance whose parameter is bounded by a function of the original parameter.
For problems whose input can be represented as a graph, one important parameter is treewidth, which is a structural parameter that, roughly speaking, measures the “treelikeness” of a graph. It is defined by means of tree decompositions, originally introduced in [30]. The intuition behind tree decompositions is to obtain a tree from a (potentially cyclic) graph by subsuming multiple vertices under one node and thereby isolating the parts responsible for cyclicity.
Definition 5.
A tree decomposition of a graph is a pair where is a (rooted) tree and assigns to each node of a set of vertices of (called the node’s bag), such that the following conditions are met:

For every vertex , there is a node such that .

For every edge , there is a node such that .

For every , the subtree of induced by is connected.
We call the width of . The treewidth of a graph is the minimum width over all its tree decompositions.
In general, constructing an optimal tree decomposition (i.e., a tree decomposition with minimum width) is intractable [1]. However, the problem is solvable in linear time on graphs of bounded treewidth (specifically in time , where is the treewidth) [6]
and there are also heuristics that offer good performance in practice
[12, 8].In this paper we will consider socalled nice tree decompositions:
Definition 6.
A tree decomposition is nice if each node is of one of the following types:

Leaf node: The node has no child nodes.

Introduce node: The node has exactly one child node such that consists of exactly one element.

Forget node: The node has exactly one child node such that consists of exactly one element.

Join node: The node has exactly two child nodes and with .
Additionally, the bags of the root and the leaves of are empty.
A tree decomposition of width for a graph with vertices can be transformed into a nice one of width with nodes in fixedparameter linear time [25].
For any tree decomposition and an element of some bag in , we use the notation to denote the unique “topmost node” whose bag contains (i.e., does not have a parent whose bag contains ). Figure 3 depicts a graph and a nice tree decomposition, where we also illustrate the notation.
When we speak of the treewidth of an instance of Defensive Alliance, Defensive Alliance^{F}, Defensive Alliance^{FN}, Exact Defensive Alliance, Exact Defensive Alliance^{F} or Exact Defensive Alliance^{FN}, we mean the treewidth of the graph in the instance. For an instance of Defensive Alliance^{FNC} or Exact Defensive Alliance^{FNC}, we mean the treewidth of the primal graph.
3 Hardness of Defensive Alliance Parameterized by Treewidth
In this section, we prove the following theorem:
Theorem 7.
The following problems are all hard when parameterized by treewidth: Defensive Alliance, Exact Defensive Alliance, Defensive Alliance^{F}, Exact Defensive Alliance^{F}, Defensive Alliance^{FN}, Exact Defensive Alliance^{FN}, Defensive Alliance^{FNC}, and Exact Defensive Alliance^{FNC}.
We prove hardness by providing a chain of FPT reductions from a hard problem to the problems under consideration. Under the widely held assumption that , this rules out fixedparameter tractable algorithms for these problems.
3.1 Hardness of Defensive Alliance with Forbidden, Necessary and Complementary Vertices
To show hardness of Defensive Alliance^{FNC}, we reduce from the following problem [2], which is known to be hard [32] parameterized by the treewidth of the graph:
Minimum Maximum Outdegree [topsep=1mm,itemsep=1mm] A graph , an edge weighting given in unary and a positive integer Is there an orientation of the edges of such that, for each , the sum of the weights of outgoing edges from is at most ?
Lemma 8.
Defensive Alliance^{FNC} and Exact Defensive Alliance^{FNC}, both parameterized by the treewidth of the primal graph, are hard.
Proof.
Let an instance of Minimum Maximum Outdegree be given by a graph , an edge weighting in unary and a positive integer . From this we construct an instance of both Defensive Alliance^{FNC} and Exact Defensive Alliance^{FNC}. An example is given in Figure 4. For each , we define the set of new vertices , and for each , we define the sets of new vertices , , and . We now define the graph with
We also define the set of complementary vertex pairs . Finally, we define the set of necessary vertices , the set of forbidden vertices and . We use to denote , which is an instance of Defensive Alliance^{FNC} and also of Exact Defensive Alliance^{FNC}.
Clearly can be computed in polynomial time. We now show that the treewidth of the primal graph of depends only on the treewidth of . We do so by modifying an optimal tree decomposition of as follows:

For each , we take an arbitrary node whose bag contains both and and add to its children a chain of nodes such that the bag of is .

For each , we take an arbitrary node whose bag contains and add to its children a chain of nodes such that the bag of is .

For each , we take an arbitrary node whose bag contains and add to its children a chain of nodes such that the bag of is .

For each , we take an arbitrary node whose bag contains and add to its children a chain of nodes such that the bag of is .
It is easy to verify that the result is a valid tree decomposition of the primal graph of and its width is at most the treewidth of plus four.
It remains to show that our reduction is correct. Obviously is a positive instance of Defensive Alliance^{FNC} iff it is a positive instance of Exact Defensive Alliance^{FNC} because the forbidden, necessary and complementary vertices make sure that every solution of the Defensive Alliance^{FNC} instance has exactly elements. Hence we only consider Defensive Alliance^{FNC}.
The intention is that for each orientation of we have a solution candidate in such that an edge orientation from to entails and , and the other orientation entails and . For each vertex and every incident edge regardless of its orientation, the vertex is attacked by the forbidden vertices . So every vertex has as least as many attackers as the sum of the weights of all incident edges. If in the orientation of all edges incident to are incoming edges, then each attack on from can be repelled by , since . Due to the fact that the helper vertices consist of exactly elements, can afford to have outgoing edges of total weight at most .
We claim that is a positive instance of Minimum Maximum Outdegree iff is a positive instance of Defensive Alliance^{FNC}.
“Only if” direction. Let be the directed graph given by an orientation of the edges of such that for each vertex the sum of weights of outgoing edges is at most . The set is a defensive alliance in : Let be an arbitrary element of . If is an element of a set or , then the only neighbor of in is a necessary vertex, so can trivially defend itself; so suppose . Let the sum of the weights of outgoing and incoming edges be denoted by and , respectively. The neighbors of that are also in consist of the elements of and all elements of sets such that . Hence, including itself, has defenders in . The attackers of consist of all elements of sets such that (in total ) and all elements of sets such that either or (in total ). Hence has attackers in . This shows that has at least as many defenders as attackers, as by assumption . Finally, it is easy to verify that , , , and exactly one element of each pair of complementary vertices is in .
“If” direction. Let be a solution of . For every , either or due to the complementary vertex pairs. We define a directed graph by and . Suppose there is a vertex in whose sum of weights of outgoing edges is greater than . Clearly . Let the sum of the weights of outgoing and incoming edges be denoted by and , respectively. The defenders of in beside itself consist of the elements of and of neighbors due to incoming edges in . These are in total defenders. The attackers of in consist of elements (of the form as well as ) due to outgoing edges in and elements (of the form ) due to incoming edges. These are in total attackers. But then has more attackers than defenders, as by assumption . ∎
3.2 Hardness of Defensive Alliance with Forbidden and Necessary Vertices
Next we present a transformation that eliminates complementary vertex pairs by turning a Defensive Alliance^{FNC} instance into an equivalent Defensive Alliance^{FN} instance. Along with , we define a function , for each Defensive Alliance^{FNC} instance , such that the solutions of are in a onetoone correspondence with those of in such a way that any two solutions of have the same size iff the corresponding solutions of have the same size. We use these functions to obtain a polynomialtime reduction from Defensive Alliance^{FNC} to Defensive Alliance^{FN} as well as from Exact Defensive Alliance^{FNC} to Exact Defensive Alliance^{FN}.
Before we formally define our reduction, we briefly describe the intuition behind the used gadgets. The gadget in Figure 5 adds neighbors to every vertex , which are so many that can only be in a solution if some of the new neighbors are also in the solution. The new vertices are structured in such a way that every solution must in fact either contain all of or none of them. Next, the gadget in Figure 6 is added for every complementary pair . This gadget is constructed in such a way that every solution must either contain all of or none of them, and the same holds for . By making the vertex necessary, every solution must contain one of these two sets. At the same time, the bound on the solution size makes sure that we cannot afford to take both sets for any complementary pair.
Definition 9.
We define a function , which assigns a Defensive Alliance^{FN} instance to each Defensive Alliance^{FNC} instance . For this, we use to denote and first define a function
For each , we introduce the following sets of new vertices.
Next, for each , we introduce new vertices , and as well as, for any , the following sets of new vertices.
We use the notation to denote the set of edges .
Lemma 10.
Let be a Defensive Alliance^{FNC} instance, let be the set of solutions of and let be the set of solutions of the Defensive Alliance^{FN} instance . There is a bijection such that holds for every .
Proof.
We use the same auxiliary notation as in Definition 9 and we define as . For every , we thus obtain , and we first show that indeed .
Let and let denote . Obviously satisfies and . To see that is a defensive alliance in , let be an arbitrary element of . If , then clearly has as least as many neighbors in as neighbors not in by construction of , so suppose . There is a defense since is a defensive alliance in . We use this to construct a defense . For any attacker of in , we distinguish two cases.

If is some for some , we set . This element is in by construction.

Otherwise is in (by our construction of ). Since the codomain of is a subset of the codomain of , we may set .
Since is injective, each attack on in can be repelled by . Hence is a defensive alliance in .
Clearly is injective. It remains to show that is surjective. Let be a solution of . First we make the following observations for each :

If , then due to Observation 3, since contains a majority of neighbors of , and the vertices in are forbidden.

For each , where such that or , it holds that again due to Observation 3.

If contains an element of , then by repeated applications of Observation 4. To see this, note in particular that can be partitioned into the two equalsized sets and , and all vertices in the latter set are forbidden.

If contains an element of , where such that or , then for similar reasons.
It follows that for each , contains either all or none of .
For every , contains or , since , whose neighbors are and . It follows that even if contains only one of each . If, for some , contained both and , we could derive a contradiction to because then . So contains either or for any .
We construct and observe that , , , and for each . It remains to show that is a defensive alliance in . Let be an arbitrary element of . We observe that and similarly . Since the cardinality of each set is equal to the cardinality of , this implies . Since is a defensive alliance in and , it holds that . We conclude that . Hence is a defensive alliance in . ∎
To obtain the hardness result for Defensive Alliance^{FN} parameterized by treewidth, it remains to show that the reduction specified by preserves bounded treewidth.
Lemma 11.
Defensive Alliance^{FN}, parameterized by the treewidth of the graph, is hard.
Proof.
Let be a Defensive Alliance^{FNC} instance whose primal graph we denote by . We obtain an equivalent Defensive Alliance^{FN} instance , whose graph we denote by . This reduction is correct, as shown in Lemma 10. It remains to show that the treewidth of is bounded by a function of the treewidth of . Let be an optimal nice tree decomposition of . We build a tree decomposition of by modifying a copy of in the following way: For each vertex