Skip to main content
Springer Nature - PMC COVID-19 Collection logoLink to Springer Nature - PMC COVID-19 Collection
. 2021 Oct 9;44(1):74–93. doi: 10.1007/s10878-021-00819-w

The sum of root-leaf distance interdiction problem by upgrading edges/nodes on trees

Qiao Zhang 1, Xiucui Guan 1,, Junhua Jia 1, Xinqiang Qian 1
PMCID: PMC8501940  PMID: 34658658

Abstract

Network interdiction problems by upgading critical edges/nodes have important applications to reduce the infectivity of the COVID-19. A network of confirmed cases can be described as a rooted tree that has a weight of infectious intensity for each edge. Upgrading edges (nodes) can reduce the infectious intensity with contacts by taking prevention measures such as disinfection (treating the confirmed cases, isolating their close contacts or vaccinating the uninfected people). We take the sum of root-leaf distance on a rooted tree as the whole infectious intensity of the tree. Hence, we consider the sum of root-leaf distance interdiction problem by upgrading edges/nodes on trees (SDIPT-UE/N). The problem (SDIPT-UE) aims to minimize the sum of root-leaf distance by reducing the weights of some critical edges such that the upgrade cost under some measurement is upper-bounded by a given value. Different from the problem (SDIPT-UE), the problem (SDIPT-UN) aims to upgrade a set of critical nodes to reduce the weights of the edges adjacent to the nodes. The relevant minimum cost problem (MCSDIPT-UE/N) aims to minimize the upgrade cost on the premise that the sum of root-leaf distance is upper-bounded by a given value. We develop different norms to measure the upgrade cost. Under weighted Hamming distance, we show the problems (SDIPT-UE/N) and (MCSDIPT-UE/N) are NP-hard by showing the equivalence of the two problems and the 0–1 knapsack problem. Under weighted l1 norm, we solve the problems (SDIPT-UE) and (MCSDIPT-UE) in O(n) time by transforimg them into continuous knapsack problems. We propose two linear time greedy algorithms to solve the problem (SDIPT-UE) under unit Hamming distance and the problem (SDIPT-UN) with unit cost, respectively. Furthermore, for the the minimum cost problem (MCSDIPT-UE) under unit Hamming distance and the problem (MCSDIPT-UN) with unit cost, we provide two O(nlogn) time algorithms by the binary search methods. Finally, we perform some numerical experiments to compare the results obtained by these algorithms.

Keywords: Network interdiction problem, Upgrading critical edges, Upgrading critical nodes, Tree, Knapsack problem, Greedy algorithm

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.

Fig. 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,v1,v2,,vn} and E={e1,e2,,en} are the sets of nodes and edges, respectively. Let Y={t1,t2,,tr} 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 eE, respectively, where w(e)l(e). Let Δw(e)=w(e)-l(e). Let c(e) be the cost to upgrade the edge e. Denoted by Ps,tk the unique root-leaf path from s to tk on T. Denote the length of path Ps,tk under the weight w by dw(s,tk)=ePs,tkw(e). Define “the sum of root-leaf distance” under the weight w as dw(T)=tYdw(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 w¯ to minimize the distance dw¯(T) under 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.

minw¯tYdw¯(s,t)(SDIPT-UE)s.t.w¯-wK,l(e)w¯(e)w(e),eE.

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

minw¯w¯-w(MCSDIPT-UE)s.t.tYdw¯(s,t)D,l(e)w¯(e)w(e),eE.

Note that the edge ej=(vi,vj) is labelled by the subscript of the endpoint vj which is further to the root s than vi. Let A(vi)={ej=(vi,vj)|ejE} be the set of edges adjacent to vi. Let β1(ej) and β0(ej) be the weight when the node vi is upgraded or not, respectively. Let c(vi) be the upgrade cost of the node vi . The sum of root-leaf distance interdiction problem by upgrading nodes on trees, denoted by (SDIPT-UN), aims to upgrade a subset SV 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.

minSVtYdw¯(s,t)(SDIPT-UN)s.t.vSc(v)K,w¯(e)=β1(e),vS,eA(v),β0(e),otherwise. 1.1

The relevant minimum cost problem (SDIPT-UN), denoted by (MCSDIPT-UN), aims to upgrade a subset SV 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.

minSVvSc(v)(MCSDIPT-UN)s.t.tYdw¯(s,t)D.w¯(e)=β1(e),vS,eA(v),β0(e),otherwise. 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 b2.

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 l1 norm, they provided two O(n2) time primal dual algorithms, respectively. Under unit l1 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(logn+K3)) time algorithm by dynamic programming for the problem (MSPIT) and an O(n4logn) 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 l1 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

