1 Introduction

The coronavirus disease-2019 (COVID-19) has been a global pandemic with nearly 230 million confirmed cases and more than 4.6 million deaths since December 2019 (COVID-19 Global Outbreak Live 2021). The pressing task is to control and isolate the sources of infection and treat the infected cases so as to reduce their infectivity. In response to the need of treating a huge number of cases with limited medical and epidemic prevention materials, we propose the infectious intensity interdiction problem by upgrading critical edges/nodes on a transmission network of confirmed cases. Such a network can be regarded as a rooted tree assumed that the confirmed cases will not be infected again (Will COVID-19 2020), just as the transmission tree infected by the “super 31” in South Korea in February 2020 shown in Fig. 1 (Italy, Iran in the Middle East 2020). We study on determining which critical edges/nodes to be upgraded so as to make the infectious intensity of the transmission tree as small as possible. Upgrading critical edges means taking prevention measures such as disinfection while upgrading critical nodes means treating the confirmed cases, isolating their close contacts or vaccinating the uninfected people. In a word, upgrading edges/nodes can reduce the infectious intensity with contacts although it can not completely stop the transmission of viruses. The upgrade cost for upgrading critical edges/nodes may be overall different. However, the cost may be the same in some special cases where we aim to determine the number of upgraded edges /treated nodes in the above problems. The infectious intensity of an infectious disease is related to the type, quantity and virulence of viruses and immune status of susceptible people (Infectious Diseases 2021). We describe the infectious intensity of an edge as a weight w(e).

Fig. 1
figure 1

The transmission tree infected by the “super 31” in South Korea in February 2020 (Italy, Iran in the Middle East 2020)

More generally, networks with one-direction link can be described as tree networks. For example, in the transmission network of confirmed cases, the epidemic can only spread from the confirmed cases to susceptible population. The relevant problems can be described as follows.

Let \(T=(V, E, w)\) be an edge-weighed tree rooted at s, where \(V=\{s,v_1, v_2, \ldots , v_n\}\) and \(E=\{e_1, e_2, \ldots , e_n\}\) are the sets of nodes and edges, respectively. Let \(Y=\{t_1, t_2, \ldots , t_r\}\) be the set of leaves. Let w(e) and l(e) be the original weight and the lower bound of the upgrade weight of the edge \(e\in E\), respectively, where \(w(e)\ge l(e)\). Let \(\varDelta {w(e)}=w(e)-l(e)\). Let c(e) be the cost to upgrade the edge e. Denoted by \(P_{s, t_k}\) the unique root-leaf path from s to \(t_k\) on T. Denote the length of path \(P_{s, t_k}\) under the weight w by \(d_w(s, t_k)=\sum _{e\in {P_{s, t_k}}}w(e)\). Define “the sum of root-leaf distance” under the weight w as \(d_w(T)=\sum _{t\in Y} d_w(s,t)\). The sum of root-leaf distance interdiction problem by upgrading edges on trees, denoted by (SDIPT-UE), aims to find an upgrade scheme \({\bar{w}}\) to minimize the distance \(d_{{\bar{w}}}(T)\) under \({\bar{w}}\) on the premise that the total upgrade cost under some norm is upper bounded by a given value K. Its mathematical model can be stated as follows.

$$\begin{aligned} \begin{array}{lll} &{}\min _{{\bar{w}}}&{}\sum \limits _{t\in Y}d_{\bar{w}}(s, t)\\ \mathbf{(SDIPT-UE) }&{}\;s.t.&{} \Vert \bar{w}-w\Vert \le K, \\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$

The relevant minimum cost problem (SDIPT-UE), denoted by (MCSDIPT-UE), aims to find an upgrade scheme \({\bar{w}}\) to minimize the total upgrade cost such that the distance \(d_{{\bar{w}}}(T)\) under \({\bar{w}}\) is upper bounded by a given value D. Its mathematical model can be stated as follows.

$$\begin{aligned} \begin{array}{lll} &{}\min _{{\bar{w}}}&{}\Vert \bar{w}-w\Vert \\ \mathbf{(MCSDIPT-UE) }&{}\;s.t.&{} \sum \limits _{t\in Y}d_{\bar{w}}(s, t)\le D,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$

Note that the edge \(e_j=(v_i,v_j)\) is labelled by the subscript of the endpoint \(v_j\) which is further to the root s than \(v_i\). Let \(A(v_i)=\{e_j=(v_i,v_j)|e_j\in E\}\) be the set of edges adjacent to \(v_i\). Let \(\beta _1(e_j)\) and \(\beta _0(e_j)\) be the weight when the node \(v_i\) is upgraded or not, respectively. Let \(c(v_i)\) be the upgrade cost of the node \(v_i\) . The sum of root-leaf distance interdiction problem by upgrading nodes on trees, denoted by (SDIPT-UN), aims to upgrade a subset \(S\subseteq V\) of nodes to minimize the sum of root-leaf distance such that the total upgrade cost under some norm is upper bounded by a given value K. Its mathematical model can be stated as follows.

$$\begin{aligned} \begin{array}{lll} &{}\min _{S\subseteq V}&{}\sum \limits _{t\in Y}d_{\bar{w}}(s, t)\\ \mathbf{(SDIPT-UN) }&{}\;\,s.t.&{} \sum \limits _{v\in S}c(v)\le K, \\ &{}&{} {\bar{w}}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}\quad v\in S, e\in A(v),\\ \beta _0(e), &{}\quad {\textit{otherwise}}. \end{array}\right. \end{array} \end{aligned}$$
(1.1)

The relevant minimum cost problem (SDIPT-UN), denoted by (MCSDIPT-UN), aims to upgrade a subset \(S\subseteq V\) of nodes to minimize the total upgrade cost such that the sum of root-leaf distance is upper bounded by a given value D. Its mathematical model can be stated as follows.

$$\begin{aligned} \begin{array}{lll} &{}\min _{S\subseteq V}&{}\sum \limits _{v\in S} c(v)\\ \mathbf{(MCSDIPT-UN) }&{}\;\,s.t.&{} \sum \limits _{t\in Y}d_{\bar{w}}(s, t) \le D.\\ &{}&{} {\bar{w}}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}\quad v\in S, e\in A(v),\\ \beta _0(e), &{}\quad {\textit{otherwise}}. \end{array}\right. \end{array} \end{aligned}$$
(1.2)

