1 Introduction

During the past decade, the study of spreading processes in complex networks has experienced a particular surge of interest across many research areas from viral marketing, to social media, to population epidemics. Several studies have focused on the problem of finding a small set of individuals who, given the item to be diffused, allow its diffusion to a vast portion of the network, by using the links among individuals in the network to transmit the item to their contacts [39].

Threshold models, where each node has a threshold that measures the node resistance to diffusion, are widely adopted by sociologists to describe collective behaviors [28], and their use to study the propagation of innovations through a network was first considered in [31]. The linear threshold model has then been widely used in the literature to study the problem of influence maximization, which aims at identifying a small subset of nodes that can maximize influence diffusion [3, 8, 9, 11,12,13, 31]. The related Target set selection problem, which aims at selecting the smallest possible set of nodes, whose activation eventually leads to influencing all the nodes in the network, has also been widely studied; see for example [3, 7, 10, 24, 31].

Recently, with the aim of keeping under control the spread of harmful items in networks, some attention has been devoted to the important issue of developing strategies for reducing the spread of negative things through a network. The problem is motivated by its ability to model complex phenomena such as the proliferation of disease contagion or the spread of false news. In particular, several studies considered the problem of which structural changes (immunization measures) can be made to the network topology in order to block, or limit as much as possible, negative diffusion processes.

One such measure consists in intervening on the network topology by either blocking some links so that they cannot contribute to the diffusion process [33] or by immunizing some nodes [20]. In this paper, we focus on the second strategy: Limit the spread to a small region of the network by immunizing a bounded number of nodes in the network. We study the problem in the linear threshold model [31]. A node gets influenced/contaminated if it receives the item from a number of neighbors at least equal to its threshold. The diffusion proceeds in rounds: Initially only a subset of nodes has the item and is contaminated. At each round, the set of contaminated nodes is augmented with each node that has a number of already contaminated neighbors at least equal to its threshold.

In the presence of an immunization campaign, the immunization operation on a node inhibits the contamination of the node itself. Thus, given a network and a subset of its nodes, called spreader set, that has the malicious item to be diffused to the other nodes in the network, we are looking for a small subset of nodes (immunizing set) that, once immunized, enable to minimize the number of nodes influenced at the end of the diffusion process.

Under such a diffusion model, we perform a broad parameterized complexity study of the following Influence-Immunization problem:

Given a network, a spreader set, and two integers k and \(\ell \), is it possible to limit the diffusion to at most k other nodes of the network by immunizing at most \(\ell \) nodes?

We study the parameterized complexity of the Influence-Immunization problem, formally defined in Sect. 3. Parameterized complexity is a refinement of classical complexity theory in which one takes into account not only the input size but also other aspects of the problem given by a parameter p [18, 41]. We recall that a problem with input size n and parameter p is called fixed parameter tractable (FPT) if it can be solved in time \(f(p) \cdot n^c\), where f is a computable function only depending on p and c is a constant. On the other hand, the theory of fixed parameter intractability defined the W-hierarchy \(\bigcup _{t\ge 0} W[t],\) where \(FPT=W[0]\subseteq W[1]\subseteq \ldots \subseteq W[poly],\) to characterize the inherent level of intractability for parameterized problems [18]. For instance, the W[1]-hardness of a parameterized problem provides a strong evidence that the problem is not solvable in time \(f(p) \cdot n^{O(1)},\) for any function f of the parameter p.

Our Results

We consider several parameters associated to the input: the bounds k and \(\ell \), the number \(\zeta \) related to initially contaminated nodes, and some parameters of the underlying network: The maximum degree \(\Delta \), the treewidth tw [42], and the neighborhood diversity nd [37]. The two last parameters, formally defined in Sects. 4.4 and 4.5 respectively, are two incomparable parameters of a graph that can be viewed as representing sparse and dense graphs, respectively [37]; they received much attention in the literature [3, 13, 14, 26, 27, 35].

We shall prove that the studied Influence-Immunization problem is:

  • W[1]-hard with respect to any of the parameters k, \(\mathtt{{tw}}\) or \(\mathtt{{nd}}\);

  • W[2]-hard with respect to the pairs (\(\ell \), \(\Delta \)), or \((\ell , \zeta )\) where \(\zeta = |\{v \mid v\in V, \ t(v)=0\}|\);

  • FPT with respect to any of the pairs \((k,\ell ),\) \((k, \zeta ),\) \((k,\mathtt{{tw}}),\) \((\Delta ,\mathtt{{tw}}),\) \({(k,\mathtt{{nd}}), (\ell ,\mathtt{{nd}})}\).

2 Related Work

Several studies highlighted how the spread of epidemics is strongly influenced by the network structure and, consequently, a smart manipulation of the network enables maximizing/minimizing the node influenced at the end of a given diffusion process [5, 21].

Influence maximization/minimization has also been addressed from the game theoretic perspective in [4, 6, 38]. Bhawalkar et al. [4] introduced a problem strongly related to the Target set selection with fixed threshold k. The problem, named Anchored k-Core, assumes that at the beginning of the process all the nodes are engaged/influenced but each node remains engaged only if it maintains at least k engaged neighbors. The model enable to anchor a node. Anchored nodes remain engaged no matter what their friends do. Given a budget b the goal is to select a set of nodes (anchored nodes) to maximize the amount of engagement in a given network. The author shows that, for \(k=2\), the problem is solvable in polynomial time while for \(k \ge 3\) the problem is NP-hard (even to be approximated). Moreover, the problem has shown to be W[2]-hard with respect to the budget parameter b.

Meier et al. [38] pose the problem in terms of virus propagation in a network where each node/player decides whether or not to protect itself. They adopt a game theory approach, where each player decides to be vaccinated or not, with the aim of maximizing its own utility function. The goal is to design the best strategy for the benefit of the overall community.

Similarly, Chen et al. [6] studied the vaccination of nodes in graphs against the outbreak of infectious disease at random locations.

Influence minimization in the linear threshold model achieved by blocking some links has been studied in [32, 33]. In [33], the authors addressed the problem of minimizing the propagation of negative items by removing a limited number of links in a network. They propose a method for finding a good approximate solution to this problem based on a natural greedy strategy. In our study, we focus on strategies for reducing the spread size by immunizing/removing nodes. In this setting, papers [2, 40] consider a greedy heuristic that immunizes nodes in decreasing order of out-degree. However, immunizing nodes according to their (out-)degrees is not necessarily an effective strategy.

When all the node thresholds are equal to 1, the immunization can be obtained by a cut (set of edges) or a separator (set of nodes) of the network. In particular, Hayrapetyan et al. [29] introduced the Minimum-size Bounded-Capacity Cut (MinSBCC) problem where, for a given graph with an identified source, the goal is to find a cut minimizing the number of nodes on the source side, subject to a budget constraint. Moreover, they showed a connection between the MinSBCC problem and the problem of choosing which individuals to immunize in order to minimize an epidemic process. Other papers dealing with such cut problems are [6, 30] in case of edge cuts and [15, 25] in case of node separators.

Another conceptually related problem is the Firefighter problem [23]. This problem models diffusion processes such as an infection (as well as an idea, a computer virus, or a fire). The Firefighter problem is based on a diffusion process where all the node thresholds are equal to 1, and the goal is to contain the infection by using targeted immunizations: at each round of the diffusion process, one can defend (immunize) a fixed number of nodes, with the goal of minimizing the effect of the infection. Conversely, in our study, we considered a fixed overall budget \(\ell \), that is, we are allowed to immunize, from the beginning, at most \(\ell \) nodes, and we ask whether we are able to limit the diffusion to at most k nodes.

3 Problem Statement

Let \(G=(V,E,t)\) be an undirected graph where V is the set of nodes, E is the set of edges, and \(t:V\rightarrow \mathbb {N}\) is a node threshold function. We use n and m to denote the number of nodes and edges in the graph, respectively. The degree of a node v is denoted by \(d_G(v)\). The neighborhood of v is denoted by \(\Gamma _G(v)=\{u\in V \mid (u,v)\in E\}\). In general, the neighborhood of a set \(V'\subseteq V\) is denoted by \(\Gamma _G(V')=\{u\in V \mid (u,v)\in E, \ v\in V',\ u\notin V'\}\). The graph induced by a node set \(V'\) in G is denoted \(G[V']=(V', E', t')\) where \(E'= \{(u, v) \mid u, v \in V', \ (u,v)\in E\}\) and \(t'(v)=t(v)\) for each \(v\in V'\).

Given the network and a spreader set S, after one diffusion round, the influenced nodes are all those which are influenced by the nodes in S, that is, have a number of neighbors in S at least equal to their threshold. Noticing that nodes in S are already contaminated and cannot be immunized, we can then model the diffusion process by a graph, which represents the network except for the spreader set. Namely, we consider the graph \(G=(V,E,t)\) where: V is the set of nodes of the network excluding those in the spreader set, \(E\subseteq V\times V\) is the edge set, and t is the threshold function \(t:V\rightarrow \mathbb {N}\) where t(v) is equal to the original threshold of the node v in the network decreased by the number of its neighbors in S (if the difference is negative then t(v) is set to 0). Hence in G, the diffusion process can be seen as starting at the nodes of threshold 0. Each node in V, including those of threshold 0, may be immunized.

Definition 1

The diffusion process in \(G=(V,E,t)\) in the presence of a set \(Y\subseteq V\) of immunized nodes is a sequence of node subsets \({\textsf{D}}_{G,Y}[1] \subseteq {\textsf{D}}_{G,Y}[2] \subseteq \cdots \subseteq {\textsf{D}}_{G,Y}[\tau ] \subseteq \cdots \subseteq V,\) withFootnote 1

  • \({\textsf{D}}_{G,Y}[1] = \{u \mid u\in V-Y,\ t(u)=0\}\), and

  • \({\textsf{D}}_{G,Y}[\tau ] = {\textsf{D}}_{G,Y}[\tau -1]\cup \Big \{u \mid u\in V-Y, \mid \Gamma _G(u)\cap {\textsf{D}}_{G,Y}[\tau -1] \mid \ge t(u)\Big \}\).

The process ends at \(\tau ^*\) such that \({\textsf{D}}_{G,Y}[\tau ^*]={\textsf{D}}_{G,Y}[\tau ^*+1]\). We set \({\textsf{D}}_{G,Y} = {\textsf{D}}_{G,Y}[\tau ^*].\)

We omit the subscript Y when no node is immunized, that is, \({\textsf{D}}_G={\textsf{D}}_{G,\emptyset }\).

Notice that Definition 1 immediately implies

$$\begin{aligned} {\textsf{D}}_{G,Y} = {\textsf{D}}_{G[V-Y]}. \end{aligned}$$
(1)

In the following, we assume that for the input graph it holds \({\textsf{D}}_{G} = V;\) indeed, we could otherwise remove all the nodes that cannot be influenced, since they are irrelevant to the immunization problem. In particular, each remaining node \(v\in V\) has \(t(v)\le d_G(v)\), otherwise, it could not be influenced. An example is given in Fig. 1a.

Fig. 1
figure 1

A graph G (node thresholds appear in red). a The diffusion process in G. b An example of X whose G[X] includes nodes not influenced. c An example of immunizing set \(Y(X')=\{v_3,v_8\},\) which enables to confine the diffusion to \(X'=\{v_1,v_5\}\) (Color figure online)

We are now ready to formally define our problem.

Influence-Immunization Bounding (IIB): Given a graph \(G=(V,E,t)\) and bounds \(k\) and \(\ell \), is there a set Y such that \(|Y |\le \ell \) and \(|{\textsf{D}}_{G,Y}|\le k\)?

For a given set Y we partition the node set into three subsets:

  • The set \({\textsf{D}}_{G,Y},\) which contains the nodes that get influenced,

  • the immunizing set Y, which has the property that, if all its nodes are immunized then the diffusion process is contained to \({\textsf{D}}_{G,Y}\), and

  • the set \(V-Y-{\textsf{D}}_{G,Y}\) of the nodes that, by immunizing Y, are not influenced.

We will refer to the nodes in the above subsets as influenced, immunized and safe, respectively.

In some cases it will be easier to deal with a different formulation of IIB based on the set of nodes to which one wants to confine the diffusion.

Definition 2

Given \(X\subseteq V\), we define the immunizing set Y(X) of X as

$$\begin{aligned} Y(X)=\{ u \mid u\in V-X, \ \mid \Gamma _{G}(u)\cap {\textsf{D}}_{G[X]} \mid \ge t(u) \}. \end{aligned}$$
(2)

The set \({\textsf{D}}_{G[X]}\) of nodes that get influenced in the subgraph G[X] induced by X, can clearly be seen as the set of nodes that would get influenced in X if X were disconnected from the rest of the graph. Hence, according to Definition 2, the set Y(X) contains the nodes in \(V-X\) that can be influenced by those in \({\textsf{D}}_{G[X]}\).

It is worth mentioning that a node having an initial threshold equal to 0 can only be influenced or immunized. Indeed, by Definition 2, all the nodes in \(V-X\) having initial threshold equal to 0 belong to Y(X), that is,

$$\begin{aligned} \{v \mid v\in V, \ t(v)=0\} \subseteq X \cup Y(X) \end{aligned}$$

(see Fig. 1c for an example). By the above definitions and by (1), we have

Fact 1

$$\begin{aligned} {\textsf{D}}_{G[X]}={\textsf{D}}_{G,Y(X)}={\textsf{D}}_{G[V-Y(X)]}\subseteq X, \end{aligned}$$
(3)

Proof

We first notice that Y(X) includes all the nodes in \(V-X\) that either are influenced by those in X or have a threshold equal to 0. As a consequence, the influenced nodes in \(V-Y(X)\) can only belong to X. Hence the first equality holds. The second equality immediately follows by (1). \(\square \)

The sets \({\textsf{D}}_{G[X]}\), Y(X), \(V-Y(X)-{\textsf{D}}_{G[X]}\) are the influenced, immunized, and safe sets, respectively.

For some X, some nodes in G[X] may be not influenced, even though they would in the whole graph G (see Fig. 1 (b)). However, it is easy to see that for each X the set \(X'={\textsf{D}}_{G[X]}\subseteq X \) is such that \({\textsf{D}}_{G[X']}=X'\) and \(Y(X')=\{ u \mid u\in V-X', \ |\Gamma _{G}(u)\cap {\textsf{D}}_{G[X']} |\ge t(u) \} =Y(X)\).