Type Graph Problem K/b/c Complexity Reference
Deleting nodes General graph Network interdiction problem on shortest path any K NP-hard Magnouche and Martin (2020)
Deleting edges NP-hard Ball et al. (1989)
Not approximable within ratio 2 Khachiyan et al. (2008)
Undirected network b=1 O(mn) Bazgan et al. (2015)
b2 NP-hard Bazgan et al. (2019)
Upgrading edges Tree MCSPIT1 any K c=1 O(n) Zhang et al. (2021a)
any c O(n2)
MSPIT1 c=1 O(n)
any c O(n2)
MSPITH any c NP-hard Zhang et al. (2021b)
K=1 c=1 O(n+llogl)
any K c=1 O(n(logn+K3))
MCSPITuH O(n4logn)
SDIPT-UEH any K any c NP-hard Section 2
MCSDIPT-UEH
SDIPT-UEuH any K c=1 O(n) Section 3
MCSDIPT-UEuH O(nlogn) Section 4
SDIPT-UE1 any K any c O(n) Section 5
MCSDIPT-UE1
Upgrading nodes SDIPT-UN any K any c NP-hard Section 6
MCSDIPT-UN
SDIPT-UNu c=1 O(n) Section 7
MCSDIPT-UNu O(nlogn) Section 8

Description: MSPIT: MCSPIT: Minimum cost SPIT; SDIPT: The sum of root-leaf distance interdiction problem; MCSDIPT: Minimum cost SDIPT; UE: Upgrading edges; UN: Upgrading nodes; The subscripts 1,HuHu represent weighted l1 norm, weighted Hamming distance, unit Hamming distance, unit node cost, respectively.

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(nlogn) 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 l1 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(nlogn) 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.

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

The weighted Hamming distance is defiend as

w¯-wH=eEc(e)H(w¯(e),w(e)), 2.1
H(w¯(e),w(e))=0,ifw¯(e)=w(e),1,ifw¯(e)w(e). 2.2

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

minw¯tYdw¯(s,t)(SDIPT-UEH)s.t.eEc(e)H(w¯(e),w(e))K,l(e)w¯(e)w(e),eE. 2.3
minw¯eEc(e)H(w¯(e),w(e))(MCSDIPT-UEH)s.t.tYdw¯(s,t)D,l(e)w¯(e)w(e),eE. 2.4

In this section, we first prove a property of the optimal solution of the problems (SDIPT-UEH) and (MCSDIPT-UEH). Then show their NP-hardness.

Definition 1

Define L(e)={tk|ePs,tk,k=1,2,,r} as the set of leaves tk to which Ps,tk passes through e. If tkL(e), then tk is controlled by the edge e.

Theorem 2

If w¯ is an optimal solution of the problem (MCSDIPT-UEH) or (SDIPT-UEH ), so is w defined below.

w(e)=w(e),ifw¯(e)=w(e),l(e),ifw¯(e)w(e). 2.5