Notice that the upgrade cost for upgrading critical edges/nodes are different in general. However, the cost may be the same in some special cases where we consider the number of the upgrade edges/nodes instead of the upgrade cost in the cost constraint/objective of the above problems.

Most network interdiction problems aim to delete some critical edges/nodes to make some network performance worse. They have wide applications in drug trafficking network (Albert et al. 2000), terrorist network (Ayyldz et al. 2019) and network war (Albert et al. 2000; Khachiyan et al. 2008). Magnouche and Martin (2020) from Huawei Technologies in France studied how to delete the least number of critical nodes so that the length of st path in the remained graph was at least d. They analyzed the NP-hardeness of the problem, presented an integer linear programming model with multiple exponential constraints and designed a branch-and-bound algorithm to solve it.

The network interdiction problems by deleting critical edges was first applied to shortest path problem by Corley and Sha (1982), where K edges were deleted to maximize the length of the shortest path of the network. Ball et al. (1989) showed that the problem is NP-hard. Khachiyan et al. (2008) showed that it has no approximation algorithm with ratio 2. Bazgan et al. (2015) provided an O(mn) algorithm for the shortest path interdiction problem when the increment \(b=1\) of the length of the path and they Bazgan et al. (2019) showed that the problem is NP-hard with \(b\ge 2\).

In some practical applications, it is extremely difficult to delete edges/nodes in a network and we can only modify the weights of some edges since there are always some emergency or alternative schemes available. Zhang et al. (2021a, 2021b) proposed the maximum shortest path interdiction problem by upgrading edges on trees (MSPIT) and its relevant minimum cost problem (MCSPIT), respectively. Under weighted \(l_1\) norm, they provided two \(O(n^2)\) time primal dual algorithms, respectively. Under unit \(l_1\) norm, they designed two linear time algorithms, respectively. Under weighted Hamming distance they Zhang et al. (2021b) showed the problem (MSPIT) is NP-hard. Under unit Hamming distance, they proposed an \(O(n(\log n + K^3))\) time algorithm by dynamic programming for the problem (MSPIT) and an \(O(n^4 \log n)\) time algorithm by binary search for the problem (MCSPIT).

In this paper, we also consider the problems (SDIPT-UE/N) and (MCSDIPT-UE/N) using different norms to measure the upgrade cost. We list our research results in Table 1 compared with results in the previous research, where subscripts 1, H, uH and u denote the weighted \(l_1\) norm, the weighted Hamming distance, the unit Hamming distance and the unit node cost, respectively.

Table 1 The relationship between the previous research and our research

The paper is organized as follows. In Sect. 2, we proved the problems (SDIPT-UE) and (MCSDIPT-UE) under weighted Hamming distance are NP-hard. In Sects. 3 and 4, we proposed two algorithms in O(n) and \(O(n \log n)\) time for the problem (SDIPT-UE) and (MCSDIPT-UE) under unit Hamming distance , respectively. In Sect. 5, we showed the problems (SDIPT-UE) and (MCSDIPT-UE) under \(l_1\) norm are equivalent to the continuous knapsack problems, and hence they can be solved in O(n) time. In Sect. 6, we proved the equivalence of the problems (SDIPT-UN), (MCSDIPT-UN) and the 0–1 knapsack problems. In Sects. 7 and 8, we developed two algorithms with time complexities O(n) and \(O(n\log n)\) for the problems (SDIPT-UN) and (MCSDIPT-UN) with unit node cost, respectively. In Sect. 9, computational experiments were given to show the effectiveness of all these polynomial time algorithms. In Sect. 10, we drew a conclusion and put forward our future research.

2 The NP-hardness of the problems (SDIPT-UE) and (MCSDIPT-UE) under weighted Hamming distance

The weighted Hamming distance is defiend as

$$\begin{aligned} \Vert {\bar{w}}-w\Vert _H= & {} \sum _{e\in E}c(e) H\big (\bar{w}(e), w(e)\big ), \end{aligned}$$
(2.1)
$$\begin{aligned} H\big (\bar{w}(e), w(e)\big )= & {} \left\{ \begin{array}{ll} 0, &{}\quad {\textit{if}}\;\;\bar{w}(e)=w(e),\\ 1, &{}\quad {\textit{if}}\;\;\bar{w}(e)\ne {w(e)}. \end{array}\right. \end{aligned}$$
(2.2)

The problems (SDIPT-UE) and (MCSDIPT-UE) under weighted Hamming distance, denoted by (SDIPT-UE\(_H\)) and (MCSDIPT-UE\(_H\)), can be formulated as the following models (2.3) and (2.4), respectively.

$$\begin{aligned}&\begin{array}{lll} &{}\min _{{\bar{w}}} &{}\sum \limits _{t\in Y}d_{\bar{w}}(s, t)\\ \mathbf{(SDIPT-UE }_H\mathbf ) &{}\;s.t.&{} \sum \limits _{e\in E}c(e) H\big (\bar{w}(e), w(e)\big )\le K,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array}\end{aligned}$$
(2.3)
$$\begin{aligned}&\begin{array}{lll} &{}\min _{{\bar{w}}}&{}\sum \limits _{e\in E}c(e) H\big (\bar{w}(e), w(e)\big )\\ \mathbf{(MCSDIPT-UE }_H\mathbf ) &{}\;s.t.&{} \sum \limits _{t\in Y}d_{\bar{w}}(s, t)\le D,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$
(2.4)

In this section, we first prove a property of the optimal solution of the problems (SDIPT-UE\(_{H}\)) and (MCSDIPT-UE\(_{H}\)). Then show their NP-hardness.

Definition 1

Define \(L(e)=\{t_k|e\in {P_{s, t_k}}, k=1, 2, \cdots , r\}\) as the set of leaves \(t_k\) to which \(P_{s, t_k}\) passes through e. If \(t_k\in {L(e)}\), then \(t_k\) is controlled by the edge e.

Theorem 2

If \(\bar{w}\) is an optimal solution of the problem (MCSDIPT-UE\(_{H}\)) or (SDIPT-UE\(_{H}\) ), so is \(w^*\) defined below.