In the following, we will refer as minimal to a set X such that \({\textsf{D}}_{G[X]}=X\) (see Fig. 1c). We can then state the following.

Fact 2

(IIB equivalent formulation) \(\langle G,k, \ell \rangle \) is a yes instance of IIB iff there exists a minimal set X such that

$$\begin{aligned} |X |= |{\textsf{D}}_{G[X]} |\le k \text{ and } |Y(X)|\le \ell . \quad \end{aligned}$$
(3)

4 Hardness

In this section we prove some hardness properties of Influence-Immunization Bounding with respect to the parameters k, \(\mathtt{{tw}}\), and \(\mathtt{{nd}}\), and to the pair of parameters (\(\ell \), \(\Delta \)) and \((\ell , \zeta )\).

4.1 Parameter k

Theorem 1

IIB is W[1]-hard with respect to k, the size of the influenced set.

Proof

We give a reduction from the cutting at most k vertices with terminal (CVT-k): Given a graph \(H=(V(H),E(H))\), \(s\in V(H)\), and two integers k and \(\ell \), is there a set \(X_H\subseteq V(H)\) such that \(s\in X_H\), \(|X_H |\le k\), and \(|\Gamma _{H}(X_H)|\le \ell \)?.

The theorem will follow, since Theorem 3 in [25] proves that CVT-k is W[1]-hard with respect to k.

To our aim, we construct the instance \(\langle G,k-1,\ell \rangle \) of IIB  where \(G=H[V(H)-\{s\}]\) and \(t(v)=0\) for each node \(v\in \Gamma _H(s)\) and \(t(v)=1\) for each node \(v\in V(H)-\{s\}-\Gamma _H(s)\).

Suppose first that \(\langle G,k-1,\ell \rangle \) admits a solution. By (4), there exists a minimal set X such that \(|X|=|{\textsf{D}}_{G[X]}|\le k-1\) and \(|Y(X)|\le \ell \). Noticing that \(\Gamma _H(s)\subseteq X\cup Y(X)\), one gets that for \(X_H=X\cup \{s\}\) it holds \(\Gamma _H(X\cup \{s\})=Y(X)\). Hence \(X_H=X\cup \{s\}\) satisfies the inequalities \(|X_H|\le k\) and \( |\Gamma _{H}(X_H) |\le \ell \) and is a solution to CVT-k .

Suppose now \(X_H=X\cup \{s\}\) is a minimum size solution to CVT-k . Then \(H[X_H]\) is connected, otherwise the connected component containing s would be a smaller solution. Recalling that in G all thresholds are at most 1, we have that all the nodes in the connected components containing a node with threshold 0 get influenced. Hence,

$$\begin{aligned} Y(X)= & {} \{ u \mid u \in V{-}X, \ |\Gamma _{G}(u)\cap {\textsf{D}}_{G[X]} |\ge t(u) \}\\= & {} \{ u \mid u \in V{-}X, \ t(u){=}0 \}\cup \{ u \mid u \in V{-}X, t(u)=1, \, |\Gamma _{G}(u)\cap {\textsf{D}}_{G[X]} |\ge 1 \}\\= & {} \{ u \mid u \in V{-}X, \ t(u){=}0 \}\cup \{ u \mid u \in V{-}X, |\Gamma _{G}(u)\cap X |\ge 1 \}\\= & {} { \Gamma _H(\{s\}\cup {X})}. \end{aligned}$$

As a consequence, X is a solution to IIB. \(\square \)

The same reduction, recalling that Theorem 5 in [25] proves that CVT-k is W[1]-hard with respect to \(\ell \), also gives that IIB is W[1]-hard with respect to \(\ell \); however, a stronger result is given in the next section.

4.2 Parameters \(\zeta \) and \(\ell \)

Theorem 2

IIB is W[2]-hard with respect to the pair of parameters \(\zeta \), the number of nodes with threshold 0, and \(\ell \), the size of the immunized set.

Proof

We give a reduction from Hitting Set (HS), which is W[2]-complete in the size of the hitting set: Given a collection \(\{S_1,\ldots , S_m\}\) of subsets of a ground set \(A=\{a_1,\ldots ,a_n\}\) and an integer \(h>0\), is there a set \(H \subseteq A\) such that \(H \cap S_i \ne \emptyset ,\) for eachFootnote 2\(i \in [m]\) and \(|H |\le h\)?

Given an instance \(\langle \{S_1,\ldots , S_m\}, A=\{a_1,\ldots ,a_n\}, h\rangle \) of HS, we construct an instance \(\langle G, n+1,h \rangle \) of IIB (cf. Figure 2). The graph \(G=(V,E,t)\) has node set \(V=I \cup A \cup S,\) where \(I=\{v_0,\ldots , v_h\}\) is a set of \(h+1\) independent nodes, \(A=\{a_1,\ldots ,a_n\}\) represents the ground set, and \(S=\{s_1,\ldots ,s_m\}\) (each \(s_j\) represents the set \(S_j\)), edge set

$$\begin{aligned} E=\{(v_i,a_j) \mid v_i\in I, \ a_j\in A\}\cup \{(a_j, s_t) \mid a_j\in A,\ s_t\in S, \ a_j\in S_t\}, \end{aligned}$$

and threshold function defined by

$$\begin{aligned} t(v)={\left\{ \begin{array}{ll} { 0} &{} { \text{ if } {v\in I}}\\ { 1 }&{} { \text{ if } {v\in A}}\\ {{|S_t|=d_G(s_t)}} &{} { \text{ if } {v=s_t\in S.}} \end{array}\right. } \end{aligned}$$

Trivially, \({\textsf{D}}_G[1]=I\), \({\textsf{D}}_G[2]=I\cup A\), and \({\textsf{D}}_G[3]=I\cup A\cup S=V\).

Fig. 2
figure 2

The Graph G encoding the HS problem. The big circle on the left represents a set I of \(h+1\) independent nodes having threshold 0 and sharing all neighbors. The thresholds of nodes appear in red (Color figure online)

We prove now that \(\langle \{S_1,\ldots , S_m\}, A, h\rangle \) is a yes instance of HS if and only if \(\langle G,n+1,h\rangle \) is a yes instance of IIB.

Suppose first there exists \(H \subseteq A\) such that \(|H|\le h\) and \(H \cap S_t\ne \emptyset \), for each \(t\in [m]\). If we consider in G the set of nodes \({{\tilde{Y}}}\subseteq A\) corresponding to the elements of H then each node \(s_t\in S\) is connected with a node in \({{\tilde{Y}}}\). Consequently, if all the nodes in \({{\tilde{Y}}}\) are immunized, then the number of influenced neighbors of \(s_t\) cannot reach its threshold \(t(s_t)=d_G(s_t)\). Hence, no node in S can get influenced. Let then Y be the set obtained by padding \({{\tilde{Y}}}\) with nodes in \(A-{{\tilde{Y}}}\), so to have \(|Y|=h\). Clearly, \({\textsf{D}}_{G,Y}=I\cup (A-Y)\) with \(|{\textsf{D}}_{G,Y}|= n+1\).

Assume now there exists a solution Y of IIB. We notice that:

  1. (a)

    \(I\subseteq {\textsf{D}}_{G,Y}\cup Y\) (since all the nodes in I have threshold 0, they are immunized or influenced).

  2. (b)

    If there exists \(v_i\in I\cap Y\), we can update Y to \(Y'=Y\cup \{a\}- \{v_i\}\), for any \(a \in A-Y\) (this implies that \({\textsf{D}}_{G,Y'} \subseteq {\textsf{D}}_{G,Y}\cup \{v_i\}- \{a\}\)).

  3. (c)

    If there exists \(s_{t}\in S\cap Y\) we can update Y to \(Y'=Y\cup \{a\}- \{s_t\}\), for any \(a\in A\cap S_t\) (this implies that \({\textsf{D}}_{G,Y'} \subseteq {\textsf{D}}_{G,Y}- \{a\}\)).

Using a) and iterating on b) and c), we can assume that Y consists of at most h nodes in A. As a consequence

$$\begin{aligned} I\cup (A-Y)\subseteq {\textsf{D}}_{G,Y}. \end{aligned}$$

We show now that

$$\begin{aligned} S\cap {\textsf{D}}_{G,Y}=\emptyset . \end{aligned}$$

Indeed, if we assume by contradiction that \(S\cap {\textsf{D}}_{G,Y}\ne \emptyset \), we get

$$\begin{aligned} |{\textsf{D}}_{G,Y}|\ge |I|+|A-Y|+ |S\cap {\textsf{D}}_{G,Y}|> h+1+(n-|Y|) \ge n+1, \end{aligned}$$

thus contradicting the hypothesis that Y is a solution of the instance \(\langle G,n+1,h\rangle \) of the IIB problem.

Hence, we have that \(S\cap {\textsf{D}}_{G,Y}=\emptyset \), each node in S has some neighbor in Y and the set H of elements corresponding to the h nodes in Y satisfies \(H \cap S_t \ne \emptyset ,\) for each \(t\in [m]\). \(\square \)

4.3 Parameters \(\Delta \) and \(\ell \)

We show the W[2]-hardness of IIB with respect to the parameter \(\ell \), the size of the immunized set, even when the maximum degree of the graph is at most 3.

Given an instance \(\langle \{S_1,\ldots , S_m\}, A=\{a_1,\ldots ,a_n\}, h\rangle \) of HS, we construct an instance \(\langle G, k,\ell \rangle \) of IIB, where the maximum node degree is 3. We start the construction of G by inserting the nodes in \(A \cup W \cup U \cup S\) where \(A=\{a_1,\ldots ,a_n\}\) represents the ground set and \(S=\{s_1,\ldots ,s_m\}\) (each \(s_j\) represents the set \(S_j\)), while W and U are two auxiliary sets, of at most nm nodes each, that will be used to keep the degree bounded and, at the same time, simulating a complete bipartite connection between A and S (depicted using gray connection in Fig. 3c). We then add the following expansion, reduction and path gadgets.

Fig. 3
figure 3

a The expansion gadget. b The reduction gadget. c The graph G (Color figure online)

Expansion gadgets For each \(i\in [n]\), if the sets containing \(a_i\) are exactly \(S_{i_1},S_{i_2},\ldots ,S_{i_{\delta _i}}\) then we encode these relationships with a gadget. Namely, we add \(\delta _i\) nodes \(\{w_{i,i_1},w_{i,i_2},\ldots w_{i,i_{\delta _i}}\}\)

and the edges \((a_i, w_{i,i_1})\) and \((w_{i,i_j},w_{i,i_{j+1}})\) for \(j\in [\delta _i-1].\) See Fig. 3a.

Reduction gadgets. For each \(j\in [m]\), if \(S_{j}=\{a_{j_1},a_{j_2}, \ldots , a_{j_{\gamma _j}}\}\) then we encode this relationship with a gadget. Namely, we add \(\gamma _j{-}1\) nodes \(\{u_{j_1,j},u_{j_2,j},\ldots , u_{j_{\gamma _j-1},j}\}\) and the edges:

\((w_{j_{r+1},j}, u_{j_{r},j}),(u_{j_r,j}, u_{j_{r+1},j})\), for \(r \in [\gamma _j{-}2]\)

\((w_{j_1,j}, u_{j_1,j}),(w_{j_{\gamma _j},j}, u_{j_{\gamma _j-1},j})\), and \((u_{j_{\gamma _j-1},j}, s_j).\)

The reduction gadget is presented in Fig. 3b.

Path gadgets. We complete the construction by adding m paths each of \(n +2nm\) nodes, which depart from each \(s_j\in S\). See Fig. 3c.

Notice that, by construction each node has degree at most 3. We set now the thresholds of the nodes in G as:

$$\begin{aligned} t(v)={\left\{ \begin{array}{ll} {0} &{}{\text{ if } v\in A }\\ {2} &{}\text{ if } v\in U\\ {1} &{}\text{ otherwise }\\ \end{array}\right. } \end{aligned}$$

Theorem 3

IIB is W[2]-hard with respect to the parameter \(\ell \), the size of the immunized set, even when the maximum degree of the graph is at most 3.

Proof

We show that \(\langle \{S_1,\ldots , S_m\}, A, h\rangle \) is a yes instance of HS iff \(\langle G, n+2nm,h\rangle \) is a yes instance of IIB.

Suppose first that there exists a set \(H \subseteq A\) such that \(|H|\le h\) and \(H \cap S_j \ne \emptyset \) for each \(j\in [m]\). Consider in G the set of nodes Y corresponding to the elements of H. Since \(H \cap S_j \ne \emptyset ,\) for each \(j\in [m]\), we have that each node \(s_j\in S\) is connected, through a reduction gadget, with a node in \(w_{i,j}\) such that \(a_i \in S_j\cap Y\). Consequently, if all the nodes in Y are immunized, then at least one node in the reduction gadget associated to \(s_j\) cannot reach the threshold and consequently \(s_j\) will not be influenced. Hence, no node in S as well as in the associated path gadgets can get influenced. We have \(|Y|\le h\) and \(|{\textsf{D}}_{G,Y}|< n+2nm\), where the last inequality follows noticing that \(n+2nm\) is greater than the number of nodes that remain in G once we eliminate the nodes in S and in the path gadgets.

Assume now there exists a solution Y to IIB such that \(|Y|\le h\) and \(|{\textsf{D}}_{G,Y}|\le n+2nm\). Without loss of generality, we can assume that \(Y \subseteq A\). Indeed, if Y contains either of the nodes \(w_{i,i_j}, u_{i,i_j}, s_{i_j}\) or a node in the path \(P_{i_j}\), for some \(i\in [n]\), we could replace such a node by \(a_i\in A\) without increasing neither the size of Y nor the size of \({\textsf{D}}_{G,Y}.\) Hence, we have that Y consists of at most h nodes in A. We argue that the set \(H\subseteq A\) of the elements corresponding to the nodes in Y satisfies \(H \cap S_j \ne \emptyset ,\) for each \(j\in [m]\). Indeed, assume by contradiction that there is a set \(S_j\) such that \(H \cap S_j = \emptyset \). This implies that in G the node \(s_j\) will be influenced. Indeed, \(s_j\) is connected through gadgets, to all the nodes in \(S_j\). Moreover each node in \(S_j\) belongs to \(A-Y\) and has threshold 0. It follows that \(s_j\) and, as a consequence, all the \(n+2nm\) nodes on the associated path get influenced and we obtain the desired contradiction because this violate the bound on the size of \({\textsf{D}}_{G,Y}\). \(\square \)

4.4 Graphs of Bounded Treewidth

In this section we show that IIB is W[1]-hard with respect to the treewidth parameter.

Definition 3

A tree decomposition of a graph \(G=(V,E)\) is a pair \((T,\{W_u\}_{u \in V(T)})\), where T is a tree and each \(u \in V(T)\) is assigned a node subset \(W_u \subseteq V\) such that:

  1. 1.

    \( \bigcup _{u \in V(T)} W_u=V\).

  2. 2.

    For each \((v,w)\in E,\) there exists \(u\in V(T)\) s.t. \(W_u\) contains both v and w.

  3. 3.

    For each \(v \in V\), the set \(T_v=\{ u \in V(T) \mid v \in W_u\},\) induces a connected subtree of T.

The width of a tree decomposition \((T,\{W_u\}_{u \in V(T)})\) of a graph G is defined as \(\max _{u \in V(T)}|W_u|-1\). The treewidth of G, denoted by \(\mathtt{{tw}}(G)\), is the minimum width over all tree decompositions of G. We show that IIB is W[1]-hard with respect to the treewidth parameter.

In order to prove that IIB is W[1]-hard with respect to the treewidth, we present a reduction from Multi-Colored clique (MQ): Given a graph \(G=(V,E)\) and a proper vertex-coloring \(\textbf{c}: V \rightarrow [ q]\) for G, does G contain a clique of size q?

It is worth noticing that a node v can belong to a multi-colored clique only if \(\{v\}\cup \Gamma _{G}(v)\) contains at least one node from each color class. Hence, in the following we will assume that all the nodes that do not satisfy such a property are removed from G, since they are irrelevant to the problem.

Given an instance \(\langle G,q \rangle \) of MQ, we construct an instance \(\langle G'=(V',E'),k,\ell \rangle \) of IIB. We denote by \(n'=|V'|\) the number of nodes in \(G'\). For a color \(c \in [q]\), we denote by \(V_c\) the class of nodes in G of color c and for a pair of distinct \(c,d \in [q],\) we let \({E_{cd}}\) be the subset of edges in G between a node in \(V_c\) and one in \(V_d\).

Our goal is to guarantee that any optimal solution of IIB in \(G'\) encodes a clique in G and vice-versa. Following some ideas in [3], we construct \(G'\) using the following gadgets:

Parallel-paths gadget: A parallel-paths gadget of size h, between nodes x and y, consists of h disjoint paths each built by a connection node which is adjacent to both x and y. In order to avoid cluttering, we draw such a gadget as an edge with label h (cf. Figure 4a).

Selection gadgets: The selection gadgets encode the selection of nodes (node-selection gadgets) and edges (edge-selection gadgets):

  • Node-selection gadget: For each \(c \in [q]\), we construct a c-node-selection gadget which consists of a node \(x_v\) for each \(v \in V_c\); these nodes are referred to as node-selection nodes. We then add a guard node \(g_c\) that is connected to all the other nodes in the gadget; thus the gadget is a star centered at \(g_c\).

  • Edge-selection gadget: For each \(c,d \in [q]\) with \(c\ne d\), we construct a \(\{c,d\}\)-edge-selection gadget which consists of a node \(x_{u,v}\) for every edge \((u,v) \in {E_{cd}}\); these nodes are referred to as edge-selection nodes. We then add a guard node \(g_{cd}\) that is connected to all the other nodes in the gadget; thus the gadget is a star centered at \(g_{cd}\).

Overall there are n node-selection nodes with q guard nodes and m edge-selection nodes with \({q \atopwithdelims ()2}\) guard nodes (cf. Figure 4b).

Validation gadgets: We assign to every node \(v \in V(G)\) two unique identifier numbers, low(v) and high(v), with \(low(v) \in [n]\) and \(high(v)=2n-low(v)\). For every pair of distinct \(c,d \in [q],\) we construct two validation gadgets. One between the c-node-selection gadget and the \(\{c,d\}\)-edge-selection gadget and one between the d-node-selection gadget and the \(\{c,d\}\)-edge-selection gadget. We describe the validation gadget between the c-node-selection and \(\{c, d\}\)-edge-selection gadgets. It consists of two nodes. The first one is connected to each node \(x_v\), for \(v \in V_{c}\), by parallel-paths gadgets of size high(v), and to each edge-selection node \(x_{u,v},\) for \((u, v) \in {E_{cd}}\) and \(v \in V_{c}\), by parallel-paths gadgets of size low(v). The other node is connected to each node \(x_v\), for \(v \in V_{c}\), by parallel-paths gadgets of size low(v), and to each edge-selection node \(x_{u,v},\) for \((u, v) \in {E_{cd}}\) and \(v \in V_{c}\), by parallel-paths gadgets of size high(v). Overall, there are \(q (q-1)\) validation gadgets, each composed of two nodes.

Black-hole gadget: Finally we add a gadget, which will force the immunizing set Y to contain at least one node for each selection gadget. We add a set B of \(|B|=(n-q)(2nq-2n+1)+\left( m-{q \atopwithdelims ()2}\right) (4n+1)\) independent nodes and a complete bipartite graph between nodes in B and the guard nodes.

To complete the construction, we specify the thresholds of the nodes in \(G'\)

$$\begin{aligned} t(x)={\left\{ \begin{array}{ll} {0} &{}{\text{ if } x \text{ is } \text{ a } \text{ selection } \text{ node }}\\ {1} &{}\hbox {if} x \hbox {is a connection node or} x\in B\\ {d_{G'}(x)-2n+1} &{}\text{ if } x \text{ is } \text{ a } \text{ validation } \text{ node }\\ {|V_c |} &{}\text{ if } x=g_c \text{ is } \text{ a } \text{ guard } \text{ node } \text{ for } \text{ some } c \in [q]\\ {|E_{cd}|} &{}\text{ if } x=g_{cd} \text{ is } \text{ a } \text{ guard } \text{ node } \text{ for } \text{ some } c,d \in [q]\\ \end{array}\right. } \end{aligned}$$

The complete construction of \(G'\) for an instance of the MQ problem appears in Fig. 4b.

Fig. 4
figure 4

a Parallel-paths gadget. b Representation of the graph \(G'\) for a trivial instance of the MQ problem \(\langle G=(V_1 \cup V_2, E_{1,2}), 2\rangle \) (Color figure online)

In order to prove the desired hardness result, we show that the reduction is correct and that \(G'\) has treewidth \(O(q^2)\).

Theorem 4

IIB is W[1]-hard with respect to the treewidth of the input graph.

Proof

We first prove that \(\langle G, q\rangle \) is a yes instance of MQ if and only if \(\langle G',k,\ell \rangle \), where \(k=(n-q)(2nq-2n+1)+\left( m-{q \atopwithdelims ()2}\right) (4n+1)\) and \(\ell = q+ {q \atopwithdelims ()2}\), is a yes instance of IIB.

Suppose that \(K=(V(K),E(K))\) is a multi-colored clique in G of size q. Let C denote the set of all the connection nodes in \(G'\) and let \(X_K= \{x_v \mid v \notin V(K)\} \cup \{x_{u,v} \mid (u,v) \notin E(K)\}\). Set

$$\begin{aligned} X= X_K \cup \{c \in C \mid \Gamma _{G'}(c)\cap X_K\ne \emptyset \}. \end{aligned}$$

We show that

$$\begin{aligned} Y = \{x_v \mid v \in V(K)\} \cup \{x_{u,v} \mid (u, v) \in E(K)\} \end{aligned}$$

is the immunizing set of X, i.e., \(Y=Y(X)\). Notice that \(|Y|= q + {q \atopwithdelims ()2}.\)

We first notice that \({\textsf{D}}_{G'[X]}=X.\) Indeed, nodes in \(\{x_v \mid v \notin V(K)\} \cup \{x_{u,v} \mid (u,v) \notin E(K)\}\) have threshold 0 and their neighbors in C have threshold 1.

Recalling that for each \(v\in V(G),\) the set \(\{v\}\cup \Gamma _{G}(v)\) contains at least one node from each color class (as already noticed, nodes which do not satisfy this property are irrelevant for the problem and can be removed beforehand), we can easily evaluate the size of X. Indeed X is composed of:

  • \(n-q\) nodes in the set of node-selection nodes and their \((n-q)2n(q-1)\) neighbors in C. Indeed, each node-selection node is connected with \(q-1\) validation pairs and, for each node \(x_u\), we have \(low(u)+high(u)=2n\).

  • \(m-{q \atopwithdelims ()2}\) nodes in the set of edge-selection nodes and their \((m-{q \atopwithdelims ()2})4n\) neighbors in C. Indeed, each edge-selection node is connected with two validation pairs and for each node \(x_{u,v}\) we have that \(low(u)+high(u)=low(v)+high(v)=2n.\)

Overall the set X has size

$$\begin{aligned} k=(n-q)(2nq-2n+1)+\left( m-{q \atopwithdelims ()2}\right) (4n+1).\end{aligned}$$
(4)

It remains to show that \(Y=Y(X)\). First of all, we observe that \(Y\subseteq Y(X)\) because all the nodes in Y belongs to \(V'-X\) and have threshold 0, hence, by Definition 2, each node in Y belongs to Y(X). We show now that for any \(v \in V'- (X \cup Y)\) it holds \(|\Gamma _{G'}(v)\cap X|<t(v)\):

  • Each guard node g has a neighbor in Y and its threshold is equal to the number of its neighbors belonging to its selection gadget. Hence, \(|\Gamma _{G'}(g)\cap {\textsf{D}}_{G'[X]}|<t(g)\).

  • For each \(b\in B\), it holds \(|\Gamma _{G'}(b)\cap X|=0<t(b)=1.\)

  • Consider now the validation nodes. Knowing that K is a multi-colored clique, we have that for each validation pair there is exactly one node u and one edge (uv) such that \(x_u, x_{u,v}\in Y\). Hence, both nodes have exactly \(low(\cdot )+high(\cdot )=2n\) neighbors which do not belong to X. Since the threshold of each validation node x is \(t(x)=d_{G'}(x)-2n+1,\) then \(|\Gamma _{G'}(x)\cap X|=d_{G'}(x)-2n<t(x).\)

  • Finally, for each connection node \(c\notin X,\) we have \(|\Gamma _{G'}(c)\cap X|=0<t(c)=1.\)

Assume now there exists a solution Y to IIB such that \(|Y|\le \ell =q+{q \atopwithdelims ()2}\) and

$$\begin{aligned} |{\textsf{D}}_{G',Y}|\le k=(n-q)(2nq-2n+1)+\left( m-{q \atopwithdelims ()2}\right) (4n+1). \end{aligned}$$
(4)

Noticing that \(k<|B|+1\) and all the nodes in B get influences as soon as a guard node is, we have that the immunization of Y saves all the guard nodes.

Noticing that the number of guard nodes is exactly \(q + {q \atopwithdelims ()2}\) and each guard node is connected to a distinct set of selection nodes, we have that \(|Y|=q + {q \atopwithdelims ()2}\) and each node in Y can save one guard node.

Recalling that the thresholds of guard nodes is equal to the number of neighbors belonging to the corresponding selection gadget, we have that in order to save a guard node there are two options: Put the guard node in Y or put in Y one of its neighbors, belonging to the corresponding selection gadget. Without loss of generality, we can assume that Y does not include any guard node. Indeed, if Y contains a guard node we could replace such a node by one of its selection node neighbors without increasing neither the size of Y nor the size of \({\textsf{D}}_{G',Y}\).

We can then assume that Y is composed of exactly q node-selection nodes and \(q\atopwithdelims ()2\) edge-selection nodes.

Let \(V_Y\subseteq V\) be a set of q nodes in G, defined by \(V_Y = \{v \in V \mid x_v \in Y\}\). We argue that \(G[V_Y]\) is a clique. By contradiction suppose that \(G[V_Y]\) is not a clique. There are two nodes \(u, v \in V_Y\) such that \((u, v) \notin E\). Let cd be the colors of v and u, respectively. Let \(x_{w,z}\) be the node in \(G'\) which save the guard \(g_{cd}\) associated to the pair cd. Since \((u, v) \notin E\) we have that \(w \ne u\) or \(z \ne v\) or both. Without loss of generality, we can assume that \(w \ne u.\) Consider now the validation pair between the c-node- and \(\{c, d\}\)-edge-selection gadgets. Recalling that Y contains exactly one node for each selection gadget, we have that both the nodes in the validation pair have all the neighbors influenced, except for the connections of the nodes \(x_u\) and \(x_{w,z}\). Since \(w \ne u\), we have that one of the nodes in the validation pair will get influenced. This is because for any \(w \ne u\) either \(high(w)+low(u) < 2n\) or \(low(w)+high(u) < 2n\). That is, there is a validation node x having less than 2n not influenced neighbors, while all the remaining neighbors get influenced. Recalling that the threshold of x is \(d_{G'}(x)-2n+1,\) we have that x get influenced.

Hence, \(|{\textsf{D}}_{G',Y}|=k+1\). Indeed k are due to non immunized selection nodes and their connection neighbors (see (5)) plus at least one validation node. This contradicts (6).

We show now that \(G'\) admits a tree decomposition of width \(O(q^2)\). The complete bipartite network defined by the guard nodes and the nodes in B has treewidth \(q + {q \atopwithdelims ()2}\). Indeed, let A be the set of the guard nodes of size \(q + {q \atopwithdelims ()2}\) and \(b_1,b_2,\ldots ,b_{|B |}\) the nodes in B, the decomposition tree has A as root and \(A\cup {b_i}\) as children.

Then we can add to this network the \(q + {q \atopwithdelims ()2}\) trees, rooted on the guard nodes and containing both selections and connection nodes, without increasing the treewidth. Finally we can add all \(O(q^2)\) validation nodes, getting a tree decomposition of width \(O(q^2)\) for \(G'.\) \(\square \)

4.5 Graphs of Bounded Neighborhood Diversity

In this section we prove that IIB is W[1]-hard on graphs of bounded neighborhood diversity. First of all we define the neighborhood diversity of a graph.

Given a graph \(G=(V,E)\), two nodes \(u,v\in V\) are said to have the same type if \(\Gamma _G(v) {\setminus } \{u\} = \Gamma _G(u) {\setminus } \{v\}\). The neighborhood diversity of a graph G, introduced by Lampis in [37] and denoted by nd (G), is the minimum number \(\mathtt{{nd}}\) of sets in a partition \(V_1,V_2, \ldots , V_\mathtt{{nd}}\), of the node set V, such that all the nodes in \(V_i\) have the same type, for \(i\in [\mathtt{{nd}}]\). The family \(\{V_1,V_2, \ldots , V_\mathtt{{nd}}\}\) is called the type partition of G.

Notice that each \(V_i\) induces either a clique or an independent set in G. Moreover, for each \(V_i,V_j\) in the type partition, we get that either each node in \(V_i\) is a neighbor of each node in \(V_j\) or no node in \(V_i\) has a neighbor in \(V_j\). Hence, between each pair \(V_i\) and \(V_j\), there is either a complete bipartite graph or no edges at all.

In order to prove that IIB is W[1]-hard with respect to the neighborhood diversity, we use a reduction from Multi-Colored clique (MQ), defined in Sect. 4.4. As before, we refer to \({V_c}\) as a color class of G and to \({E_{cd}}\) as the set of edges between nodes in the color classes \({V_c}\) and \({V_d}\). Here we will use the fact that MQ remains W[1]-hard even if each color class has the same size and for each distinct colors \(c,d \in [{q}]\), the set \({E_{cd}}\) has the same size [17]. We then denote by \({r}+1\) the size of each color class \(V_c\) and by \({s}+ 1\) the size of each set \({E_{cd}}\), in particular we use the following notation

$$\begin{aligned} V_c =\{{v_0^c},{v_1^c}, \ldots , {v_r^c}\},\ \qquad \ {E_{cd}}=\{{e_0^{cd}}, \ldots , {e_{s}^{cd}}\} \qquad { c,d \in [q], c\ne d} \end{aligned}$$
(5)

and refer to \({v_i^c}\) and \( {e_j^{cd}}\) as the i-th node in \(V_c\) and the j-th edge in \({E_{cd}}\), respectively.

Let \(\langle G, {q}\rangle \) be an instance of MQ. We describe a reduction from \(\langle G, {q}\rangle \) to an instance \(\langle G', k, \ell \rangle \) of IIB such that \(\mathtt{{nd}}(G')\) is \(O({q}^2)\).

In order to present the reduction we introduce some gadgets that are used in the construction of \(G'\). They are inspired by those used in [19]. The rationale behind the construction is the following. First, we create two sets of gadgets (Selection and Multiple gadgets), which encode in \(G'\) the selection of nodes and edges as part of a potential multicolored clique in G. Then we create another set of gadgets (Incidence gadgets) that is used to check whether the selected sets of nodes and edges actually represent a multicolored clique in G. Our goal is to guarantee that any solution of IIB in \(G'\) encodes a clique in G and vice-versa.

In the following we call an independent set of nodes of a graph sharing all neighbors a bag. So, a connection between two bags points out a complete bipartite graph among the nodes in the bags. Figure 5 shows the gadgets we are going to introduce and how they are connected.

Fig. 5
figure 5

An overview of the reduction. Each circle represents a bag. The number inside a bag is the number of nodes of the bag. The threshold of nodes in a bag is displayed in red (Color figure online)

Selection Gadget. For each \(c \in [{q}]\), the selection gadget \({L_c}\) consists of three bags: \({{L_c}\text{-neg }}\) and \({{L_c}\text{-pos }}\) of \({r}\) nodes each, and \({{L_c}\text{-guard }}\) of \(\ell +1\) nodes (the value \(\ell \), representing an upper bound on the number of nodes to be immunized, will be determined later). The bag \({{L_c}\text{-guard }}\) is connected to both \({{L_c}\text{-neg }}\) and \({{L_c}\text{-pos }}\). The selection gadget \({L_c}\) is connected to the rest of the graph \(G'\) using only nodes from \({{L_c}\text{-neg }}\cup {{L_c}\text{-pos }}\). We set now the thresholds of the nodes in \({L_c}\) as:

$$\begin{aligned} t(v)={\left\{ \begin{array}{ll} {0} &{}{\text{ if } {v\in {{L_c}\text{-neg }}\cup {{L_c}\text{-pos }}}}\\ {r+1} &{}\text{ if } v\in {{L_c}\text{-guard }}\\ \end{array}\right. } \end{aligned}$$

Multiple Gadget. For each \(c, d \in [q]\) with \(c\ne d\), we create a multiple gadget \({M_{cd}}\) consisting of six bags: \({{L_{cd}}\text{-pos }}\) and \({{L_{cd}}\text{-neg }}\) of \(2{r}{s}\) nodes each, \({{L_{cd}}\text{-guard }}\) of \(\ell +1\) nodes, \({{M_{cd}}\text{-pos }}\) and \({{M_{cd}}\text{-neg }}\) of \({s}+1\) nodes each, and \({{M_{cd}}\text{-guard }}\) of \(\ell +1\) nodes. \({{M_{cd}}\text{-guard }}\) is connected to the bags \({{M_{cd}}\text{-pos }}\) and \({{M_{cd}}\text{-neg }}\). \({{M_{cd}}\text{-pos }}\) is connected to \({{L_{cd}}\text{-pos }}\), and \({{M_{cd}}\text{-neg }}\) is connected to \({{L_{cd}}\text{-neg }}\). Finally, the bag \({{L_{cd}}\text{-guard }}\) is connected to both \({{L_{cd}}\text{-pos }}\) and \({{L_{cd}}\text{-neg }}\). The rest of graph \(G'\) is connected only to the bags \({{L_{cd}}\text{-pos }}\) and \({{L_{cd}}\text{-neg }}\). We set now the thresholds of the nodes in \({M_{cd}}\) as:

$$\begin{aligned} t(v)={\left\{ \begin{array}{ll} {0} &{}{\text{ if } v\in {{L_{cd}}\text{-neg }}\cup {{L_{cd}}\text{-pos }} }\\ {2rs+1} &{}\text{ if } v\in {{L_{cd}}\text{-guard }}\\ {2rj+1} &{}{\text{ if } v=x_j \text{ where } {{M_{cd}}\text{-pos }}=\{x_0, \ldots , x_{s}\}} \\ {2rj+1} &{}{\text{ if } v=y_j \text{ where } {{M_{cd}}\text{-neg }}=\{y_0, \ldots , y_{s}\} }\\ {s+1} &{}\text{ if } v\in {{M_{cd}}\text{-guard }}\\ \end{array}\right. } \end{aligned}$$

Incidence Gadget. For each pair of distinct \(c,d \in [q]\), we construct two incidence gadgets: \({I_{c:cd}}\) (connected with the gadgets \({L_c}\) and \({M_{cd}}\)) and \({I_{d:cd}}\) (connected with the gadgets \({L_d}\) and \({M_{cd}}\)). In the following we present the gadget \({I_{c:cd}}\) which has the same structure as the gadget \({I_{d:cd}}\). The incidence gadget \({I_{c:cd}}\) has three bags \({{I_{c:cd}}\text{-pos }}\) and \({{I_{c:cd}}\text{-neg }}\) of \({s}+ 1\) nodes each, and \({{I_{c:cd}}\text{-guard }}\) of \(\ell +1\) nodes. We connect \({{I_{c:cd}}\text{-guard }}\) to \({{I_{c:cd}}\text{-pos }}\) and \({{I_{c:cd}}\text{-neg }}\). Furthermore, we connect \({{I_{c:cd}}\text{-pos }}\) to \({{L_c}\text{-pos }}\) and \({{L_{cd}}\text{-pos }}\). Similarly, we connect \({{I_{c:cd}}\text{-neg }}\) to \({{L_c}\text{-neg }}\) and \({{L_{cd}}\text{-neg }}\).

Recalling that there are \({s}+ 1\) edges in the set \({E_{cd}}\), and that there are \({s}+1\) nodes in \({{I_{c:cd}}\text{-pos }}\) and \({{I_{c:cd}}\text{-neg }}\), we create one-to-one correspondences between \({E_{cd}}\) and \({{I_{c:cd}}\text{-pos }}\) and between \({E_{cd}}\) and \({{I_{c:cd}}\text{-neg }}\). Namely, for each \(j=0,\ldots s\), we associate the j-th edge \({e_j^{cd}}\) in \({E_{cd}}\) (cfr. (7)) to a node \(u_j \in {{I_{c:cd}}\text{-pos }}\) and to a node \(w_j \in {{I_{c:cd}}\text{-neg }}\) (with \(u_j\ne u_{j'}\) and \(w_j\ne w_{j'}\), for \(j\ne j'\)). Moreover, if the endpoint of \({e_j^{cd}}\) of color c is the ith node \({v_i^c}\) of \({V_c}\) (cfr. (7)) then we set the thresholds of the nodes in \({I_{c:cd}}\) as:

$$\begin{aligned} t(v)={\left\{ \begin{array}{ll} { 2{r}j+i+1} &{}{\text{ if } v=u_j \in {{I_{c:cd}}\text{-pos }}} \\ {2{r}({s}-j) +{r}-i +1} &{}{\text{ if } v=w_j \in {{I_{c:cd}}\text{-neg }}} \\ {s+1} &{}\text{ if } v\in {{I_{c:cd}}\text{-guard }}\\ \end{array}\right. } \end{aligned}$$

It is worth observing that the nodes in \({I_{c:cd}}\)-pos (respectively, \({I_{c:cd}}\)-neg) have different thresholds. Indeed, the numbers \(i +1+ 2{r}j\) (respectively, \({r}-i +1+ 2{r}({s}-j)\)) are all different, for \(0\le i \le r\) and \(0\le j \le s\).

Black-hole Gadget. Finally we add a gadget, which will force the immunizing set Y to contain a specific number of nodes for selection (r nodes) and multiple gadgets (2rs nodes). We add a bag B of \(|B|= k\) (the value k will be determined later) nodes and connect it to the guard bags in all the selection, multiple and incidence gadgets. For each \(v \in B\), we set \(t(v)=1\).

The value of k and \(\ell \) are set to \(k={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}\) and \(\ell = {q}{r}+ {{q}\atopwithdelims ()2} 2 {r}{s}.\) In order to prove the desired result, we need the following lemmata 1 and 4.

Lemma 1

If \(\langle G, q\rangle \) is a yes instance of MQ then \(\langle G', k,\ell \rangle \) is a yes instance of IIB.

Proof

Let \(K=(V(K),E(K))\) be a multicolored clique of G. We will show how to select nodes to be added to the immunizing set Y according to the nodes in K. First of all notice that, all the nodes in the bags \({{L_c}\text{-pos }}\), \({{L_c}\text{-neg }}\), \({{L_{cd}}\text{-pos }}\), and \({{L_{cd}}\text{-neg }}\) belong to \(Y \cup {\textsf{D}}_{G',Y}\), as they all have threshold zero.

For each \(c \in [q],\) if the unique node of color c in K is \({v_i^c}\), the i-th node in \(V_c\), then we add i nodes of \({{L_c}\text{-neg }}\) and \({r}-i\) nodes of \({{L_c}\text{-pos }}\) to Y. For each pair of distinct \(c,d \in [q],\) if the unique edge with endpoints of colors c and d in K is \({e_j^{cd}}\), then we add \(2{r}j\) nodes of \({{L_{cd}}\text{-neg }}\) and \(2{r}({s}-j)\) nodes of \({{L_{cd}}\text{-pos }}\) to Y. Overall, \(|Y|= \ell ={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) 2{r}{s}\). We now prove that \(|{\textsf{D}}_{G',Y}|=k={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}\).

Consider the diffusion process in \(V(G')-Y\). At the first round, all non immunized nodes with threshold zero are influenced; hence \({\textsf{D}}_{G',Y}[1]\) contains: i nodes of \({{L_c}\text{-pos }}\) and \({r}-i\) nodes of \({{L_c}\text{-neg }}\), for all \(c\in [{q}]\), \(2{r}j\) nodes of \({{L_{cd}}\text{-pos }}\), \(2{r}({s}-j)\) nodes of \({{L_{cd}}\text{-neg }}\), for all \(c,d\in [{q}]\) with \(c\ne d\).

We claim that, at the second round, the additional influenced nodes (in the neighborhood of \({\textsf{D}}_{G',Y}[1]\)) are exactly: \({s}\) nodes in \({{M_{cd}}\text{-pos }}\cup {{M_{cd}}\text{-neg }}\), \({s}\) nodes in \({{I_{c:cd}}\text{-pos }}\cup {{I_{c:cd}}\text{-neg }}\), and \({s}\) nodes in \({{I_{d:cd}}\text{-pos }}\cup {{I_{d:cd}}\text{-neg }}\), for each pair of distinct \(c,d \in [{q}]\). Indeed, let \({{M_{cd}}\text{-pos }}= \{x_0, \ldots , x_{s}\}\) and \({{M_{cd}}\text{-neg }}=\{y_0, \ldots , y_{s}\}\). Since at the end of the first round the nodes in \({{M_{cd}}\text{-pos }}\) have \(2{r}j\) influenced neighbors in \({{L_{cd}}\text{-pos }}\) and the nodes in \({{M_{cd}}\text{-neg }}\) have \(2{r}({s}-j)\) influenced neighbors in \({{L_{cd}}\text{-neg }}\), recalling that \(t(x_j)=t(y_j)=2{r}j+1\), we have that nodes \(x_0, \ldots , x_{j-1}\) in \({{M_{cd}}\text{-pos }}\) and nodes \(y_0, \ldots , y_{{s}-j-1}\) in \({{M_{cd}}\text{-neg }}\) get influenced. Overall \({s}\) nodes in \({{M_{cd}}\text{-pos }}\cup {{M_{cd}}\text{-neg }}\) are influenced at the second round.

Consider now the incidence gadgets. Since there are \(2{r}j+i\) influenced nodes in \({{L_c}\text{-pos }}\cup {{L_{cd}}\text{-pos }}\) that are in neighborhood of the nodes in \({{I_{c:cd}}\text{-pos }}\), recalling that the thresholds of nodes in \({{I_{c:cd}}\text{-pos }}\) are:

$$\begin{aligned} t(u_j)= & {} 2{r}j+i+1>2{r}j+i \text{ and }\\ t(u_h)= & {} 2{r}h+h'+1 \text{ for } \text{ each } 0 \le h \le s, \ h\ne j\text{, } \text{ and } 0 \le h'\le {r}, \end{aligned}$$

we have

$$\begin{aligned} t(u_h)\le & {} 2{r}h+{r}+1 \le 2{r}(j-1)+r+1 =2{r}j -{r}+1\le 2{r}j +i \quad \text{ if } h < j\\ t(u_h)\ge & {} 2{r}h +1 \ge 2{r}(j+1)+1>2{r}j+2{r}+1>2{r}j+i \qquad \qquad \text{ if } h > j\text{. } \end{aligned}$$

Hence, nodes \(u_0, \ldots , u_{j-1}\) in \({{I_{c:cd}}\text{-pos }}\) are influenced at the second round.

We now make a similar analysis for the nodes in \({{I_{c:cd}}\text{-neg }}\). Since there are \(2{r}({s}-j)+{r}-i\) influenced nodes in \({{L_c}\text{-neg }}\cup {{L_{cd}}\text{-neg }}\) that are in neighborhood of the nodes in \({{I_{c:cd}}\text{-neg }}\), recalling that the threshold of nodes in \({{I_{c:cd}}\text{-neg }}\) are:

$$\begin{aligned} t(w_j)= & {} 2{r}({s}-j)+{r}-i+1 \ > \ 2{r}({s}-j)+{r}-i \text{ and }\\ t(w_h)= & {} 2{r}({s}-h)+{r}-h'+1 \text{ for } \text{ some } 0 \le h'\le {r}, \end{aligned}$$

we have

$$\begin{aligned}{} & {} t(w_h) \ge 2{r}({s}-h)+1 \ge 2{r}({s}-j)+2{r}+1> 2{r}({s}-j)+{r}-i \qquad \text{ for } h < j\\{} & {} t(w_h) \le 2{r}({s}-h)+{r}+1 \le 2{r}({s}-j)-{r}+1 \le 2{r}({s}-j)+{r}-i \quad \text{ for } h > j. \end{aligned}$$

Hence, nodes \(w_{j+1}, \ldots , w_{s}\) in \({{I_{c:cd}}\text{-neg }}\) are influenced at the second round. Overall, we have that s nodes in \({{I_{c:cd}}\text{-pos }}\cup {{I_{c:cd}}\text{-neg }}\) are influenced at the second round.

Using exactly the same argument we can show that s nodes in \({{I_{d:cd}}\text{-pos }}\cup {{I_{d:cd}}\text{-neg }}\) are influenced at the second round.

Finally, the nodes in \({{L_c}\text{-guard }}\) (resp. \({{L_{cd}}\text{-guard }}\)) have \({r}\) (resp. \(2{r}{s}\)) influenced neighbors at the end of the first round and since all of them have threshold \(r+1\) (resp. \(2{r}{s}+1\)), we have that none of them gets influenced at the second round.

We notice now that only the nodes in \({{M_{cd}}\text{-guard }}\) and \({{I_{c:cd}}\text{-guard }}\) have neighbors in \({\textsf{D}}_{G',Y}[2]\). However, they cannot be influenced (indeed, each of them has threshold \({s}+1\) but it has only s influenced neighbors in \({\textsf{D}}_{G',Y}[2]\) – either in \({{M_{cd}}\text{-pos }}\ \cup {{M_{cd}}\text{-neg }}\) or in \({{I_{c:cd}}\text{-pos }}\cup {{I_{c:cd}}\text{-neg }}\)). We have that \({\textsf{D}}_{G',Y}[3]={\textsf{D}}_{G',Y}[2]\) and the diffusion process stops.

Summarizing, \({\textsf{D}}_{G',Y}\) contains: \({r}\) influenced nodes for each of the \({q}\) nodes in the clique K (those that are influenced in the selection gadgets \({L_c}\) for \(c\in [{q}]\)), \(2{r}{s}+{s}\) influenced nodes for each of the \(\left( {\begin{array}{c}{q}\\ 2\end{array}}\right) \) edges in K (those in the multiple gadgets \({M_{cd}}\), for \(c,d \in [{q}]\)) and 2s influenced nodes, for each of the \(\left( {\begin{array}{c}{q}\\ 2\end{array}}\right) \) edges in K (those in the incidence gadgets \({I_{c:cd}}\) and \({I_{d:cd}}\), for distinct \(c,d \in [{q}]\)). Hence, the set \({\textsf{D}}_{G',Y}\) contains \(k= {q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}\) nodes. \(\square \)

Let Y be an immunizing set such that \(|Y|\le \ell ={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) 2{r}{s}\) and \(|{\textsf{D}}_{G',Y}|\le k= {q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}\). In the following we derive some useful constraints on the nodes contained in Y and \({\textsf{D}}_{G',Y}\).

Lemma 2

For distinct \(c,d \in [{q}]\), no node in \({{L_c}\text{-guard }}\), \({{L_{cd}}\text{-guard }}\), \({{I_{c:cd}}\text{-guard }}\), \({{I_{d:cd}}\text{-guard }}\), \({{M_{cd}}\text{-guard }}\) can be in \({\textsf{D}}_{G',Y}\).

Proof

Since the threshold of each \(v \in B\) is \(t(v)=1\), it is sufficient that at least one guard node \(g \in {{L_c}\text{-guard }}\cup {{L_{cd}}\text{-guard }}\cup {{I_{c:cd}}\text{-guard }}\cup {{I_{d:cd}}\text{-guard }}\cup {{M_{cd}}\text{-guard }}\) is influenced to influence the whole B. However this cannot be since \(|B|+1=k+1 > |{\textsf{D}}_{G',Y}|\). \(\square \)

Lemma 3

For distinct \(c,d \in [{q}]\), both Y and \({\textsf{D}}_{G',Y}\) contain

  1. 1.

    exactly \({r}\) nodes of \(({{L_c}\text{-pos }}\cup {{L_c}\text{-neg }})\),

  2. 2.

    exactly \(2{r}{s}\) nodes of \(({{L_{cd}}\text{-pos }}\cup {{L_{cd}}\text{-neg }}\)),

  3. 3.

    a multiple of \(2{r}\) nodes of \({{L_{cd}}\text{-pos }}\) and \({{L_{cd}}\text{-neg }}\).

Proof

First of all notice that all the nodes in \({{L_c}\text{-pos }}\), \({{L_c}\text{-neg }}\), \({{L_{cd}}\text{-pos }}\), and \({{L_{cd}}\text{-neg }}\) have threshold zero, and consequently belong to \(Y \cup {\textsf{D}}_{G',Y}\).

We claim that at most \({r}\) of the nodes of \(({{L_c}\text{-pos }}\cup {{L_c}\text{-neg }})\) can be in \({\textsf{D}}_{G',Y}\). Indeed, if \({\textsf{D}}_{G',Y}\) contains at least \({r}+1\) nodes in \(({{L_c}\text{-pos }}\cup {{L_c}\text{-neg }})\) then each node \(g \in {{L_c}\text{-guard }}\) (recall \(t(g)={r}+1\)) either is influenced (i.e., \(g \in {\textsf{D}}_{G',Y}\)) or is immunized (i.e., \(g \in Y\)). However, by Lemma 2, no node in \({{L_c}\text{-guard }}\) can be influenced. Moreover, it cannot occur that all the nodes in \({{L_c}\text{-guard }}\) are immunized, since \(|{{L_c}\text{-guard }}|=\ell +1 > |Y|\).

Using the same argument we can prove that at most \(2{r}{s}\) of the nodes of \(({{L_{cd}}\text{-pos }}\cup {{L_{cd}}\text{-neg }})\) can be in \({\textsf{D}}_{G',Y}\).

This allows to say that Y contains at least \({r}\) nodes of \(({{L_c}\text{-pos }}\cup {{L_c}\text{-neg }})\) and at least \(2{r}{s}\) nodes of \(({{L_{cd}}\text{-pos }}\cup {{L_{cd}}\text{-neg }})\). However, if there exists \(c \in [{q}]\) or a pair of distinct \(c,d \in [{q}]\) such that Y contains strictly more than \({r}\) nodes of \(({{L_c}\text{-pos }}\cup {{L_c}\text{-neg }})\) or \(2{r}{s}\) nodes of \(({{L_{cd}}\text{-pos }}\cup {{L_{cd}}\text{-neg }})\), then \(|Y|>{q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) 2{r}{s}\) and this is not possible. Hence, 1) and 2) follow.

To prove that 3) holds, we proceed by contradiction. Suppose that \({\textsf{D}}_{G',Y}\) contains \(2{r}a+z\) nodes of \({{L_{cd}}\text{-pos }}\), for some \(a < {s}\) and \(0< z < 2{r}\). By 2) we have that \({\textsf{D}}_{G',Y}\) contains \(2{r}({s}-a)-z\) nodes of \({{L_{cd}}\text{-neg }}\). Let \({{M_{cd}}\text{-pos }}=\{x_0, \ldots , x_{s}\}\) and \({{M_{cd}}\text{-neg }}=\{y_0, \ldots , y_{s}\}\). Recalling that the nodes in \({{M_{cd}}\text{-pos }}\) are neighbors of those in \({{L_{cd}}\text{-pos }}\), the nodes in \({{M_{cd}}\text{-neg }}\) are neighbors of those in \({{L_{cd}}\text{-neg }}\) and \(t(x_i) = t(y_i) = 2{r}i+1\), we have that nodes \(x_0, \ldots , x_a\) of \({{M_{cd}}\text{-pos }}\) and nodes \(y_0, \ldots , y_{{s}-a-1}\) of \({{M_{cd}}\text{-neg }}\) get influenced. Since these \({s}+1\) influenced nodes are neighbors of each node \(g \in {{M_{cd}}\text{-guard }}\), whose threshold is \(t(g)={s}+1\), it follows that either g is influenced or it is immunized. By Lemma 2, no node in \({{M_{cd}}\text{-guard }}\) can be influenced. On the other hand, it cannot occur that all the nodes in \({{M_{cd}}\text{-guard }}\) are immunized, since \(|{{M_{cd}}\text{-guard }}|=\ell +1 > |Y|\) and we obtain the desired contradiction. \(\square \)

Lemma 4

If \(\langle G',k,\ell \rangle \) is a yes instance of IIB then \(\langle G, q\rangle \) is a yes instance of MQ.

Proof

Since \(\langle G',k,\ell \rangle \) is a yes instance of IIB, there exists an immunizing set Y of size at most \(\ell ={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) 2{r}{s}\) such that \(|{\textsf{D}}_{G',Y}|\le k={q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}.\)

We proceed by identifying the clique K of G according to the number of nodes that are in \({{L_c}\text{-neg }}\ \cap Y\) for each \(c\in [q]\) and in \({{L_{cd}}\text{-neg }}\ \cap Y\), for each distinct \(c,d \in [q].\) Namely, we select:

  • the node \({v_i^c}\in {V_c}\), such that \(|{{L_c}\text{-neg }}\cap Y|=i\), for some \(0 \le i \le {r}\), and

  • the edge \({e_j^{cd}}\in {E_{cd}}\) such that \(|{{L_{cd}}\text{-neg }}\cap Y|=2{r}j\), for some \(0 \le j \le {s}\).

The above selection is correct since, by Lemma 3, we know that

$$\begin{aligned} |Y\cap ({{L_c}\text{-pos }}\ \cup {{L_c}\text{-neg }})|={r} \text{ and } |Y\cap ({{L_{cd}}\text{-pos }}\ \cup {{L_{cd}}\text{-neg }})|= 2{r}{s}; \end{aligned}$$

in particular, Y contains a multiple of \(2{r}\) nodes of both \({{L_{cd}}\text{-pos }}\) and \({{L_{cd}}\text{-neg }}\).

Let V(K) be the set of the q selected nodes and E(K) be the set of the \(\left( {\begin{array}{c}{q}\\ 2\end{array}}\right) \) selected edges. We argue that \(K=(V(K),E(K))\) is a clique. By contradiction assume there are two distinct colors \(c,d \in [q]\) such that \({v_i^c}\in V(K)\) and \({e_j^{cd}}\in E(K)\) but \({v_i^c}\) is not an endpoint of \({e_j^{cd}}\). Consider the incidence gadget \({I_{c:cd}}\). Let \({{I_{c:cd}}\text{-pos }}= \{u_0, \ldots , u_{s}\}\) and \({{I_{c:cd}}\text{-neg }}= \{w_0, \ldots , w_{s}\}\). Assume that \({v_h^c}\) is the endpoint of color c of \({e_j^{cd}}\). Recall that nodes \(u_j\) and \(w_j\) represent the edge \({e_j^{cd}}\) and that, by the construction of \(G'\), it holds \(t(u_j)= 2{r}j +h+1\) and \(t(w_j)= 2{r}({s}-j) +{r}-h +1\).

Recalling that the nodes of \({{I_{c:cd}}\text{-pos }}\) have \(2{r}j+i\) influenced neighbors (those in \({\textsf{D}}_{G',Y} \cap ({{L_c}\text{-pos }}\cup {{L_{cd}}\text{-pos }})\)) and the nodes of \({{I_{c:cd}}\text{-neg }}\) have \(2{r}({s}-j)+{r}-i\) influenced neighbors, (those in \({\textsf{D}}_{G',Y} \cap ({{L_c}\text{-neg }}\cup {{L_{cd}}\text{-neg }})\)), we can perform an analysis similar to that in the proof of Lemma 1, thus obtaining that all the nodes \(u_0, \ldots , u_{j-1}\) in \({{I_{c:cd}}\text{-pos }}\) and \(w_{j+1}, \ldots , w_{s}\) in \({{I_{c:cd}}\text{-neg }}\) get influenced. It remains to analyze the nodes \(u_j\) and \(w_j\). We will prove that at least one of them gets influenced: If \(h < i\) then \(t(u_j)= 2{r}j +h+1 \le 2{r}j +i\) and \(u_j\) is influenced; if \(h > i\) then \(t(w_j)= 2{r}({s}-j) +{r}-h +1 \le 2{r}({s}-j) +{r}-i\) and \(w_j\) is influenced. This allows to say that if \({v_h^c}\in {e_j^{cd}}\) then \({s}+1\) nodes among those in \({{I_{c:cd}}\text{-pos }}\) and \({{I_{c:cd}}\text{-neg }}\) are influenced. As a consequence, each node \(g \in {{I_{c:cd}}\text{-guard }}\), whose threshold is \(t(g)={s}+1\), must either be influenced or immunized. By Lemma 2, no node in \({{I_{c:cd}}\text{-guard }}\) can be influenced. On the other hand, it cannot occur that all the nodes in \({{I_{c:cd}}\text{-guard }}\) are immunized, since \(|{{I_{c:cd}}\text{-guard }}|=\ell +1 > |Y|\) and we obtain the desired contradiction. \(\square \)

Theorem 5

IIB is W[1]-hard with respect to the neighborhood diversity of the input graph.

Proof

By the above Lemmas, we have that \(\langle G, q\rangle \) is a yes instance of MQ iff \(\langle G', k,\ell \rangle \) is a yes instance of IIB, where \(k= {q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) (2{r}+ 3) {s}\), \(\ell = {q}{r}+ \left( {\begin{array}{c}{q}\\ 2\end{array}}\right) 2{r}{s}\).

We complete the proof by showing that \(G'\) has neighborhood diversity \(O(q^2)\). Since each bag in \(G'\) is a type set in the type partition of \(G'\) and, since for each \(c\in [q]\), there are three bags in \({L_c}\) and, for each \(c, d \in [q]\) with \(c\ne d\) there are six bags in \({M_{cd}}\), and three bags in both \({I_{c:cd}}\) and \({I_{d:cd}}\), we have that the neighborhood diversity of \(G'\) is \(3 q + 12 \left( {\begin{array}{c}q\\ 2\end{array}}\right) \). \(\square \)

5 FPT Algorithms

In this section, we present FPT algorithms for several pairs of parameters.

5.1 Parameters k and \(\ell \)

For such a pair of parameters, we observe that the fixed parameter tractability of IIB with respect to \(k+\ell \) can be proved by the arguments used in Theorem 1 of [25] for the problem cutting at most k vertices with terminal. For the sake of completeness, the proof is given in the following.

Theorem 6

IIB can be solved in time \(2^{k+\ell }(k+\ell )^{O(\log (k+\ell ))}\cdot n^{O(1)}\).

Proof

Let \(\langle G,k, \ell \rangle \) be the input instance of IIB. Consider a random labelling of the nodes of G, where each node is independently assigned either 0 or 1 with equal probability. Let now \(H=G[V_1]\) be the graph induced by the set \(V_1\) of nodes having label 1. Consider the set \({\textsf{D}}_H\) of influenced nodes when we run the diffusion process on H. If \(|{\textsf{D}}_H|\le k\) and \(|Y({\textsf{D}}_H)|\le \ell \) then (4) holds for \(X={\textsf{D}}_H\) and we can answer yes.

We estimate now the number of needed iterations of random labelling. Suppose G contains a set X satisfying (4). For such a set, it holds \(|X|=|{\textsf{D}}_{G[X]}|\le k\) and \(|Y(X)|\le \ell \), then a random labelling identifies a solution of IIB if and only if all the nodes in X are labelled 1 and all the nodes in Y(X) are labelled 0, that is,

$$\begin{aligned} X\subseteq V_1 \text{ and } Y(X)\cap V_1=\emptyset . \end{aligned}$$

Indeed, in such a case the above procedure identifies \({\textsf{D}}_H=X\) as a solution. This happens with probability \(2^{-(|{\textsf{D}}_H|+|Y({\textsf{D}}_H)|)}\ge 2^{-(k+\ell )}\). Hence, the algorithm requires time \(2^{k+\ell } n^{O(1)}\).

A derandomization of the above process can be done using universal sets. A (ni)-universal set is a collection of binary vectors of length n such that for each set of i indices, each of the \(2^{i}\) possible combinations of values appears in some vector of the set. To run the algorithm, it suffices to try all labellings induced by a \((n, k + \ell )\)-universal set. Naor et al. [18] give a construction of (ni)-universal sets of size \(2^i i^{O(\log i)} \log n\) that can be listed in linear time. \(\square \)

5.2 Parameters k and \(\zeta \)

Theorem 7

IIB can be solved in time \(O( \zeta ^{3k} n^5)\), where \(\zeta {=} |\{v\in V \mid t(v)=0\}|\).

Proof

Let \(\langle G, k, \ell \rangle \) be the input instance of IIB. Suppose \(v_1,\ldots v_\zeta \) are the nodes in G having threshold 0 and let \(\Delta \) denote the maximum degree of a node in G. Consider the graph \(G'=(V',E')\) obtained from G by adding the internal nodes and the edges of a \(\Delta \)-ry tree whose leaves are \(v_1,\ldots v_\zeta \). Assume \(\langle G, k,\ell , \rangle \) is a yes instance of IIB. We notice that in G, the solution set X (cfr. (4)) can be disconnected but any of its connected components must include at least one node of threshold 0. Hence, in \(G'\) the nodes in X are now connected through a path in the \(\Delta \)-ry tree. This implies that there exists \(X'\subseteq V'\) such that: \(X\subseteq X'\), \((X'-X)\subseteq V'-V\), and \(G'[X']\) is connected. In particular, if s is the root of the tree, we can assume that \(s\in X'\). In the worst case, all the paths within the \(\Delta \)-ry tree go through the root s, hence \(|X'|\le |X|\log _{\Delta } \zeta +1\).

Let \(k'=k\log _{\Delta } \zeta +1\). We use the following result [36], Lemma 2: There are at most \(4^{k'}\Delta ^{k'}\) connected subgraphs that contain s and have order at most \(k'\). Furthermore, these subgraphs can be enumerated in \(O(4^{k'}\Delta ^{k'}(|V'|+ |E'|))\) time. This can be done in time \(O(\zeta ^{3k}n^3)\) noticing that \((4\Delta )^{k'}(|V'|+ |E'|)\le 4\Delta \zeta ^{k+\frac{k}{\log _4\Delta }}({2n^2})\le 8 \zeta ^{3k} n^3\). We can then apply the result in [36] to enumerate all the connected subgraphs of \(G'\) of size up to \(k'\). For each candidate set \(X'\) (the node set of the current connected subgraph) one has to determine whether \(X'\cap V\) is a solution according to (4), which can be done in \(O(n^2)\) time. \(\square \)

5.3 Parameters k (or \(\Delta \)) and Treewidth

We present an algorithm that makes use of the nice tree decomposition of a graph [34].

Definition 4

A tree decomposition \((T,\{W_u\}_{u \in V(T)})\) is called nice if it satisfies conditions 1. and 2.:

  1. 1.

    \(W_r=\emptyset \) for r the root of T and \(W_v=\emptyset \) for every leaf v of T.

  2. 2.

    Every non-leaf node of T is of one of the following three types:

    • Introduce: a node u with exactly one child \(u'\) such that \(W_u=W_{u'}\cup \{v\}\) for a node \(v\notin W_{u'}\).

    • Forget: a node u with exactly one child \(u'\) such that \(W_{u'}=W_u\cup \{v\}\) for a node \(v\notin W_{u}\).

    • Join: a node u with two children \(u_1,u_2\) such that \(W_{u}=W_{u_1}=W_{u_2}\)

Lemma 5

[34] If a graph G admits a tree decomposition of width at most \(\mathtt{{tw}}\), then it admits a nice tree decomposition of width at most \(\mathtt{{tw}}\). Moreover, given a tree decomposition \((T,\{W_u\}_{u \in V(T)})\) of G of width at most \(\mathtt{{tw}}\), one can compute in time \(O(\mathtt{{tw}}^2 \max \{|V(T)|,|V(G)|\})\) a nice tree decomposition of G of width at most \(\mathtt{{tw}}\) that has at most \(O(\mathtt{{tw}}|V(G)|)\) nodes.

We give a dynamic programming algorithm, which exploiting a nice tree decomposition, enables to solve a minimization version of IIB, namely the

Influence Diffusion Minimization (IDM): Given a graph \(G=(V,E,t)\) and a budget \(\ell \), find a set Y such that \(|Y|\le \ell \) and \(|{\textsf{D}}_{G,Y}|\) is minimized.

Consider a graph \(G=(V,E)\) with treewidth \(\mathtt{{tw}}\) and nice tree decomposition \((T,\{W_u\}_{u \in V(T)})\). Let T be rooted at node r and denoted by T(u) the subtree of T rooted at u, for any node u of T. Moreover, we denote by W(u) the union of all the bags in T(u), i.e., \(W(u)=\bigcup _{v \in T(u)} W_v\). We will denote by \(s_u = |W_u|\) the size of \(W_u\).

We recursively compute the solution of IDM. The algorithm exploits a dynamic programming strategy and traverses the input tree T in a breadth-first fashion. Fix a node u in T,  in order to be able to recursively reconstruct the solution, we calculate optimal solutions under different hypotheses based on the following considerations:

  • For each node \(v \in W_u\) we have three cases: v gets influenced, v is immunized, or v is safe. We are going to consider all the \(3^{s_u}\) combinations of such states with respect to some solution of the problem. We denote each combination with a vector \({{\mathcal {C}}}\) of size \(s_u\) indexed by the elements of \(W_u\), where the element indexed by \(v\in W_u\) denotes the state influenced (\({0}\)), immunized (\({1}\)), safe (\({2}\)) of node v. The configuration \({{\mathcal {C}}}=\emptyset \) denotes the vector of length 0 corresponding to an empty bag. We denote by \({{\mathbb {C}}}_u\) the family of all the \(3^{s_u}\) possible state vectors of the \(s_u\) nodes in \(W_u\).

  • Let U be a subset of V(G). Let us first notice that by 3) of Definition 3, all the edges between nodes in \(V-W(u)\) and W(u) connect a node in \(V-W(u)\) with a node in \(W_u\) (the bag corresponding to the root of T(u)). We are going to consider all the possible contribution to the diffusion process, of nodes in \(V-W(u)\); that is, for each \(v \in W_u\), we consider all the possible thresholds among \(t(v),t(v)-1,\ldots ,t(v)-\min \{k,t(v)\}\) (recall that at most k nodes belong to X and can therefore reduce the threshold of v). We notice that, for each node v, it is possible to bound the number of thresholds to be considered by the value \(\min \{k,t(v)\}\). Moreover, since no node with \(t(v)>d_G(v)\) can be influenced and we can purge such nodes from G in a preprocessing step, we can assume that in G it holds \((\max _{v\in V} t(v))\le \Delta \). As a consequence, we will have up to \(\mu ^{s_u}\) threshold combinations, where \(\mu =\min \{k,\Delta \}\). We will denote each possible threshold combination with a vector \({{\mathcal {T}}}\), indexed by the \(s_u\) elements in \(W_u\), where the element indexed by v belongs to \(\{\max \{0,t(v)-k\},\ldots ,t(v)\}\) and denotes the threshold of \(v \in W_u\). The configuration \({{\mathcal {T}}}=\emptyset \) denotes the vector of length 0 corresponding to an empty bag. We denote by \({{\mathbb {T}}}_u\) the family of all the possible threshold combinations of nodes in \(W_u\).

The following definition introduces the values that will be computed by the algorithm in order to keep track of all the above cases:

Definition 5

For each node \(u\in T,\) each \(j=0,\ldots , \ell \), \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\) and \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\) we denote by \(X_u(j,{{\mathcal {C}}},{{\mathcal {T}}})\) the minimum number of influenced nodes one can attain in G[W(u)] by immunizing at most j nodes in W(u), where the states and the thresholds of nodes in \(W_u\) are given by \({{\mathcal {C}}}\) and \({{\mathcal {T}}}\).

By noticing that the root r of a nice tree decomposition has \(W_r = \emptyset \), we have that the solution of the IDM instance \(\langle G, \ell \rangle \) can be obtained by computing \(X_r(\ell ,\emptyset ,\emptyset ).\)

Lemma 6

For each \(u\in T\), the computation of \(X_u(j,{{\mathcal {C}}},{{\mathcal {T}}})\), for each \(j\in \{0,\ldots , \ell \}\), state configuration \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\), and threshold configuration \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\) comprises \(O(\ell 3^\mathtt{{tw}}\mu ^{\mathtt{{tw}}})\) values, where \(\mu =\min \{k, \Delta \}\), each of which can be computed recursively in time \(O(2^\mathtt{{tw}}+\ell )\).

Proof

We show how use a bottom–up strategy to compute all the values of \(X_u(j,{{\mathcal {C}}},{{\mathcal {T}}})\), for each \(u\in T\), \(j=0,\ldots ,\ell \), state configuration \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\), and threshold configuration \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\). By Definition 5, we know that such values are \(O(\ell 3^\mathtt{{tw}}\mu ^{\mathtt{{tw}}})\), where \(\mu =\min \{k, \Delta \}\).

For each leaf \(u \in T\) and for each \(j=0,\ldots ,\ell \) we have \( X_u(j,\emptyset ,\emptyset )= 0.\)

For any internal node u, we show how to compute each values \(X_u(j,{{\mathcal {C}}},{{\mathcal {T}}})\), for each \(j=0,\ldots , \ell \), \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\), and \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\) in time \(O(2^\mathtt{{tw}}+\ell )\).

We have three cases to consider according to the type of u (cf. Definition 4):

  1. 1)

    Node u is an introduce node. In this case u has exactly one child \(u'\) and we have that \(W_u=W_{u'} \cup \{v\}\) for some node \(v \notin W_{u'}\). For a given node \(u \in V(T)\) (introducing a node \(v \in V\)) and state configuration \({{\mathcal {C}}}\), we denote by \(S_{u}({{\mathcal {C}}})\) the set of influenced nodes (according to the configuration \({{\mathcal {C}}}\)) that belongs to \(W_u \cap {\Gamma _G(v)}\). Given a threshold configuration \({{\mathcal {T}}}\) associated to a set of nodes W, and a set of nodes \(S\subseteq W\), we denote by \({{\mathcal {T}}}(S)\) the configuration obtained starting from \({{\mathcal {T}}}\) and decreasing by one the threshold of each node in S. In the following we assume w.l.o.g. that the element indexed by v is the last element of the vectors \({{\mathcal {C}}}\) and \({{\mathcal {T}}}\). We have that for each \(j=0,\ldots , \ell \), each \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\) and each \({{\mathcal {T}}}\in {{\mathbb {T}}}_u.\)

    $$\begin{aligned} X_u(j,{{\mathcal {C}}}{=}[{{\mathcal {C}}}',c], {{\mathcal {T}}}{=}[{{\mathcal {T}}}',t])= {\left\{ \begin{array}{ll} { min_{S\subseteq S_{u}({{\mathcal {C}}}), |S|\ge t} \big (X_{u'}(j,{{\mathcal {C}}}',{{\mathcal {T}}}'(S_{u}({{\mathcal {C}}}){-}S)) \big ){+} 1}, \\ \qquad \qquad \text{ if } c={0} \text{ AND } t \le |S_{u}({{\mathcal {C}}})|\\ X_{u'}(j-1,{{\mathcal {C}}}',{{\mathcal {T}}}'),\\ \qquad \qquad \text{ if } c={1} \text{ AND } j>1 \\ X_{u'}(j,{{\mathcal {C}}}',{{\mathcal {T}}}'), \\ \qquad \qquad \text{ if } c={2} \text{ AND } t > |S_{u}({{\mathcal {C}}})|\\ +\infty , \qquad \text{ otherwise. } \end{array}\right. } \end{aligned}$$
    (6)

    It is worth to observe that the size of \(S_{u}(C)\) is bounded by \(\mathtt{{tw}}\) and for this reason the above value can be computed in time \(O(2^\mathtt{{tw}})\)

  2. 2)

    Node u is a forget node. In this case u has exactly one child \(u'\) and we have that \(W_{u'}=W_{u} \cup \{v\}\) for some node \(v \notin W_u\). We have for each \(j=0,\ldots , \ell \), each \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\), and each \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\)

    $$\begin{aligned} X_u(j,{{\mathcal {C}}}, {{\mathcal {T}}})=min_{c\in \{{0},{1},{2}\}}\{X_{u'}(j,{{\mathcal {C}}}'=[{{\mathcal {C}}},c],{{\mathcal {T}}}'=[{{\mathcal {T}}},\max \{0,t(v)-|S_{u}({{\mathcal {C}}})|\}] )\} \end{aligned}$$
    (7)
  3. 3)

    Node u is a join node. In this case u has exactly two child \(u_1\), \(u_2\) such that \(W_{u} = W_{u_1} = W_{u_2}\). We have for each \(j=0,\ldots , \ell \), each \({{\mathcal {C}}}\in {{\mathbb {C}}}_u\), and each \({{\mathcal {T}}}\in {{\mathbb {T}}}_u\)

    $$\begin{aligned} X_u(j,{{\mathcal {C}}}, {{\mathcal {T}}})=min_{0\le a\le j-I({{\mathcal {C}}})}\{X_{u_1}(a+I({{\mathcal {C}}}),{{\mathcal {C}}},{{\mathcal {T}}})+\{X_{u_2}(j-a,{{\mathcal {C}}},{{\mathcal {T}}})\}, \end{aligned}$$
    (8)

    where \(I({{\mathcal {C}}})\) denotes the number of immunized nodes in the configuration state \({{\mathcal {C}}}.\)

By induction on the tree, we can prove that the recursive formula presented in (8)–(10) coincides with the definition of \(X_u(\cdot , \cdot , \cdot )\); hence, the algorithm is correct. \(\square \)

Theorem 8

IDM is solvable in time \(O(n\mathtt{{tw}}(2^\mathtt{{tw}}+\ell )\ell 3^\mathtt{{tw}}\mu ^{\mathtt{{tw}}})\), where \(\mu =\min \{k, \Delta \}\).

Proof

By using Lemma 18 in [34], we have that the desired value \(X_r(\ell ,\emptyset ,\emptyset )\), which corresponds to the solution of the IDM instance \(\langle G, \ell \rangle \), can be computed in time \(O(n\mathtt{{tw}}(2^\mathtt{{tw}}+\ell )\ell 3^\mathtt{{tw}}\mu ^{\mathtt{{tw}}}).\) The optimal set X can be computed in the same time by standard backtracking techniques. \(\square \)

5.4 Graphs of Bounded Neighborhood Diversity

We give FPT algorithms for IIB with respect to both the pairs \((k,\mathtt{{nd}})\) and \((\ell ,\mathtt{{nd}})\).

We first present some result that will be useful in the rest of this section.

Let \(\{V_1,V_2, \ldots , V_\mathtt{{nd}}\}\) be the type partition of G. Below, we assume that the nodes of each \(V_i=\{v_{i,1},\ldots ,v_{i,|V_i|}\}\) are sorted in non-decreasing order of thresholds, i.e., \(t(v_{i,j})\le t(v_{i,j+1})\).

Lemma 7

Fix \(i\in [\mathtt{{nd}}]\).

  1. (i)

    Let \(X={\textsf{D}}_{G[X]}\) and \(Y=Y(X)\) be its immunizing set. Set \(u_{max}={{\,\mathrm{arg\,max}\,}}_{u\in X \cap V_i}t(u)\). If there exists \(v \in Y \cap V_i\) such that \(t(v) \le t(u_{max})\) then \(X'=X - \{u_{max}\} \cup \{v\}\) satisfies \(X'= {\textsf{D}}_{G[X']}\) and \(|Y(X')|=|Y|\).

  2. (ii)

    Let Y be an immunizing set. Set \(v_{max}={{\,\mathrm{arg\,max}\,}}_{v\in Y \cap V_i}t(v)\). If there exists \(u \in {\textsf{D}}_{G,Y} \cap V_i\) such that \(t(u) \le t(v_{max})\) then setting \(Y'=Y - \{v_{max}\} \cup \{u\}\) it holds \(|{\textsf{D}}_{G,Y'}|\le |{\textsf{D}}_{G,Y}|\).

Proof

We first prove (i). Consider \(X'=X -\{u_{max}\} \cup \{v\}\) and the diffusion process in \(G[X']\). We have that v is influenced at a round which is at most equal to that in which \(u_{max}\) is influenced during the diffusion process in G[X] (recall \(t(v) \le t(u_{max})\) and that v and \(u_{max}\) have the same neighbors). Furthermore, since all the neighbors of v and \(u_{max}\) have the same number of neighbors in \(X'\) as in X we have that all the nodes in \(X'\) are influenced, that is \(X'= {\textsf{D}}_{G[X']}\), and \(u_{max} \in Y(X')\). This allows to say that \(|Y(X')|=|Y|\).

We now prove (ii). If we consider the diffusion process in \(G[V-Y']\) we have that no node outside \({\textsf{D}}_{G,Y}-\{u\}\), except eventually for node \(v_{max}\), can be influenced. Hence, \({\textsf{D}}_{G,Y'} \subseteq {\textsf{D}}_{G,Y}-\{u\}\cup \{v_{max}\}\). \(\square \)

5.4.1 Parameters \(\mathtt{{nd}}\) and \(k\)

Algorithm IIB-k below constructs one candidate set for each \(\mathtt{{nd}}\)-ple \((f_1,\ldots ,f_\mathtt{{nd}})\), where \(f_i = |X \cap V_i|\) for some solution X, such that \(\sum _{i=1}^{\mathtt{{nd}}} f_i \le k\).

figure a

Theorem 9

Algorithm IIB-k solves IIB in time \(O(n^2\, 2^{k+nd-1} ).\)

Proof

Given \(f\le k\), Algorithm IIB-k(\(G, k, \ell \)) considers all the possible \(\mathtt{{nd}}\)-ples \((f_1,f_2,\ldots ,f_\mathtt{{nd}})\) with \(\sum _{i=1}^{\mathtt{{nd}}} f_i =f\); for each \(f=(f_1,f_2,\ldots ,f_\mathtt{{nd}})\) it constructs the set \(X= \bigcup _{i=1}^{\mathtt{{nd}}} X_i\) where \(X_i\) consists of the first (e.g. with the smallest thresholds) \(f_i\) nodes in \(V_i\). Then it computes the immunizing set of X, Y(x) (cf. Definition 2). If \(|Y(X)|\le \ell \) then we answer yes. In case no \(f\) gives a set X such that \(|Y(X)|\le \ell \), we answer no.

We show now that Algorithm IIB-\(k\) outputs yes iff there exists X satisfying (4).

If the output of Algorithm IIB-\(k\) is yes then trivially the current set X has \(|X |\le k\) and its immunizing set \(|Y(X)|\le \ell \).

Let now \({{\tilde{X}}}\) be a minimal set satisfying (4), that is, \({{\tilde{X}}}={\textsf{D}}_{G[{{\tilde{X}}}]}\), \(|{{\tilde{X}}}|\le k\), and \(|Y( {{\tilde{X}}})|\le \ell \).

Define \({{\tilde{X}}}_i= {{\tilde{X}}} \cap V_i\) and let \(|{{\tilde{X}}}_i|= f_i\), for \(i\in [\mathtt{{nd}}]\). Clearly, \(\sum _{i=1}^{\mathtt{{nd}}}f_i=f\). Consider the nd-ple \(f=(f_1,f_2,\ldots ,f_\mathtt{{nd}})\) and the set \(X= \bigcup _{i=1}^{\mathtt{{nd}}} X_{i}\) constructed at line 4 of algorithm IIB-nd-\(k\). Recall that \(|X_{i}|=f_i\) and \(t(v)\le t(w)\) for each \(v\in X_i\) and \(w\in V_i-X_i\), for each \(i\in [\mathtt{{nd}}]\). We show that the algorithm outputs yes on X.

Fix any \(i\in [\mathtt{{nd}}]\). Knowing that \(|{{\tilde{X}}}_i|=|X_{i}|=f_i\), we have that if \({{\tilde{X}}}_i \ne X_{i}\), then there exists \(u\in {{\tilde{X}}}_i-X_{i}\) and \(v\in X_{i}-{{\tilde{X}}}_i\) such that \(t(v) \le t(u)\). W.l.o.g assume that u is the node with maximum threshold in \({{\tilde{X}}}_i-X_{i}\). Since \({{\tilde{X}}}= {\textsf{D}}_{G[{{\tilde{X}}}]}\), we have that u has at least t(u) neighbors in \({{\tilde{X}}}\). Furthermore, since \(v,u \in V_i\) we have that u and v have the same neighbors. Hence, v has at least \(t(u)\ge t(v)\) neighbors in \({{\tilde{X}}}\). As a consequence, since \(v\notin {{\tilde{X}}}\) we have \(v \in Y({{\tilde{X}}})\). Consider \({{\tilde{X}}}'={{\tilde{X}}} -\{u\} \cup \{v\}\). By (i) in Lemma 7, we have that \({{\tilde{X}}}'= {\textsf{D}}_{G[{{\tilde{X}}}']}\) with \(|{{\tilde{X}}}'|=|{{\tilde{X}}}|\) and \(|Y({{\tilde{X}}}')|=|Y({{\tilde{X}}})|\).

Hence, trading each node in \({{\tilde{X}}}_i-X_{i}\) for one in \(X_i-{{\tilde{X}}}_i\), for each i such that \({{\tilde{X}}}_i \ne X_i\), we can prove that \(|Y(X)|=|Y({{\tilde{X}}})|\le \ell \). Therefore, the algorithm returns yes.

Now we evaluate the running time of the algorithm. For each fixed \(f\in [k]\), the number of all the possible \(\mathtt{{nd}}\)-ples \((f_1,\ldots ,f_\mathtt{{nd}})\) with \(\sum _{i=1}^{\mathtt{{nd}}} f_i = f\), is \(\left( {\begin{array}{c}f + \mathtt{{nd}}-1\\ f\end{array}}\right) \le \left( {\begin{array}{c}k + \mathtt{{nd}}-1\\ f\end{array}}\right) .\) Noticing that for each choice of \((f_1,\ldots ,f_\mathtt{{nd}})\) one needs time O(f) to construct X and \(O(n^2)\) to obtain Y(X) and that

$$\begin{aligned} \sum _{f\in [k]}\left( {\begin{array}{c}f + \mathtt{{nd}}-1\\ f\end{array}}\right) \le \sum _{f\in [k]}\left( {\begin{array}{c}k + \mathtt{{nd}}-1\\ f\end{array}}\right) <2^{k+\mathtt{{nd}}-1}, \end{aligned}$$

the desired result follows. \(\square \)

5.4.2 Parameters \(\mathtt{{nd}}\) and \(\ell \)

An idea similar to that in Algorithm 1 can be used to prove IIB  is FPT with respect to nd  and \(\ell \).

figure b

Theorem 10

Algorithm IIB-\(\ell \) solves IIB in time \(O(n^2\, \ 2^{\ell +\mathtt{{nd}}-1} ).\)

Proof

Given \(h\le \ell \), Algorithm IIB-\(\ell \)(\(G, k, \ell \)) considers all the possible \(\mathtt{{nd}}\)-ples \((h_1,h_2,\ldots ,h_\mathtt{{nd}})\) with \(\sum _{i=1}^{\mathtt{{nd}}} h_i =h\); for each \(\textbf{h}=(h_1,h_2,\ldots ,h_\mathtt{{nd}})\) we construct the set \({Y}= \bigcup _{i=1}^{\mathtt{{nd}}} {Y}_i\) where \({Y}_i\) consists of the first (e.g. with the smallest thresholds) \(h_i\) nodes in \(V_i\). We then consider the diffusion process in G and the set \({\textsf{D}}_{G,Y}\) of influenced nodes when the elements of Y are immunized. If \(|{\textsf{D}}_{G,Y}|\le k\) then we answer yes. In case no \(\textbf{h}\) gives a set Y such that \(|{\textsf{D}}_{G,Y}|\le k\), we answer no.

If Algorithm IIB-nd-\(\ell \) returns yes then the set Y constructed by algorithm IIB-\(\ell \) has size at most \(\ell \) and we know that \(|{\textsf{D}}_{G,Y}|\le k\).

Assume now that there exists \({{\tilde{Y}}}\) such that \(|{{\tilde{Y}}}|=h\le \ell \) and \(|{\textsf{D}}_{G,{{\tilde{Y}}}}|\le k\). Assume w.l.o.g. that no smaller solution exists, that is, for any Y such that \(|{\textsf{D}}_{G,Y}|\le k\) it holds \(|Y|\ge h\).

Define \({{\tilde{Y}}}_i=Y({\textsf{D}}_{G,{{\tilde{Y}}}}) \cap V_i\) and let \(|{{\tilde{Y}}}_i|=h_i\), for \(i\in [\mathtt{{nd}}]\). Clearly, \(\sum _{i=1}^{\mathtt{{nd}}}h_i=h\). Consider the nd-ple \(\textbf{h}=(h_1,h_2,\ldots ,h_\mathtt{{nd}})\) and the set \(Y= \bigcup _{i=1}^{\mathtt{{nd}}} Y_{i}\) constructed at line 4 of algorithm IIB-nd-\(\ell \). Recall that \(|Y_{i}|=h_i\) and \(t(v)\le t(w)\) for each \(v\in Y_i\) and \(w\in V_i-Y_i\).

Since \(|{{\tilde{Y}}}_i|=|Y_{i}|=h_i\), we have that if \({{\tilde{Y}}}_i \ne Y_{i}\), for some i, then there are \(v\in {{\tilde{Y}}}_i -Y_{i}\) and \(u\in Y_{i}-{{\tilde{Y}}}_i\) such that \(t(u) \le t(v)\). W.l.o.g select u as the node with minimum threshold in \(Y_{i}-{{\tilde{Y}}}_i\) and v as the node with maximum threshold in \({{\tilde{Y}}}_i -Y_{i}\). By the fact that \(v \in {{\tilde{Y}}}\) and \({{\tilde{Y}}}\) is minimal, we know that v must have at least t(v) neighbors in \({\textsf{D}}_{G,{{\tilde{Y}}}}\) (otherwise, \({{\tilde{Y}}}-\{v\}\) would be a smaller solution). Furthermore, since \(v,u \in V_i\) we have that they have the same neighbors. As a consequence, also u has at least \(t(v)\ge t(u)\) neighbors in \({\textsf{D}}_{G,{{\tilde{Y}}}}\). Knowing that \(u\not \in {{\tilde{Y}}}\), we have that \(u \in {\textsf{D}}_{G,{{\tilde{Y}}}}\). Set \(Y'={{\tilde{Y}}}-\{v\} \cup \{u\}\). By (ii) in Lemma 7, we have that \( {\textsf{D}}_{G,Y'}\) satisfies \(|{\textsf{D}}_{G,Y'} |\le |{\textsf{D}}_{G,{{\tilde{Y}}}} |\le k\). Hence, \(Y'\) is also a solution.

Starting from \(Y'\), we then can repeat the above reasoning until we get \(Y^r=Y\), the immunizing set considered in the algorithm for the tuple \(\textbf{h}\). Hence, \(|{\textsf{D}}_{G,Y}|\le k\).

We now evaluate the running time. Fix \(h \in [\ell ]\), for each \((h_1,\ldots ,h_\mathtt{{nd}})\) with \(\sum _{i=1}^{\mathtt{{nd}}} h_i = h\), one needs time O(h) to get Y and \(O(n^2)\) to get \({\textsf{D}}_{G,Y}\), moreover the number of all possible such nd-tuple is \(\left( {\begin{array}{c}h + \mathtt{{nd}}-1\\ h\end{array}}\right) \). Summing over all h we get \( \sum _{h\in [\ell ]}\left( {\begin{array}{c}h + \mathtt{{nd}}-1\\ h\end{array}}\right) <2^{\ell +\mathtt{{nd}}-1}\) and the theorem holds. \(\square \)

6 Conclusion

We introduced the influence immunization problem on networks under the threshold model and analyzed its parameterized complexity. We considered several parameters and showed that the problem remains intractable with respect to each one. We have also shown that for some pairs (e.g., (\(\zeta \), \(\ell \)) and (\(\Delta \), \(\ell \))) the problem remains intractable. On the positive side, the problem was shown to be FPT for some other pairs: \((k,\ell )\), \((k, \zeta )\), \((k,\mathtt{{tw}}), (\Delta ,\mathtt{{tw}}), (k,\mathtt{{nd}})\) and \((\ell ,\mathtt{{nd}})\). It would be interesting to assess the parameterized complexity of IIB  with respect to the remaining pairs of parameters; in particular with respect to k and \(\Delta \).