Proof

  1. We first show that Theorem 2 holds for the problem (SDIPT-UEH).

    Obviously, w is a feasible solution of the problem (SDIPT-UEH), since l(e)w(e)w(e) and eEc(e)H(w(e),w(e))=eEc(e)H(w¯(e),w(e))K.

    Now we show that w is an optimal solution of the problem (SDIPT-UEH). Notice that l(e)w(e)w¯(e)w(e) for all edges eE. Suppose there exists an edge eiE satisfying w(ei)=l(ei)<w¯(ei)<w(ei). Then tY\L(ei)dw(s,t)tY\L(ei)dw¯(s,t) and tL(ei)dw(s,t)<tL(ei)dw¯(s,t) follows. Hence,
    tYdw(s,t)=tY\L(ei)dw(s,t)+tL(ei)dw(s,t)<tY\L(ei)dw¯(s,t)+tL(ei)dw¯(s,t)=tYdw¯(s,t), 2.6
    which contracts that w¯ is an optimal solution.
  2. We then show that Theorem 2 holds for the problem (MCSDIPT-UEH). The formula (2.6) also holds for the problem (MCSDIPT-UEH) and thus we have tYdw(s,t)<tYdw¯(s,t)D with l(e)w(e)w(e). Hence, w is a feasible solution of the problem (MCSDIPT-UEH). Furthermore, it is obvious that eEc(e)H(w(e),w(e))=eEc(e)H(w¯(e),w(e)) and thus w is also an optimal solution of the problem (MCSDIPT-UEH).

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 Ps,tk(tkL(e)) will decrease by Δ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 eE, let Q(e)=|L(e)|·Δ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-UEH) and (MCSDIPT-UEH) by showing the equivalence of the problems and the 0–1 knapsack problem. For convenience, we substitute H(w¯(e),w(e)) by x(e), where

x(e)=0,ifw¯(e)=w(e),1,ifw¯(e)w(e). 2.7

Theorem 4

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

Proof

The objective function can be calculated as follows.

minw¯tYdw¯(s,t)=minw¯tYePs,tw¯(e)=minxtYePs,t(w(e)-x(e)·Δw(e))=minxtYePs,tw(e)-tYePs,tΔw(e)·x(e)=tYePs,tw(e)-maxxtYePs,tΔw(e)·x(e)=tYdw(s,t)-maxxeEePs,ttYΔw(e)·x(e)=dw(T)-maxxeE|L(e)|Δw(e)·x(e)=dw(T)-maxxeEQ(e)·x(e). 2.8

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

maxxeEQ(e)x(e)s.t.eEc(e)x(e)K,x(e)=0,ifw¯(e)=w(e),1,ifw¯(e)w(e). 2.9

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

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+ε in O(n3(1+1/ε)) time. Very recently in 2019, Jin (2019) provided an improved FPTAS with approximation factor 1+ε in O~(n+(1/ε)9/4) time, where O~ hides polylogarithmic factors.

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

Theorem 5

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

Proof

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

tYdw¯(s,t)=dw(T)-eEQ(e)·x(e)D, 2.10

is equivalent to

eEQ(e)·x(e)D,D=dw(T)-D. 2.11

Then the problem (MCSDIPT-UEH) is equivalent to the following problem.

minxeEc(e)x(e)s.t.eEQ(e)·x(e)D,x(e)=0,ifw¯(e)=w(e),1,ifw¯(e)w(e). 2.12

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

A linear time algorithm to solve the problem (SDIPT-UEH) under unit Hamming distance

The (SDIPT-UEH) problem under unit Hamming distance, denoted by (SDIPT-UEuH), can be formulated from the models (2.9) and (2.3) as the following form.

maxw¯eEQ(e)H(w¯(e),w(e))(SDIPT-UEuH)s.t.eEH(w¯(e),w(e))K,l(e)w¯(e)w(e),eE. 3.1

We can conclude from the model (3.1) that the problem (SDIPT-UEuH) 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.

Q(ei1)Q(ei2)Q(eiK)Q(ein).

Theorem 6

Let E¯K={eiτ|τ=1,2,,K} be the set of the first K largest Q(e)-value edges in E. Then w¯(e)=l(e),eE¯Kw(e),eE¯K is an optimal solution of the problem (SDIPT-UEuH).

Proof