$$\begin{aligned} w^*(e)=\left\{ \begin{array}{ll} w(e), &{}\quad {\textit{if}}\;\;\bar{w}(e)=w(e),\\ l(e), &{}\quad {\textit{if}}\;\;\bar{w}(e)\ne {w(e)}. \end{array}\right. \end{aligned}$$
(2.5)

Proof

  1. (1)

    We first show that Theorem 2 holds for the problem (SDIPT-UE\(_{H}\)).

    Obviously, \(w^*\) is a feasible solution of the problem (SDIPT-UE\(_{H}\)), since \(l(e)\le w^*(e)\le w(e)\) and \(\sum _{e\in E} c(e)H\big (w^*(e),w(e)\big )=\sum _{e\in E} c(e)H\big ({\bar{w}}(e),w(e)\big )\le K\).

    Now we show that \(w^*\) is an optimal solution of the problem (SDIPT-UE\(_{H}\)). Notice that \(l(e)\le w^*(e)\le {\bar{w}}(e)\le w(e)\) for all edges \(e\in E\). Suppose there exists an edge \(e_i\in E\) satisfying \(w^*(e_i)=l(e_i)<{\bar{w}}(e_i)<w(e_i)\). Then \(\sum _{t\in Y{\setminus } L(e_i)} d_{w^*}(s,t)\le \sum _{t\in Y{\setminus } L(e_i)} d_{{\bar{w}}}(s,t) \) and \(\sum _{t\in L(e_i)}d_{w^*}(s,t)< \sum _{t\in L(e_i)}d_{{\bar{w}}}(s,t)\) follows. Hence,

    $$\begin{aligned} \sum _{t\in Y} d_{w^*}(s,t)= & {} \sum _{t\in Y{\setminus } L(e_i)} d_{w^*}(s,t)+\sum _{t\in L(e_i)}d_{w^*}(s,t)\nonumber \\< & {} \sum _{t\in Y{\setminus } L(e_i)} d_{{\bar{w}}}(s,t)+ \sum _{t\in L(e_i)}d_{{\bar{w}}}(s,t)=\sum _{t\in Y}d_{{\bar{w}}}(s,t), \end{aligned}$$
    (2.6)

    which contracts that \(\bar{w}\) is an optimal solution.

  2. (2)

    We then show that Theorem 2 holds for the problem (MCSDIPT-UE\(_{H}\)). The formula (2.6) also holds for the problem (MCSDIPT-UE\(_{H}\)) and thus we have \(\sum _{t\in Y} d_{w^*}(s,t)<\sum _{t\in Y} d_{{\bar{w}}}(s,t)\le D\) with \(l(e)\le w^*(e)\le w(e)\). Hence, \(w^*\) is a feasible solution of the problem (MCSDIPT-UE\(_{H}\)). Furthermore, it is obvious that \(\sum _{e\in E} c(e)H\big (w^*(e),w(e)\big )=\sum _{e\in E} c(e)H\big ({\bar{w}}(e),w(e)\big )\) and thus \(w^*\) is also an optimal solution of the problem (MCSDIPT-UE\(_{H}\)). \(\square \)

Based on Theorem 2, we pursue an optimal solution \(w^*\) defined as in (2.5). If an edge e is upgraded, then the length of each path \(P_{s,t_k} (t_k\in {L(e)})\) will decrease by \(\varDelta w(e)\). Next we define the total reduction amount of an edge e to describe the decreasing amount of the sum of root-leaf distance as the weight reduction of the edge e.

Definition 3

For any \(e\in {E},\) let \( Q(e)=|L(e)|\cdot \varDelta {w(e)}\) be the total reduction amount of the edge e, which is the product of the upgrade amount of the edge e and the number of leaf nodes controlled by the edge e.

Next, we prove NP-hardness of the problems (SDIPT-UE\(_H\)) and (MCSDIPT-UE\(_H\)) by showing the equivalence of the problems and the 0–1 knapsack problem. For convenience, we substitute \(H\big ({\bar{w}}(e),w(e)\big )\) by x(e), where

$$\begin{aligned} x(e)=\left\{ \begin{array}{ll} 0, &{} \quad {\textit{if}}\;\; \bar{w}(e)=w(e),\\ 1, &{} \quad {\textit{if}}\;\; \bar{w}(e)\ne {w(e)}. \end{array}\right. \end{aligned}$$
(2.7)

Theorem 4

The problem (SDIPT-UE\(_H\)) is NP-hard.

Proof

The objective function can be calculated as follows.

$$\begin{aligned} \min _{{\bar{w}}}\sum _{t\in Y}d_{\bar{w}}(s, t)= & {} \min _{{\bar{w}}} \sum _{t\in Y}\sum _{e\in P_{s,t}} {\bar{w}}(e)\nonumber \\= & {} \min _x \sum _{t\in Y}\sum _{e\in P_{s,t}} \Big (w(e)-x(e)\cdot \varDelta w(e)\Big )\nonumber \\= & {} \min _x \left\{ \sum _{t\in Y}\sum _{e\in P_{s,t}} w(e)-\sum _{t\in Y}\sum _{e\in P_{s,t}}\varDelta w(e)\cdot x(e)\right\} \nonumber \\= & {} \sum _{t\in Y}\sum _{e\in P_{s,t}} w(e)-\max _x\sum _{t\in Y}\sum _{e\in P_{s,t}}\varDelta w(e)\cdot x(e)\nonumber \\= & {} \sum _{t\in Y}d_{w}(s, t)-\max _x \sum _{e\in E}\sum _{\begin{array}{c} e\in P_{s,t}\\ t\in Y \end{array}}\varDelta w(e)\cdot x(e)\nonumber \\= & {} d_w(T)-\max _x\sum _{e\in E}|L(e)|\varDelta w(e)\cdot x(e)\nonumber \\= & {} d_w(T)-\max _x \sum _{e\in E}Q(e)\cdot x(e). \end{aligned}$$
(2.8)

Hence, the problem (2.3) is equivalent to the following 0–1 knapsack problem.

$$\begin{aligned} \begin{array}{lll} &{}\max _x &{}\sum \limits _{e\in E}Q(e)x(e)\\ &{}\;\,s.t.&{} \sum \limits _{e\in E}c(e) x(e)\le K,\\ &{}&{}x(e)=\left\{ \begin{array}{ll} 0, &{}\quad {\textit{if}}\;\;\bar{w}(e)=w(e),\\ 1, &{}\quad {\textit{if}}\;\;\bar{w}(e)\ne w(e). \end{array}\right. \end{array} \end{aligned}$$
(2.9)

The problem (SDIPT-UE\(_H\)) is NP-hard by showing the equivalence of the problem and the 0–1 knapsack problem which is NP-hard (Martello and Toth 1990). \(\square \)

For the 0–1 knapsack problem, there is a pseudo-polynomial time algorithm with time complexity O(nK) (Martello and Toth 1990) and several approximation algorithms. In 1975, Ibarra and Kim (1975) proposed a fully polynomial-time approximation scheme (FPTAS) with approximation factor \(1+\varepsilon \) in \(O(n^3(1+1/\varepsilon ))\) time. Very recently in 2019, Jin (2019) provided an improved FPTAS with approximation factor \(1+\varepsilon \) in \({\tilde{O}}(n+(1/\varepsilon )^{9/4})\) time, where \({\tilde{O}}\) hides polylogarithmic factors.

In a similar way, the problem (MCSDIPT-UE\(_H\)) is also equivalent to a 0–1 minimization knapsack problem.

Theorem 5

The problem (MCSDIPT-UE\(_H\)) is NP-hard.

Proof

As shown in the derivation process (2.8), the constraint condition

$$\begin{aligned} \sum _{t\in Y}d_{\bar{w}}(s, t)=d_w(T)-\sum _{e\in E}Q(e)\cdot x(e)\le D, \end{aligned}$$
(2.10)

is equivalent to

$$\begin{aligned} \sum \limits _{e\in E}Q(e)\cdot x(e)\ge D',\quad D'=d_w(T)-D. \end{aligned}$$
(2.11)

Then the problem (MCSDIPT-UE\(_H\)) is equivalent to the following problem.

$$\begin{aligned} \begin{array}{lll} &{}\min _x &{}\sum \limits _{e\in E}c(e) x(e)\\ &{}\;\,s.t.&{} \sum \limits _{e\in E}Q(e)\cdot x(e)\ge D',\\ &{}&{}x(e)=\left\{ \begin{array}{ll} 0, &{}\quad {\textit{if}}\;\;\bar{w}(e)=w(e),\\ 1, &{}\quad {\textit{if}}\;\;\bar{w}(e)\ne w(e). \end{array}\right. \end{array} \end{aligned}$$
(2.12)

The problem (2.12) is just a 0–1 minimization knapsack problem which is also NP-hard (Martello and Toth 1990). \(\square \)

3 A linear time algorithm to solve the problem (SDIPT-UE\(_H\)) under unit Hamming distance

The (SDIPT-UE\(_H\)) problem under unit Hamming distance, denoted by (SDIPT-UE\(_{uH}\)), can be formulated from the models (2.9) and (2.3) as the following form.

$$\begin{aligned} \begin{array}{lll} &{}\max _{{\bar{w}}}&{}\sum \limits _{e\in E}Q(e)H\big (\bar{w}(e), w(e)\big )\\ \mathbf{(SDIPT-UE }_{uH}{} \mathbf ) &{}\;s.t.&{} \sum \limits _{e\in E}H\big (\bar{w}(e), w(e)\big )\le K,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$
(3.1)

We can conclude from the model (3.1) that the problem (SDIPT-UE\(_{uH}\)) aims to upgrade K edges to be upgraded so that the sum of the total reduction amount is maximized. Thus we can sort the edges by the values of Q(e) in non-increasing order and upgrade the first K largest Q(e)-value edges.

Sort the edges by the values of Q(e) in non-increasing order as follows.

$$\begin{aligned} Q(e_{i_1})\ge Q(e_{i_2})\ge \cdots \ge Q(e_{i_K})\ge \cdots \ge Q(e_{i_n}). \end{aligned}$$

Theorem 6

Let \(\bar{E}_K=\{e_{i_{\tau }}|\tau =1,2,\ldots ,K\}\) be the set of the first K largest Q(e)-value edges in E. Then \(\bar{w}(e)=\left\{ \begin{array}{ll} l(e), &{}e\in \bar{E}_K\\ w(e), &{}e\notin \bar{E}_K \end{array}\right. \) is an optimal solution of the problem (SDIPT-UE\(_{uH}\)).

Proof

Suppose \(\bar{w}\) is not an optimal solution of the problem (SDIPT-UE\(_{uH}\)), but \(\hat{w}(e)=\left\{ \begin{array}{ll} l(e), &{}e\in \hat{E}_K,\\ w(e), &{}e\notin \hat{E}_K. \end{array}\right. \) is, where \(\hat{E}_K=\{e_{j_{\tau }}|\tau =1,2,\ldots ,K\}\) is the set of K edges different from \({\bar{E}}\). Then, \(\sum _{e\in {\hat{E}}}Q(e)\ge \sum _{e\in {\bar{E}}}Q(e)\) and \(|\hat{E}_K|=|\bar{E}_K|=K\). If \(\sum _{e\in {\hat{E}_K}}Q(e)=\sum _{e\in {\bar{E}_K}}Q(e)\), then \(\hat{E}_K\) is also the first K largest Q(e)-value edges and the theorem holds. If \(\sum _{e\in {\hat{E}_K}}Q(e)>\sum _{e\in {\bar{E}_K}}Q(e)\), then it contradicts that \(\bar{E}_K\) is the first K largest Q(e)-value edges and \(\bar{w}\) is an optimal solution of the problem (SDIPT-UE\(_{uH}\)). \(\square \)

Next we present a linear time Algorithm 1 to search for the first K largest values in an array with duplicate elements. We first find the K-th largest element q of an array Q by the selection algorithm \(q:={\textit{Selection}}(Q,K)\) in Thoms et al. (2009, pp 220–222). Different from the partition algorithm in Thoms et al. (2009, pp 170–173), we may have elements with equal values in the array Q. To ensure we find the exact K elements, we determine the sets \(E_1\) and \(E_2\) of edges whose value is larger than and equal to q, respectively. Finally, \({\bar{E}}_K:=E_1\cup E_2(1:K-|E_1|)\) is the set of the first K largest Q(e)-value edges in the array Q. The above two steps can both be completed in O(n) time.

figure a

Theorem 7

Algorithm 1 can solve the problem (SDIPT-UE\(_{uH}\)) in O(n) time.

4 An \(O(n \log n)\) time algorithm to solve the problem (MCSDIPT-UE\(_H\)) under unit Hamming distance

We consider the problem (MCSDIPT-UE\(_{uH}\)) under unit Hamming distance, which can be formulated from the models (2.12) and (2.4) as follows.

$$\begin{aligned} \begin{array}{lll} &{}\min _{{\bar{w}}} &{}\sum \limits _{e\in E}H\big (\bar{w}(e), w(e)\big )\\ \mathbf{(MCSDIPT-UE }_{uH}{} \mathbf ) &{}\;s.t.&{} \sum \limits _{e\in E}Q(e)H\big (\bar{w}(e), w(e)\big )\ge D',\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$
(4.1)

The problem (MCSDIPT-UE\(_{uH}\)) aims to upgrade the least number of edges such that the sum of the total reduction amount is no less than \(D'\). Obviously, we can first sort the edges by the Q(e)-values in non-increasing order and find the minimum number of edges to be upgraded by a binary search such that the sum of the total reduction amount achieves the lower bound \(D'\).

Theorem 8

Let \(\bar{E}_k=\{e_{i_{\tau }}|\tau =1,\ldots ,k\}\) be the set with minimum number of edges satisfying \(\sum _{\tau =1}^k Q(e_{i_{\tau }})\ge D'\). Then \(\tilde{w}(e)=\left\{ \begin{array}{ll} l(e), &{}e\in \tilde{E}_k,\\ w(e), &{}e\notin \tilde{E}_k. \end{array}\right. \) is an optimal solution of (MCSDIPT-UE\(_{uH}\)) for any \({\tilde{E}}_k=\{e_{\alpha _{\tau }}|\tau =1,\ldots ,k\}\) with \(\sum _{\tau =1}^k Q(e_{\alpha _{\tau }})\ge D'\).

Proof

Suppose \(\tilde{w}\) is not an optimal solution of the problem (MCSDIPT-UE\(_{uH}\)), but \(\hat{w}(e)=\left\{ \begin{array}{ll} l(e), &{}e\in \hat{E}_{k'},\\ w(e), &{}e\notin \hat{E}_{k'}. \end{array}\right. \) is, where \(\hat{E}_{k'}=\{e_{j_{\tau }}|\tau =1,2,\ldots ,k'\}\) with \(\sum _{\tau =1}^{k'} Q(e_{j_{\tau }})\) \(\ge D'\). Then we have \(k'<k\), which contradicts that \({\bar{E}}_k\) is the set with minimum number of edges satisfying \(\sum _{\tau =1}^k Q(e_{i_{\tau }})\ge D'\). Hence, \(\tilde{w}\) is an optimal solution. \(\square \)

To find the set \(\bar{E}_k=\{e_{i_{\tau }}|\tau =1,2,\ldots ,k\}\) with the minimum number of edges satisfying \(\sum _{\tau =1}^k Q(e_{i_{\tau }})\ge D'\), we perform a method in two steps. In the first step, we sort the edges \(e_{i_1},\ldots ,e_{i_n}\) by the values of Q(e) non-increasingly. In the second step, we run a binary search algorithm to determine the minimum number \(k^*\) satisfying \(\sum _{\tau =1}^{k^*} Q(e_{i_{\tau }})\ge D'\) and \(\sum _{\tau =1}^{k^*-1} Q(e_{i_{\tau }})< D'\). Finally, we upgrade the first \(k^*\) largest Q(e)-value edges, which is just the set \(\bar{E}_{k^*}\).

figure b

Theorem 9

The problem (MCSDIPT-UE\(_{uH}\)) can be solved in \(O(n\log n)\) time by Algorithm 2.

Proof

The calculation process in Line 1 can be completed in O(n) time. Sorting edges by the values of Q(e) spends \(O(n\log n)\) time in Line 2. It takes \(O(\log n)\) iterations to determine \(k^*\) by the binary search in Line 4–13 and in each iteration the time complexity is O(n). Hence the problem (MCSDIPT-UE\(_{uH}\)) can be solved in \(O(n\log n)\) time by Algorithm 2. \(\square \)

5 Solve the problems (SDIPT-UE) and (MCSDIPT-UE) under weighted \(l_1\) norm

When the weighted \(l_1\) norm is applied to the upgrade cost, the problems (SDIPT-UE) and (MCSDIPT-UE) under weighted \(l_1\) norm, denoted by (SDIPT-UE\(_1\)) and (MCSDIPT-UE\(_1\)), can be formulated as the following models (5.1) and (5.2), respectively.

$$\begin{aligned}&\begin{array}{lll} &{}\min _{{\bar{w}}} &{}\sum \limits _{t\in Y}d_{\bar{w}}(s, t)\\ \mathbf{(SDIPT-UE }_1\mathbf ) &{}\;s.t.&{} \sum \limits _{e\in E} c(e)|\bar{w}(e)-w(e)|\le K,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array}\end{aligned}$$
(5.1)
$$\begin{aligned}&\begin{array}{lll} &{}\min _{{\bar{w}}} &{}\sum \limits _{e\in E} c(e)|\bar{w}(e)-w(e)|\\ \mathbf{(MCSDIPT-UE }_1\mathbf ) &{}\;s.t.&{} \sum \limits _{t\in Y}d_{\bar{w}}(s, t) \le D,\\ &{}&{}l(e)\le \bar{w}(e)\le w(e), e\in E. \end{array} \end{aligned}$$
(5.2)

Next we will transform the models (5.1) and (5.2) into the continuous knapsack problem, respectively, so that the problems (SDIPT-UE\(_1\)) and (MCSDIPT-UE\(_1\)) can be solved in O(n) time (Martello and Toth 1990). For convenience, let \(|\bar{w}(e)-w(e)|=w(e)-\bar{w}(e)=\varDelta w(e)x(e), 0\le x(e)\le 1\).

Theorem 10

The problem (SDIPT-UE\(_1\)) can be transformed into a continuous knapsack problem.

Proof

Similar to the derivation process in (2.8), the objective function of the problem (SDIPT-UE\(_1\)) can be transformed into

$$\begin{aligned} \min _{{\bar{w}}} \sum _{t\in Y}d_{\bar{w}}(s, t)=d_{w}(T)-\max _x \sum _{e\in E}Q(e) x(e). \end{aligned}$$

Then the model (5.1) is equivalent to the following problem,

$$\begin{aligned} \begin{array}{lll} &{}\max _x &{}\sum \limits _{e\in E}Q(e)\cdot x(e)\\ &{}\;\,s.t.&{} \sum \limits _{e\in E}c(e)\varDelta w(e)\cdot x(e)\le K,\\ &{}&{}0\le x(e)\le 1. \end{array} \end{aligned}$$

which is just a continuous knapsack problem. \(\square \)

Similarly, the problem (MCSDIPT-UE\(_1\)) can also be transformed into a continuous knapsack problem.

Theorem 11

The problem (MCSDIPT-UE\(_1\)) can be transformed into a continuous knapsack problem.

Proof

Let \(y(e)=1-x(e)\) and then \(x(e)=1-y(e), 0\le y(e)\le 1\) . Hence, the objective function

$$\begin{aligned} \min _{{\bar{w}}}\sum _{e\in E} c(e)|\bar{w}(e)-w(e)|= & {} \min _x\sum _{e\in E} c(e)\varDelta w(e)x(e)\\= & {} \min _y\sum _{e\in E} c(e)\varDelta w(e)\Big (1-y(e)\Big )\\= & {} \min _y\left\{ \sum _{e\in E} c(e)\varDelta w(e)-\sum _{e\in E} c(e)\varDelta w(e)y(e)\right\} \\= & {} \sum _{e\in E} c(e)\varDelta w(e)-\max _y\sum _{e\in E} c(e)\varDelta w(e)y(e). \end{aligned}$$

Moreover, similar to the formulas (2.10)–(2.11), the constraint in model (5.2) can be transformed into \(\sum _{e\in E}Q(e) x(e)\ge d_w(T)-D.\) By substituting \(x(e)=1-y(e)\) into the constraint, we have

$$\begin{aligned} \sum _{e\in E}Q(e) x(e)=\sum _{e\in E}Q(e)\Big (1-y(e)\Big )=\sum _{e\in E}Q(e)-\sum _{e\in E}Q(e)y(e)\ge d_w(T)-D, \end{aligned}$$

which is equivalent to

$$\begin{aligned} \sum _{e\in E}Q(e)y(e)\le D'',\quad D''=\sum _{e\in E}Q(e)-d_w(T)+D. \end{aligned}$$

Thus, the model (5.2) is equivalent to the following problem.

$$\begin{aligned} \begin{array}{lll} &{}\max _y&{}\sum \limits _{e\in E} c(e)\varDelta w(e)y(e)\\ &{}\;\,s.t.&{} \sum \limits _{e\in E}Q(e)y(e)\le D'',\\ &{}&{}0\le y(e)\le 1. \end{array} \end{aligned}$$
(5.3)

The problem (5.3) is also a continuous knapsack problem. \(\square \)

Corollary 12

The problems (SDIPT-UE\(_1\)) and (MCSDIPT-UE\(_1\)) can both be solved in O(n) time.

6 The NP-hardness of the problems (SDIPT-UN) and (MCSDIPT-UN)

In this section, we prove that the problem (SDIPT-UN) is NP-hard by transforming it into a 0–1 knapsack problem, so is the problem (MCSDIPT-UN).

If a node v is upgraded, then the lengths of the paths \(P_{s,t_k} (t_k\in {L(e)}, e\in A(v))\) decrease by \(\varDelta w(e)=\beta _0(e)-\beta _1(e)\). For convenience, relevant to Definition 3, we introduce the following definition of the total reduction amount of a node v, which describes the decreasing amount of the sum of root-leaf distance as the node v is upgraded.

Definition 13

For any \(v\in {V},\) let \( B(v)=\sum _{e\in A(v)}Q(e)\) be the total reduction amount of the node v, which is the sum of the total reduction amount of the edges adjacent to the node v.

Theorem 14

The problem (SDIPT-UN) is NP-hard.

Proof

Let S be the set of upgraded nodes and define \(z(v)=\left\{ \begin{array}{ll} 1, &{}{\textit{if}}\; v\in S,\\ 0, &{}{\textit{if}}\;v\notin S. \end{array}\right. \) and then the objective function can be calculated as follows.

$$\begin{aligned} \min _{S\subseteq V}\sum _{t\in Y}d_{\bar{w}}(s, t)= & {} \min _{S\subseteq V}\sum _{t\in Y}\sum _{e\in P_{s,t}}{\bar{w}} (e)\nonumber \\= & {} \min _{S\subseteq V}\sum _{t\in Y}\left( \sum _{v\in S\cap P_{s,t}}\sum _{e\in A(v)\cap P_{s,t}}\beta _1(e)+\sum _{v\in P_{s,t}{\setminus } S}\sum _{e\in A(v)\cap P_{s,t}}\beta _0(e)\right) \nonumber \\= & {} \min _z \sum _{t\in Y}\sum _{v\in P_{s,t} }\sum _{e\in A(v)\cap P_{s,t}} \bigg ( z(v)\beta _1(e)+\Big (1-z(v)\Big )\ \beta _0(e)\bigg )\nonumber \\= & {} \min _z \sum _{t\in Y}\sum _{v\in P_{s,t} }\sum _{e\in A(v)\cap P_{s,t}}\bigg (\beta _0(e)- z(v)\Big (\beta _0(e)-\beta _1(e)\Big )\bigg )\nonumber \\= & {} \sum _{t\in Y}\sum _{v\in P_{s,t} }\sum _{e\in A(v)\cap P_{s,t}}\beta _0(e)- \max _z\sum _{t\in Y}\sum _{v\in P_{s,t} }\sum _{e\in A(v)\cap P_{s,t}}z(v)\varDelta w(e) \nonumber \\= & {} \sum _{t\in Y}d_{\beta _0}(s, t)- \max _z \sum _{v\in V}\sum _{e\in A(v) }\sum _{\begin{array}{c} e\in P_{s,t}\\ t\in Y \end{array}}\varDelta w(e)z(v)\nonumber \\= & {} d_{\beta _0}(T)- \max _z\sum _{v\in V}\sum _{e\in A(v) }|L(e)|\varDelta w(e)\cdot z(v) \nonumber \\= & {} d_{\beta _0}(T)-\max _z \sum _{v\in V}\sum _{e\in A(v) }Q(e)z(v) \nonumber \\= & {} d_{\beta _0}(T)- \max _z \sum _{v\in V}B(v)z(v) \end{aligned}$$
(6.1)

Hence, the problem (1.1) is equivalent to the following problem.

$$\begin{aligned} \begin{array}{l} \max _z\;\sum \limits _{v\in V}B(v)z(v)\\ \;s.t.\;\; \sum \limits _{v\in V}c(v)z(v) \le K,\\ z(v)=\left\{ \begin{array}{ll} 1, &{}\quad {\textit{if}}\;v\;{\textit{is upgraded}},\\ 0, &{}\quad {\textit{if}}\;v\;{\textit{is not upgraded}}. \end{array}\right. \end{array} \end{aligned}$$
(6.2)

The problem (6.2) is just a 0–1 knapsack problem which is NP-hard (Martello and Toth 1990). \(\square \)

In a similar way, the problem (MCSDIPT-UN) can also be proved to be equivalent to a 0–1 minimization knapsack problem.

Theorem 15

The problem (MCSDIPT-UN) is NP-hard.

Proof

Similar to the derivation process in the formula (6.1), the constraint in model (1.2) can be similarly transformed into \( d_{\beta _0}(T)-\sum _{v\in V}B(v)z(v)\le D \) and then we have \(\sum _{v\in V}B(v)z(v)\ge D^0\), where \(D^0=d_{\beta _0}(T)-D.\)

Hence, the problem (1.2) is equivalent to the following problem.

$$\begin{aligned}&\min \nolimits _z\;\sum _{v\in V}c(v)z(v)\nonumber \\&\;s.t.\;\; \sum _{v\in V}B(v)z(v)\ge D^0,\nonumber \\&z(v)=\left\{ \begin{array}{ll} 1, &{}\quad {\textit{if v is upgraded}},\\ 0, &{}\quad {\textit{if v is not upgraded}}. \end{array}\right. \end{aligned}$$
(6.3)

The problem (6.3) is a 0–1 minimization knapsack problem which is NP-hard (Martello and Toth 1990). \(\square \)

7 An O(n) time algorithm to solve problem (SDIPT-UN) with unit cost

The problem (SDIPT-UN) with unit cost, denoted by (SDIPT-UN\(_u\)), can be formulated from (6.2) as the following form.

$$\begin{aligned} \begin{array}{ll} &{}\max _z\;\sum \limits _{v\in V}B(v)z(v)\\ \mathbf{(SDIPT-UN }_u)&{}\;s.t.\;\;\sum \limits _{v\in V}z(v) \le K,\\ &{}z(v)=\left\{ \begin{array}{ll} 1, &{}\quad {\textit{if v is upgraded}},\\ 0, &{}\quad {\textit{if v is not upgraded}}. \end{array}\right. \end{array} \end{aligned}$$
(7.1)

It is shown in model (7.1) that the problem (SDIPT-UN\(_u\)) aims to upgrade K nodes to maximize their relevant sum of B(v)-value. Thus we can sort the nodes by the values of B(v) in non-increasing order and upgrade the first K largest B(v)-value nodes.

Sort the nodes by the values of B(v) in non-increasing order as follows.

$$\begin{aligned} B(v_{i_1})\ge B(v_{i_2})\ge \cdots \ge B(v_{i_K})\ge \cdots \ge B(v_{i_{n+1}}). \end{aligned}$$

Theorem 16

Let \(\bar{V}_K=\{v_{i_{\tau }}|\tau =1,2,\ldots ,K\}\) be the set of the first K largest B(v)-value nodes in V.Then \({\bar{w}}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}e\in A(v), v\in {\bar{V}}_K,\\ \beta _0(e), &{}{\textit{otherwise}}. \end{array}\right. \) is an optimal solution of the problem (SDIPT-UN\(_u\)).

Proof

Suppose \(\bar{w}\) is not an optimal solution of the problem (SDIPT-UN\(_u\)), but \(\hat{w}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}e\in A(v), v\in {\hat{V}}_K,\\ \beta _0(e), &{}{\textit{otherwise}}. \end{array}\right. \) is, where \(\hat{V}_K=\{v_{j_{\tau }}|\tau =1,2,\ldots ,K\}\) is the set of K nodes different from \({\bar{V}}_K\). Then we have \(\sum _{v\in {\hat{V}}_K}B(v)\ge \sum _{v\in {\bar{V}}_K}B(v)\) and \(|\hat{V}_K|=|\bar{V}_K|=K\). If \(\sum _{v\in {\hat{V}}_K}B(v)= \sum _{v\in {\bar{V}}_K}B(v)\), then \(\hat{V}\) is also the set of the first K largest B(v)-value nodes and the theorem holds. If \(\sum _{v\in {\hat{V}}_K}B(v)> \sum _{v\in {\bar{V}}_K}B(v)\), then it contradicts that \(\bar{V}_K\) is the first K largest B(v)-value nodes. Hence, \(\bar{w}\) is an optimal solution of the problem (SDIPT-UN\(_u\)). \(\square \)

We can solve the problem (SDIPT-UN\(_u\)) similar to the problem (SDIPT-UE\(_{uH}\)). We first find the K-th largest element q of an array B by the selection algorithm (Thoms et al. 2009, pp 220–222) and then determine the sets \(V_1\) and \(V_2\) of nodes whose value is larger than and equal to q, respectively. Finally, we can obtain the set \(S_K:=V_1\cup V_2(1:K-|V_1|)\) of the first K largest B(v)-value edges in the array B. The above steps can both be completed in O(n) time.

figure c

Theorem 17

Algorithm 3 can solve the problem (SDIPT-UN\(_u\)) in O(n) time.

8 An \(O(n \log n)\) time algorithm to solve the problem (MCSDIPT-UN) with unit cost

The problem (MCSDIPT-UN) with unit cost, denoted by (MCSDIPT-UN\(_u\)), can be formulated from (6.3) as follows.

$$\begin{aligned} \begin{array}{ll} &{}\min _z\;\,\sum \limits _{v\in V}z(v)\\ \mathbf{(MCSDIPT-UN }_u\mathbf{)}&{}\;s.t.\;\; \sum \limits _{v\in V}B(v)z(v)\ge D^0,\\ &{}z(v)=\left\{ \begin{array}{ll} 1, &{}\quad {\textit{if v is upgraded}},\\ 0, &{}\quad {\textit{if v is not upgraded}}. \end{array}\right. \end{array} \end{aligned}$$
(8.1)

where \(D^0=d_{\beta _0}(T)-D\).

As shown in model (8.1), the problem (MCSDIPT-UN\(_u\)) aims to upgrade the least number of nodes such that the sum of the total reduction amount is no less than \(D^0\). Obviously, we can first sort the nodes by the values of B(v) non-increasingly and find the minimum number of nodes to be upgraded by a binary search such that the sum of the total reduction amount satisfies the constraint.

Theorem 18

Let \(\bar{V}_k=\{v_{i_{\tau }}|\tau =1,\ldots ,k\}\) be the set with minimum number of nodes satisfying \(\sum _{\tau =1}^k B(v_{i_{\tau }})\ge D^0\). Then for any \({\tilde{V}}_k=\{v_{\alpha _{\tau }}|\tau =1,\ldots ,k\}\) with \(\sum _{\tau =1}^k B(v_{\alpha _{\tau }})\ge D^0,\) \(\tilde{w}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}e\in A(v),v\in {\tilde{V}}_k,\\ \beta _0(e), &{}{\textit{otherwise}}. \end{array}\right. \) is an optimal solution of (MCSDIPT-UN\(_u\)).

Proof

Suppose \(\tilde{w}\) is not an optimal solution of the problem (MCSDIPT-UN\(_u\)), but \(\hat{w}(e)=\left\{ \begin{array}{ll} \beta _1(e), &{}e\in A(v),v\in {\hat{V}}_{k'},\\ \beta _0(e), &{}{\textit{otherwise}}. \end{array}\right. \) is, where \(\hat{V}_{k'}=\{v_{j_{\tau }}|\tau =1,2,\ldots ,k'\}\) with \(\sum _{\tau =1}^{k'} B(v_{j_{\tau }})\ge D^0\). Then we have \(k'<k\), it contracts that \({\bar{V}}_k\) is the set with minimum number of nodes satisfying \(\sum _{\tau =1}^k B(v_{i_{\tau }})\ge D^0\). Hence, \(\tilde{w}\) is an optimal solution of the problem (MCSDIPT-UN\(_u\)). \(\square \)

We can perform a greedy algorithm similar to Algorithm 2 to solve the problem (MCSDIPT-UN\(_u\)). Similar to Theorem 9, we can conclude that

figure d

Corollary 19

The problem (MCSDIPT-UN\(_u\)) can be solved in \(O(n\log n)\) time by Algorithm 4.

9 Computational experiments

Now we present computational experiments of Algorithms 1, 2, 3 and 4 in Table 2. The programs were coded in Matlab 7.0 and run on a PC Intel(R), Core(TM)i7-10750H CPU @ 2.60 GHz 2.59 GHz under Windows 10. We have tested the algorithms on 6 classes of random trees with the number n of vertices varying from 1000 to 100,000. For each class, we randomly generated 500 instances on randomly generated trees. We randomly generated two vectors wl satisfying \(l<w\) in Algorithms 1, 2 and two vectors \(\beta _0, \beta _1\) satisfying \(\beta _1<\beta _0\) in Algorithms 3, 4, respectively. For each randomly generated tree, we solved the four problems (SPIT-UE\(_{uH}\)),(MCSPIT-UE\(_{uH}\)),(SPIT-UN\(_{u}\)) and (MCSPIT-UN\(_{u}\)) for comparison, respectively. Let \(T_{1}, T_{2},T_{3},T_{4}\) be the average CPU time of Algorithms 1, 2, 3 and 4, respectively. The relevant maximum and minimum running time, denoted by \(T_i^{{\textit{max}}},T_i^{{\textit{min}}}\)(\(i=1,2,3,4\)), respectively, are recorded as well.

Table 2 Performances of Algorithms 1, 2, 3 and 4

As shown in Table 2, the four algorithms are all very efficient and they follow their own time complexities very well. Notice that \(T_3, T_4\) are relatively slower than \(T_1, T_2\) as the calculation of B(v) in Algorithm 3, 4 is a bit more complicated than that of Q(e) in Algorithm 1, 2.

Furthermore, we can take the ratios between \(T_3\) and \(T_4\) into consideration. In Table 2, we can calculate the ratios \(\frac{T_3}{T_4}=\{5.5,6.0,5.8,4.5,4.4,4.2\}\) for the 6 classes of random trees. Notice the ratios are in a decreasing trend, which is consistent with their time complexities O(n) and \(O(n\log n)\). It can be predicted that the ratio between \(T_3\) and \(T_4\) may be smaller as n becomes larger, and finally, \(T_3\) will be faster than \(T_4\). Similarly, \(T_1\) will also be faster than \(T_2\) when n is large enough.

10 Conclusion and further research

We considered a class of the sum of root-leaf distance interdiction problems by upgrading edges/nodes on trees including (SDIPT-UE/N) and their minimum cost problem (MCSDIPT-UE/N). We considered total 10 problems by using different norms to measure the upgrade cost and listed the research results in Table 1 for the sake of convenience in comparing the results. We proved the problems (SDIPT-UE\(_H\)) and (MCSDIPT-UE\(_H\)) under weighted Hamming distance, and the problems (SDIPT-UN), (MCSDIPT-UN) with general node cost are NP-hard by showing their equivalence to 0–1 knapsack problems. However, under unit Hamming distance or with unit node cost, the problems (SDIPT-UE\(_{uH}\)) and (SDIPT-UN\(_u\)) can be solved in linear time based on the selection algorithm, while the minimum cost problems (MCSDIPT-UE\(_{uH}\)) and (MCSDIPT-UN\(_u\) ) can be solved in \(O(n\log n)\) time by a binary search method. Additionally, the problems (SDIPT-UE\(_1\)) and (MCSDIPT-UE\(_1\)) under weighted \(l_1\) norm were transformed into continuous knapsack problems which render two O(n) time algorithms. The efficiency of the four polynomial time algorithms were tested by some numerical experiments.

For further research, we can consider the sum of root-leaf distance interdiction problem on a series-parallel graph or even on a general graph. Moreover,the interdiction problems under other network performance can be studied, such as the shortest path interdiction problem on a general graph or minimum spanning tree interdiction problems by upgrading edges/nodes.