Suppose w¯ is not an optimal solution of the problem (SDIPT-UEuH), but w^(e)=l(e),eE^K,w(e),eE^K. is, where E^K={ejτ|τ=1,2,,K} is the set of K edges different from E¯. Then, eE^Q(e)eE¯Q(e) and |E^K|=|E¯K|=K. If eE^KQ(e)=eE¯KQ(e), then E^K is also the first K largest Q(e)-value edges and the theorem holds. If eE^KQ(e)>eE¯KQ(e), then it contradicts that E¯K is the first K largest Q(e)-value edges and w¯ is an optimal solution of the problem (SDIPT-UEuH).

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:=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 E1 and E2 of edges whose value is larger than and equal to q, respectively. Finally, E¯K:=E1E2(1:K-|E1|) 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. graphic file with name 10878_2021_819_Figa_HTML.jpg

Theorem 7

Algorithm 1 can solve the problem (SDIPT-UEuH) in O(n) time.

An O(nlogn) time algorithm to solve the problem (MCSDIPT-UEH) under unit Hamming distance

We consider the problem (MCSDIPT-UEuH) under unit Hamming distance, which can be formulated from the models (2.12) and (2.4) as follows.

minw¯eEH(w¯(e),w(e))(MCSDIPT-UEuH)s.t.eEQ(e)H(w¯(e),w(e))D,l(e)w¯(e)w(e),eE. 4.1

The problem (MCSDIPT-UEuH) 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 E¯k={eiτ|τ=1,,k} be the set with minimum number of edges satisfying τ=1kQ(eiτ)D. Then w~(e)=l(e),eE~k,w(e),eE~k. is an optimal solution of (MCSDIPT-UEuH) for any E~k={eατ|τ=1,,k} with τ=1kQ(eατ)D.

Proof

Suppose w~ is not an optimal solution of the problem (MCSDIPT-UEuH), but w^(e)=l(e),eE^k,w(e),eE^k. is, where E^k={ejτ|τ=1,2,,k} with τ=1kQ(ejτ) D. Then we have k<k, which contradicts that E¯k is the set with minimum number of edges satisfying τ=1kQ(eiτ)D. Hence, w~ is an optimal solution.

To find the set E¯k={eiτ|τ=1,2,,k} with the minimum number of edges satisfying τ=1kQ(eiτ)D, we perform a method in two steps. In the first step, we sort the edges ei1,,ein 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 τ=1kQ(eiτ)D and τ=1k-1Q(eiτ)<D. Finally, we upgrade the first k largest Q(e)-value edges, which is just the set E¯k. graphic file with name 10878_2021_819_Figb_HTML.jpg

Theorem 9

The problem (MCSDIPT-UEuH) can be solved in O(nlogn) 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(nlogn) time in Line 2. It takes O(logn) 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-UEuH) can be solved in O(nlogn) time by Algorithm 2.

Solve the problems (SDIPT-UE) and (MCSDIPT-UE) under weighted l1 norm

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

minw¯tYdw¯(s,t)(SDIPT-UE1)s.t.eEc(e)|w¯(e)-w(e)|K,l(e)w¯(e)w(e),eE. 5.1
minw¯eEc(e)|w¯(e)-w(e)|(MCSDIPT-UE1)s.t.tYdw¯(s,t)D,l(e)w¯(e)w(e),eE. 5.2

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

Theorem 10

The problem (SDIPT-UE1) can be transformed into a continuous knapsack problem.

Proof

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

minw¯tYdw¯(s,t)=dw(T)-maxxeEQ(e)x(e).

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

maxxeEQ(e)·x(e)s.t.eEc(e)Δw(e)·x(e)K,0x(e)1.

which is just a continuous knapsack problem.

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

Theorem 11

The problem (MCSDIPT-UE1) can be transformed into a continuous knapsack problem.

Proof

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

minw¯eEc(e)|w¯(e)-w(e)|=minxeEc(e)Δw(e)x(e)=minyeEc(e)Δw(e)(1-y(e))=minyeEc(e)Δw(e)-eEc(e)Δw(e)y(e)=eEc(e)Δw(e)-maxyeEc(e)Δw(e)y(e).

Moreover, similar to the formulas (2.10)–(2.11), the constraint in model (5.2) can be transformed into eEQ(e)x(e)dw(T)-D. By substituting x(e)=1-y(e) into the constraint, we have

eEQ(e)x(e)=eEQ(e)(1-y(e))=eEQ(e)-eEQ(e)y(e)dw(T)-D,

which is equivalent to

eEQ(e)y(e)D,D=eEQ(e)-dw(T)+D.

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

maxyeEc(e)Δw(e)y(e)s.t.eEQ(e)y(e)D,0y(e)1. 5.3

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

Corollary 12

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

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 Ps,tk(tkL(e),eA(v)) decrease by Δw(e)=β0(e)-β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 vV, let B(v)=eA(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)=1,ifvS,0,ifvS. and then the objective function can be calculated as follows.

minSVtYdw¯(s,t)=minSVtYePs,tw¯(e)=minSVtYvSPs,teA(v)Ps,tβ1(e)+vPs,t\SeA(v)Ps,tβ0(e)=minztYvPs,teA(v)Ps,t(z(v)β1(e)+(1-z(v))β0(e))=minztYvPs,teA(v)Ps,t(β0(e)-z(v)(β0(e)-β1(e)))=tYvPs,teA(v)Ps,tβ0(e)-maxztYvPs,teA(v)Ps,tz(v)Δw(e)=tYdβ0(s,t)-maxzvVeA(v)ePs,ttYΔw(e)z(v)=dβ0(T)-maxzvVeA(v)|L(e)|Δw(e)·z(v)=dβ0(T)-maxzvVeA(v)Q(e)z(v)=dβ0(T)-maxzvVB(v)z(v) 6.1

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

maxzvVB(v)z(v)s.t.vVc(v)z(v)K,z(v)=1,ifvis upgraded,0,ifvis notupgraded. 6.2

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

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β0(T)-vVB(v)z(v)D and then we have vVB(v)z(v)D0, where D0=dβ0(T)-D.

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

minzvVc(v)z(v)s.t.vVB(v)z(v)D0,z(v)=1,if vis upgraded,0,if vis notupgraded. 6.3

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

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

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

maxzvVB(v)z(v)(SDIPT-UNu)s.t.vVz(v)K,z(v)=1,if vis upgraded,0,if vis notupgraded. 7.1

It is shown in model (7.1) that the problem (SDIPT-UNu) 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.

B(vi1)B(vi2)B(viK)B(vin+1).

Theorem 16

Let V¯K={viτ|τ=1,2,,K} be the set of the first K largest B(v)-value nodes in V.Then w¯(e)=β1(e),eA(v),vV¯K,β0(e),otherwise. is an optimal solution of the problem (SDIPT-UNu).

Proof

Suppose w¯ is not an optimal solution of the problem (SDIPT-UNu), but w^(e)=β1(e),eA(v),vV^K,β0(e),otherwise. is, where V^K={vjτ|τ=1,2,,K} is the set of K nodes different from V¯K. Then we have vV^KB(v)vV¯KB(v) and |V^K|=|V¯K|=K. If vV^KB(v)=vV¯KB(v), then V^ is also the set of the first K largest B(v)-value nodes and the theorem holds. If vV^KB(v)>vV¯KB(v), then it contradicts that V¯K is the first K largest B(v)-value nodes. Hence, w¯ is an optimal solution of the problem (SDIPT-UNu).

We can solve the problem (SDIPT-UNu) similar to the problem (SDIPT-UEuH). 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 V1 and V2 of nodes whose value is larger than and equal to q, respectively. Finally, we can obtain the set SK:=V1V2(1:K-|V1|) of the first K largest B(v)-value edges in the array B. The above steps can both be completed in O(n) time.graphic file with name 10878_2021_819_Figc_HTML.jpg

Theorem 17

Algorithm 3 can solve the problem (SDIPT-UNu) in O(n) time.

An O(nlogn) time algorithm to solve the problem (MCSDIPT-UN) with unit cost

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

minzvVz(v)(MCSDIPT-UNu)s.t.vVB(v)z(v)D0,z(v)=1,if vis upgraded,0,if vis notupgraded. 8.1

where D0=dβ0(T)-D.

As shown in model (8.1), the problem (MCSDIPT-UNu) aims to upgrade the least number of nodes such that the sum of the total reduction amount is no less than D0. 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 V¯k={viτ|τ=1,,k} be the set with minimum number of nodes satisfying τ=1kB(viτ)D0. Then for any V~k={vατ|τ=1,,k} with τ=1kB(vατ)D0, w~(e)=β1(e),eA(v),vV~k,β0(e),otherwise. is an optimal solution of (MCSDIPT-UNu).

Proof

Suppose w~ is not an optimal solution of the problem (MCSDIPT-UNu), but w^(e)=β1(e),eA(v),vV^k,β0(e),otherwise. is, where V^k={vjτ|τ=1,2,,k} with τ=1kB(vjτ)D0. Then we have k<k, it contracts that V¯k is the set with minimum number of nodes satisfying τ=1kB(viτ)D0. Hence, w~ is an optimal solution of the problem (MCSDIPT-UNu).

We can perform a greedy algorithm similar to Algorithm 2 to solve the problem (MCSDIPT-UNu). Similar to Theorem 9, we can conclude that graphic file with name 10878_2021_819_Figd_HTML.jpg

Corollary 19

The problem (MCSDIPT-UNu) can be solved in O(nlogn) time by Algorithm 4.

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 β0,β1 satisfying β1<β0 in Algorithms 3, 4, respectively. For each randomly generated tree, we solved the four problems (SPIT-UEuH),(MCSPIT-UEuH),(SPIT-UNu) and (MCSPIT-UNu) for comparison, respectively. Let T1,T2,T3,T4 be the average CPU time of Algorithms 1, 2, 3 and 4, respectively. The relevant maximum and minimum running time, denoted by Timax,Timin(i=1,2,3,4), respectively, are recorded as well.

Table 2.

Performances of Algorithms 1, 2, 3 and 4

Complexity n 1000 5000 10,000 30,000 50,000 100,000
O(n) T1 0.0017 0.0088 0.0173 0.0508 0.0925 0.1771
T1max 0.0470 0.0240 0.0320 0.0700 0.1160 0.2360
T1min 0 0 0.0020 0.0360 0.0780 0.1540
O(nlogn) T2 0.0002 0.0012 0.0018 0.0067 0.0116 0.0234
T2max 0.0150 0.0160 0.0160 0.0230 0.0270 0.0380
T2min 0 0 0 0 0 0.0100
O(n) T3 0.0011 0.0079 0.0165 0.0523 0.0915 0.1845
T3max 0.0170 0.0230 0.0320 0.0690 0.1100 0.2240
T3min 0 0 0 0.0380 0.0620 0.1250
O(nlogn) T4 0.0002 0.0013 0.0028 0.0115 0.0205 0.0435
T4max 0.0160 0.0160 0.0160 0.0250 0.0350 0.0560
T4min 0 0 0 0 0.0100 0.0280

As shown in Table 2, the four algorithms are all very efficient and they follow their own time complexities very well. Notice that T3,T4 are relatively slower than T1,T2 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 T3 and T4 into consideration. In Table 2, we can calculate the ratios T3T4={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(nlogn). It can be predicted that the ratio between T3 and T4 may be smaller as n becomes larger, and finally, T3 will be faster than T4. Similarly, T1 will also be faster than T2 when n is large enough.

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-UEH) and (MCSDIPT-UEH) 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-UEuH) and (SDIPT-UNu) can be solved in linear time based on the selection algorithm, while the minimum cost problems (MCSDIPT-UEuH) and (MCSDIPT-UNu ) can be solved in O(nlogn) time by a binary search method. Additionally, the problems (SDIPT-UE1) and (MCSDIPT-UE1) under weighted l1 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.

Footnotes

Research is supported by National Natural Science Foundation of China (11471073).

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  1. Albert R, Jeong H, Barabasi A. Error and attack tolerance of complex networks. Nature. 2000;406(6794):378–382. doi: 10.1038/35019019. [DOI] [PubMed] [Google Scholar]
  2. Ayyldz E, Zelik G, Gencer CT. Determining the most vital arcs on the shortest path for fire trucks in terrorist actions that will cause fire. Commun Fac Sci Univ Ankara Ser A1 Math Stat. 2019;68(1):441–450. doi: 10.31801/cfsuasmas.425508. [DOI] [Google Scholar]
  3. Ball MO, Golden BL, Vohra RV. Finding the most vital arcs in a network. Oper Res Lett. 1989;8(2):73–76. doi: 10.1016/0167-6377(89)90003-5. [DOI] [Google Scholar]
  4. Bazgan C, Nichterlein A et al (2015) A refined complexity analysis of finding the most vital edges for undirected shortest paths. In: Algorithms and complexity: lecture notes in computer science, vol 9079, pp 47–60
  5. Bazgan C, Fluschnik T, Nichterlein A, Niedermeier R, Stahlberg M. A more fine-grained complexity analysis of finding the most vital edges for undirected shortest paths. Networks. 2019;73(1):23–37. doi: 10.1002/net.21832. [DOI] [Google Scholar]
  6. Corley HW, Sha DY. Most vital links and nodes in weighted networks. Oper Res Lett. 1982;1:157–161. doi: 10.1016/0167-6377(82)90020-7. [DOI] [Google Scholar]
  7. COVID-19 Global Outbreak Live (2021) Phoenix News in China. https://news.ifeng.com/c/special/7uLj4F83Cqm. Accessed 16 Sept 2021
  8. Ibarra OH, Kim CE. Fast approximation algorithms for the knapsack and sum of subset problems. J Assoc Comput Mach. 1975;22(4):463–468. doi: 10.1145/321906.321909. [DOI] [Google Scholar]
  9. Infectious Diseases, Characteristics of Infectious Diseases: Infectivity. Encyclopedia 360 in China. https://baike.so.com/doc/5378322-5614504.html. Accessed 3 Apr 2021
  10. Italy, Iran in the Middle East, Korea spiralling out of control. Asymptomless people with poison are simply impossible to guard against! WeChat in China: things like the UK. https://mp.weixin.qq.com/s/ehvC-uQw3J71jH-h6lMjSQ. Accessed 23 Feb 2020
  11. Jin C (2019) An improved FPTAS for 0-1 knapsack. In: Leibniz international proceedings in informatics, LIPIcs vol 132, no 76. 10.4230/LIPIcs.ICALP.2019.76
  12. Khachiyan L, Boros E, Borys K, Elbassioni K, Gurvich V, Rudolf G, Zhao J. On short paths interdiction problems: total and node-wise limited interdiction. Theory Comput Syst. 2008;43(2):204–233. doi: 10.1007/s00224-007-9025-6. [DOI] [Google Scholar]
  13. Magnouche Y, Martin S. Most vital vertices for the shortest s-t path problem: complexity and Branch-and-Cut algorithm. Optim Lett. 2020;14(2):2039–2053. doi: 10.1007/s11590-019-01527-5. [DOI] [Google Scholar]
  14. Martello S, Toth P. Knapsack Problem: algorithms and computer implementations. Chichester: John Wiley & Sons; 1990. [Google Scholar]
  15. Thoms HC, Charles EL, Ronald LR, Clifford S. Introduction to algorithms. 3. Cambridge: The MIT Press; 2009. [Google Scholar]
  16. Will COVID-19 patients be re-infected after they are cured and discharged from hospital? Xinhuanet in China. http://www.xinhuanet.com/politics/2020-02/26/c_1210491141.htm. Accessed 26 Feb 2020
  17. Zhang Q, Guan XC, Pardalos PM. Maximum shortest path interdiction problem by upgrading edges on trees under weighted l1 norm. J Global Optim. 2021;79(4):959–987. doi: 10.1007/s10898-020-00958-0. [DOI] [Google Scholar]
  18. Zhang Q, Guan XC, Wang H, Pardalos PM (2021b) Maximum shortest path interdiction problem by upgrading edges on trees under Hamming distance. Optim Lett 15(8): 2661–2680

Articles from Journal of Combinatorial Optimization are provided here courtesy of Nature Publishing Group

RESOURCES