Abstract 1 Introduction 2 Preliminaries 3 Review of Previous Algorithm 4 Linear-Time Influence Spread Computation 5 Discussion 6 Conclusion References

Linear-Time Exact Computation of Influence Spread on Bounded-Pathwidth Graphs

Kengo Nakamura ORCID Communication Science Laboratories, NTT, Inc., Kyoto, Japan    Masaaki Nishino ORCID Communication Science Laboratories, NTT, Inc., Kyoto, Japan
Abstract

Given a network and a set of vertices called seeds to initially inject information, influence spread is the expected number of vertices that eventually receive the information under a certain stochastic model of information propagation. Under the commonly used independent cascade model, influence spread is equivalent to the expected number of vertices reachable from the seeds on a directed uncertain graph, and the exact evaluation of influence spread offers many applications, e.g., influence maximization. Although its evaluation is a #P-hard task, there is an algorithm that can precisely compute the influence spread in O⁢(m⁢n⁢ωp2⋅2ωp2) time, where ωp is the pathwidth of the graph. We improve this by developing an algorithm that computes the influence spread in O⁢((m+n)⁢ωp2⋅2ωp2) time. This is achieved by identifying the similarities in the repetitive computations in the existing algorithm and sharing them to reduce computation. Although similar refinements have been considered for the probability computation on undirected uncertain graphs, a greater number of similarities must be leveraged for directed graphs to achieve linear time complexity.

Keywords and phrases:
Influence spread, bounded pathwidth, network reliability, linear time algorithm
Copyright and License:
[Uncaptioned image] © Kengo Nakamura and Masaaki Nishino; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation → Parameterized complexity and exact algorithms
; Networks → Network algorithms
Related Version:
Full Version: https://arxiv.org/abs/2604.13526
Funding:
This work was supported by JSPS KAKENHI Grant Number JP26K02906.
Editor:
Pierre Fraigniaud

1 Introduction

Given a network and seed set S, which is a set of vertices that are initially injected information, influence spread [5] σ⁢(S) is the expected number of vertices that eventually receives the information under a stochastic model of information propagation. Influence spread is implemented in viral marketing applications with the aim of evaluating the influence of a particular node within a social network. Currently, it is also a keystone for other network applications such as network monitoring [11], rumor control [23], target advertisement [13], and social recommendation [24]. Among several information diffusion models, the most basic and commonly used one is the independent cascade (IC) model [6]. In this model, a network is modeled as a directed graph G=(V,E), where each edge e∈E is associated with a probability pe. When a vertex v receives information, it stochastically propagates the information along every outgoing edge e independently with a given probability pe.

The influence spread σ⁢(S) under the IC model is equivalent to the expected number of vertices reachable from at least one vertex in S on a directed uncertain graph. Given directed graph G=(V,E) and probability pe for every edge e∈E, we consider an uncertainty in which each edge e∈E is present with probability pe and absent with probability 1−pe. We assume that each edge’s presence or absence is stochastically independent of the other edges. Accordingly, the probability that a subgraph (V,E′)⁢(E′⊆E) appears is

Pr⁢(E′)≔∏e∈E′pe⋅∏e∈E∖E′(1−pe). (1)

Here, a directed path from some s∈S to vertex v on the subgraph (V,E′) corresponds to the route of information propagation from s to v. Therefore, given S⊆V and v∈V, the probability that v receives information is equal to the probability Pr⁢(S↝v) that v can be reached from some vertices in S under uncertainty. Here, Pr⁢(S↝v)=∑E′∈ℰS↝vPr⁢(E′), where ℰS↝v is the family of subsets E′ of edges such that v can be reached from some vertices in S on (G,E′). Finally, the influence spread can be represented as σ⁢(S)=∑v∈V∖SPr⁢(S↝v).

Example 1.1.

Figure 1a depicts examples of the probabilities Pr⁢(E′) of subgraphs (V,E′)⁢(E′⊆E). For this uncertain graph, there are 15 subgraphs in which v=4 is reachable from {S}=1 (Figure 1b); thus, Pr⁢({1}↝4) is the sum of Pr⁢(E′) over all these subgraphs. By evaluating Pr⁢({1}↝2), Pr⁢({1}↝3), and Pr⁢({1}↝4) as in Figure 1c, σ⁢({1}) can be computed as their sum.

Figure 1: (a) Example of directed uncertain graph and probabilities of subgraphs. (b) All 15 subgraphs in which v=4 is reachable from {S}=1. Pr⁢({1}↝4) is the sum of probabilities of these subgraphs. (c) σ⁢({1}) is computed as the sum of Pr⁢({1}↝v)s for v=2,3,4.

Since evaluating the influence spread σ⁢(S) is a #P-hard task [3], most studies have relied on Monte Carlo simulation for evaluating σ⁢(S) [7, 10, 11, 18]. However, exact computation of σ⁢(S) is important for the following reasons. First, this allows us to more accurately evaluate the influence spread in larger networks, since real networks often consist of small communities; the exact computation of influence spread in each small community will improve overall evaluation quality. Second, this allows us to rank the influential vertices in descending order of influence spread. For this purpose, Monte Carlo simulations are not sufficient because Ω⁢(1/ε2) samples are needed to obtain (1±ε)-approximation with high probability [18]; to distinguish every vertex’s influence spread, high accuracy such as ε∼10−5 is sometimes needed, which is costly for Monte Carlo methods.

Maehara et al. [15] proposed the only non-trivial algorithm to exactly compute σ⁢(S) under the IC model. Given seed set S and v, it efficiently computes Pr⁢(S↝v), i.e., the probability that v receives information. Given the path decomposition of G whose width is ωp, this probability for a single v can be computed in O⁢(m⁢ωp2⋅2ωp2) time, where m is the number of edges. Hereafter, we mean the pathwidth of a directed graph G in the sense of the pathwidth of the underlying undirected graph of G as used in the literature [15, 20]. The influence spread σ⁢(S)=∑v∈V∖SPr⁢(S↝v) can be computed in O⁢(m⁢n⁢ωp2⋅2ωp2) time, where n is the number of vertices.

Here, even for bounded-pathwidth graphs, obtaining the σ⁢(S) value requires super-linear (O⁢(m⁢n)) time. Since there are similarities in the repetitive computation for different vertices v using this algorithm, we investigated the use of these similarities to refine their algorithm and thus improve the running time for computing σ⁢(S).

1.1 Our Contribution

In this paper, we propose an algorithm for computing σ⁢(S) for given S under the IC model. Specifically, the proposed algorithm simultaneously computes Pr⁢(S↝v) in an uncertain directed graph for all vertices v. Our main result can be expressed as follows.

Theorem 1.2.

Given directed graph G, seed set S, each edge’s probability pe of presence, and the path decomposition of G whose width is ωp, the probability Pr⁢(S↝v) for every vertex v can be computed in O⁢((m+n)⁢ωp2⋅2ωp2) time in total.

Since even inputting the entire graph requires linear time, this algorithm is asymptotically optimal for graphs with a bounded pathwidth when the constant factor is ignored. Moreover, the exponential factor of the pathwidth, hidden in the constant, remains the same as in the algorithm of Maehara et al. [15]: the dependence on the graph sizes is improved from O⁢(m⁢n) to O⁢(m+n) while the dependence on the pathwidth is kept the same.

Our algorithm shares certain ideas with the existing algorithm for simultaneously computing the probabilities of connection in undirected graphs [16] in that both use similarities in the computation of the previous algorithms [8, 15] for different vertices. However, there is a non-trivial gap in extending that algorithm [16] to directed graphs due to the difference between connectivity in undirected graphs and reachability in directed graphs. We fill this gap by finding additional similarities in computing σ⁢(S) with the previous algorithm [15]; details are discussed in Section 5.

1.2 Related Work

Influence maximization.

The most well-studied problem related to influence spread is influence maximization [10], that is, the problem of choosing a seed set S to maximize the influence spread. This has attracted much attention over the past two decades [12, 14, 19]. Although the influence maximization problem under most diffusion models including the IC model is NP-hard [10], a simple greedy algorithm [10] can achieve a (1−1/e)-approximation provided that every σ⁢(S) is computed exactly. Various methods, e.g., the sketch-based methods described in a survey [12], have improved this greedy algorithm. However, if we resorted to using Monte Carlo simulation to evaluate σ⁢(S), we could not obtain a deterministic approximation bound for influence maximization, even with greedy or more sophisticated algorithms. Moreover, although many studies have used an alternative proxy for σ⁢(S) to speed up the computation (e.g., proxy-based methods [12] and learning-based methods [14]), they also lack approximation bounds. This situation accentuates the theoretical importance of an exact evaluation of influence spread.

Network reliability.

Computing the probability that some vertices are connected in an uncertain graph has been traditionally studied as network reliability evaluation in the network community. Most studies on network reliability evaluation have modeled the network as an undirected graph and, given a vertex set K and the probability pe of presence for every edge, they computed the probability that the vertices in K are connected. Even for undirected graphs, computing this probability is #P-complete [22]. Nevertheless, Hardy et al. [8] developed an algorithm that could compute this probability in linear time for graphs with bounded pathwidth. Another line of research has attempted to compute the expected number of vertices connected to vertex u [17], which is an analogue of the influence spread under the IC model for undirected graphs. Nakamura et al. [16] proposed an algorithm that could compute the probability that a vertex u is connected to v for every v∈V in linear time for an undirected graph with bounded pathwidth. By summing all the probabilities for every v, it is also possible to compute the expected number of vertices connected to v in linear time. This algorithm uses the similarities in the computation of the probability that u and v are connected with Hardy’s algorithm [8] for different v; therefore, it shares similar ideas with our work. However, we cannot straightforwardly extend this algorithm to handle directed graphs, as described in Section 1; detailed discussions are given in Section 5. Note that these algorithms [8, 16] also run in polynomial time for graphs with bounded pathwidth, indicating the importance of algorithms dealing with bounded-pathwidth graphs.

2 Preliminaries

For sets U,W of vertices, U↝GW means that u can reach w, i.e., w can be reached from u, for some u∈U and w∈W in directed graph G. If U (or W) consists of only a single vertex u (w), we simply write, e.g., u↝GW and u↝Gw instead of {u}↝GW and {u}↝G{w}. When it is clear from the context, we omit the subscript G.

A directed graph is called strongly connected if u↝v for every ordered pair (u,v) of vertices. We say vertex subset C is a strongly connected component (SCC) of G if the vertex-induced subgraph of G induced by C is strongly connected but that induced by V∪{v} is not strongly connected for any v∈V∖C. It is known that, given directed graph G, all SCCs in G can be computed in linear time in the size of G [21]. Throughout this paper, n and m denote the number of vertices and edges, respectively, in the input graph G.

We formally define the problems to solve as follows.

Problem 2.1.

Given a directed graph G, probabilities {pe}e∈E, and a seed set S⊆V, compute the probability Pr⁢(S↝v) for every v∈V∖S.

For convenience, we assume that G contains no self-loops and the underlying undirected graph of G is connected. Note that if G contains self-loops, we can safely remove it, since it would never affect reachability. If G is disconnected, we can solve the problem individually for each connected component.

3 Review of Previous Algorithm

3.1 Decomposition of Probability

In the following, we review Maehara’s algorithm [15] for exactly computing Pr⁢(S↝v) for a given S,v. Although the literature [15] only showed the algorithm for the case |S|=1, here we show the general S case because it can be easily extended.

The basic idea in evaluating Pr⁢(S↝v) is to decompose Pr⁢(S↝v) into terms that can be easily computed. For E′,E′′⊆E such that E′∩E′′=∅, let Pr(⋅∣E′,E′′¯) be the conditional probability given that the edges in E′ are present and those in E′′ are absent. From the case analysis of whether e∈E∖(E′∪E′′) is present or absent,

Pr⁢(S↝v∣E′,E′′¯)=pe⋅Pr⁢(S↝v∣E′∪{e},E′′¯)+(1−pe)⋅Pr⁢(S↝v∣E′,E′′∪{e}¯). (2)

By ordering edges as e1,…,em, Pr⁢(S↝v) can be decomposed by recursively applying (2):

Pr⁢(S↝v) =pe1⋅Pr⁢(S↝v∣{e1},∅¯)+(1−pe1)⋅Pr⁢(S↝v∣∅,{e1}¯)
=pe1⁢pe2⋅Pr⁢(S↝v∣{e1,e2},∅¯)+pe1⁢(1−pe2)⋅Pr⁢(S↝v∣{e1},{e2}¯)+
(1−pe1)⁢pe2⋅Pr⁢(S↝v∣{e2},{e1}¯)+(1−pe1)⁢(1−pe2)⋅Pr⁢(S↝v∣∅,{e1,e2}¯)
=⋯=∑E′⊆E<iPr<i⁢(E′)⋅Pr⁢(S↝v∣E′,E<i∖E′¯)=⋯, (3)
where E<i≔{e1,…,ei−1},Pr<i⁢(E′)≔∏e∈E′pe⋅∏e∈E<i∖E′(1−pe).

This expansion eventually reaches the definition Pr⁢(S↝v)≔∑E′∈ℰS↝vPr⁢(E′). Therefore, by using this decomposition naively, we have O⁢(2m) terms, which incurs exponential complexity of the graph size in evaluating it.

To prevent this, we attempt to detect the equality among probabilities, i.e., to find subsets E′,F′⊆E<i⁢(E′≠F′) such that Pr⁢(S↝v∣E′,E<i∖E′¯)=Pr⁢(S↝v∣F′,E<i∖F′¯). If such equality can be detected, we simply need to further decompose only one among the equal probabilities, which reduces the number of terms. If the following condition (#) holds, we can confirm Pr⁢(S↝v∣E′,E<i∖E′¯)=Pr⁢(S↝v∣F′,E<i∖F′¯):

(#) For any H⊆E≥i≔E∖E<i, S↝(V,E′∪H)v if and only if S↝(V,F′∪H)v.

To check condition (#), we focus on the reachability relation on the subgraph (V,E′). If u↝(V,E′)w and w↝(V,F′)v are equivalent for any u,w∈V, we can confirm that (#) holds. In brief, this is because, given a path from s∈S to v on (V,E′∪H), we can construct a path from s to v on (V,F′∪H) by using the above equivalence, and vice versa.

Maehara et al. [15] indicated that only a limited subset of vertices called frontier vertices is important for checking (#).

Definition 3.1.

Given edge ordering e1,…,em, (i-th) frontier vertices Wi are those appearing in both E<i and E≥i.

We consider the reachability relations among Wi∪S∪{v} on (V,E′) as follows.

Definition 3.2.

Let WiS↝⁢(E′)≔{w∈Wi∣S↝(V,E′)w} (frontier vertices reachable from S) and Wi↝v⁢(E′)≔{w∈Wi∣w↝(V,E′)v} (those that can reach v). A binary matrix Φiv⁢(E′) is defined as follows: (I) It is indexed by (Wi∖WiS↝⁢(E′)∪{S})×(Wi∖Wi↝v⁢(E′)∪{v}). (II) Φiv⁢(E′)u⁢w=1 if and only if u↝(V,E′)w. Here, S is treated as a special (single) row index, and v is treated as a column index. We call Φiv⁢(E′) a transversal configuration (TC).

We can then prove the following.

Lemma 3.3.

Φiv⁢(E′)=Φiv⁢(F′) is a sufficient condition for (#), meaning that Pr⁢(S↝v∣E′,E<i∖E′¯)=Pr⁢(S↝v∣F′,E<i∖F′¯). Note that Φiv⁢(E′)=Φiv⁢(F′) means that the indices of matrices as well as their entries are equal.

This can be shown by transforming a u-v directed path on (V,E′∪H) for some u∈S to a u′-v directed path on (V,F′∪H) for some u′∈S. Now we can rewrite Pr⁢(S↝v∣E′,E<i∖E′¯) as Pr⁢(S↝v∣Φiv⁢(E′)).

Example 3.4.

On the graph in Figure 2a with v=5, we examine {e1,e4},{e1,e2,e3,e4}, {e1,e2,e4,e6},{e2,e5,e6}⊆E<8 corresponding to the four edge subgraphs of Figure 2b. These subsets have an identical TC Φ85 because W8={4,5}. Thus, the conditional probabilities of S↝5 are all equal for these subsets.

Algorithm 1 Previous algorithm [15].
Figure 2: (a) Example of input graph G. Red vertex is included in S. (b) Example of different edge subsets of E<8 leading to the same TC Φ85.

Moreover, Φiv⁢(⋅) has the following property: if Φiv⁢(E′)=Φiv⁢(F′) for E′,F′⊆E<i, both Φi+1v⁢(E′)=Φi+1v⁢(F′) and Φi+1v⁢(E′∪{ei})=Φi+1v⁢(F′∪{ei}) hold. Thus, there exist transition functions 𝗅𝗈v,𝗁𝗂v from Φiv to Φi+1v satisfying 𝗅𝗈v⁢(Φiv⁢(E′))=Φi+1v⁢(E′) and 𝗁𝗂v⁢(Φiv⁢(E′))=Φi+1v⁢(E′∪{ei}) for any E′⊆E<i. By combining this fact and (2), we have, for any Φ=Φiv⁢(E′)⁢(E′⊆E<i),

Pr⁢(S↝v∣Φ)=pe⋅Pr⁢(S↝v∣𝗁𝗂v⁢(Φ))+(1−pe)⋅Pr⁢(S↝v∣𝗅𝗈v⁢(Φ)). (4)

Using this decomposition recursively, Pr⁢(S↝v) can be decomposed as follows:

Pr⁢(S↝v) =Pr⁢(S↝v∣Φ1v⁢(∅))
=pe1⋅Pr⁢(S↝v∣𝗁𝗂v⁢(Φ1v⁢(∅)))+(1−pe1)⋅Pr⁢(S↝v∣𝗅𝗈v⁢(Φ1v⁢(∅)))
=⋯=∑Φ∈𝒩iPr⁢(Φ)⋅Pr⁢(S↝v∣Φ)=⋯, (5)
where Pr(Φ)≔∑E′⊆E<i:Φiv⁢(E′)=ΦPr<i(E′),𝒩i≔{Φiv(E′)∣E′⊆E<i}. (6)

In other words, Pr⁢(Φ) is the probability that TC Φ appears and 𝒩i is the set of all TCs of the subsets of E<i. We later show that |𝒩i| is bounded by a constant if the pathwidth is bounded in Lemma 4.15. This is the main reason to achieve O⁢(m) time complexity in computing Pr⁢(S↝v).

For some TCs Φ, we can confirm that S↝v must hold or must not hold, i.e., Pr⁢(S↝v∣Φ)=1 or 0. For such TCs, we do not need to further decompose Pr⁢(S↝v∣Φ) with (4). We define such base cases with the following ⊤-pruning and ⊥-pruning as follows. Let iu be the largest index i such that one of the endpoints of ei is u and let iS≔maxu∈S⁡iu.

  • ■

    If 𝗁𝗂v⁢(Φ)S⁢v=1, determining the presence of ei confirms S↝v, i.e., Pr⁢(S↝v∣𝗁𝗂v⁢(Φ))=1. In such a case, we let 𝗁𝗂v⁢(Φ)=⊤, a special TC meaning that S↝v must hold (⊤-pruning).

  • ■

    Suppose that i≥iS and 𝗅𝗈v⁢(Φ)S⁢u=0 for any u, or that i≥iv and 𝗅𝗈v⁢(Φ)u⁢v=0 for any u. In these cases, no further vertices can be reached from S or reach v by determining the absence of ei, i.e., Pr⁢(S↝v∣𝗅𝗈v⁢(Φ))=0. Thus, we let 𝗅𝗈v⁢(Φ)=⊥, which is a special TC meaning that S↝v must not hold (⊥-pruning)111Although the original version [15] uses different pruning rules, they require a pre-computation of transitive closures of (V,E≥i), which takes cubic time. We use an alternative pruning rule that can be checked in linear time.. We also let 𝗁𝗂v⁢(Φ)=⊥ if ⊤-pruning does not occur and 𝗁𝗂v⁢(Φ) satisfies the same condition as above.

Eventually, all the TCs are transformed into either ⊤ or ⊥, and (5) reaches Pr⁢(S↝v)=Pr⁢(⊤)⋅1+Pr⁢(⊥)⋅0=Pr⁢(⊤). Thus, computing Pr⁢(⊤) is sufficient for evaluating Pr⁢(S↝v).

3.2 Procedure and Complexity

Now we describe the procedure to compute Pr⁢(⊤). We again use the transition of TCs. By considering the pruning described above, we redefine the set of TCs as 𝒩1′≔{Φ1v⁢(∅)} and 𝒩i′≔(⋃Φ∈𝒩i−1′{𝗁𝗂v⁢(Φ),𝗅𝗈v⁢(Φ)})∖{⊤,⊥}, i.e., we remove the pruned TCs from 𝒩i. Then, from the definition of Pr⁢(Φ) (Eq. (6)), we have

Pr⁢(Φ)=pi⋅∑Φ′∈𝒩i−1′:𝗁𝗂⁢(Φ′)=ΦPr⁢(Φ′)+(1−pi)⋅∑Φ′∈𝒩i−1′:𝗅𝗈⁢(Φ′)=ΦPr⁢(Φ′). (7)

To compute Pr⁢(⊤), we can use a similar formula:

Pr⁢(⊤)=pi⋅∑Φ′∈𝒩1′∪⋯∪𝒩m′:𝗁𝗂⁢(Φ′)=⊤Pr⁢(Φ′)+(1−pi)⋅∑Φ′∈𝒩1′∪⋯∪𝒩m′:𝗅𝗈⁢(Φ′)=⊤Pr⁢(Φ′). (8)

Starting from 𝒩1′={Φ1v⁢(∅)}, we can generate 𝒩i+1′ from 𝒩i′ recursively using transition functions 𝗁𝗂v,𝗅𝗈v. By recording the transition, we can compute every Pr⁢(Φ) and Pr⁢(⊤) with (7) and (8).

Algorithm 1 formally presents the procedures. Lines 1–7 recursively generate the successive TCs using transition functions 𝗅𝗈v,𝗁𝗂v while executing ⊥,⊤-pruning. This process can be seen as constructing a diagram of TCs as in Figure 3. Every Φ except for ⊥,⊤ has two outgoing edges heading to 𝗅𝗈v⁢(Φ) and 𝗁𝗂v⁢(Φ). In Algorithm 1, each Φ has two entries Φ.𝗅𝗈 and Φ.𝗁𝗂 that store the pointer to 𝗅𝗈v⁢(Φ) and 𝗁𝗂v⁢(Φ). Here, 𝒩i′ stores the TCs of the subsets of E<i as a hash map; pruned TCs are not stored. Along this diagram, we can compute every Pr⁢(Φ) with simple dynamic programming (DP) in lines 8–13; this simulates the formulas (7) and (8). The array p⁢[Φ] for Φ∈𝒩i′ is prepared to store Pr⁢(Φ). Note that even if an identical TC Φ appears in 𝒩i′ and 𝒩j′ (i≠j), we distinguish Φ∈𝒩i′ and Φ∈𝒩j′ in computing p⁢[⋅]. After computing all p⁢[Φ], Pr⁢(S↝v)=Pr⁢(⊤) is stored in p⁢[⊤].

Next, we analyze the complexity of this algorithm. For each TC Φ, computing 𝗅𝗈v⁢(Φ) and 𝗁𝗂v⁢(Φ) takes O⁢((|Wi|+|Wi+1|)2) time; details are in Lemma 4.14 of Section 4.4. If every 𝒩i′ is implemented as a hash map, storing or searching a TC also takes O⁢(|Wi|2) time. The number of patterns on Φiv can be bounded by O⁢(2|Wi|2); since this was not rigorously proved [15], we prove it in Lemma 4.15 of Section 4.4. The overall complexity can be bounded by O⁢(∑i(|Wi|+|Wi+1|)2⋅2|Wi|2)=O⁢(m⁢ω2⋅2ω2), where ω=maxi⁡|Wi|.

In fact, ω is related to the pathwidth of a graph. Given a path decomposition of G with width ωp, we can generate an edge ordering with ω≤ωp in linear time [9]. Since we can construct a path decomposition in linear time for a graph with bounded pathwidth [2], we have a linear time algorithm for computing Pr⁢(S↝v) on a graph with bounded pathwidth. However, computing σ⁢(S) requires O⁢(m⁢n⁢ω2⋅2ω2) time by computing Pr⁢(S↝v) for v∈V∖S.

Figure 3: (a)(b) Upper four levels of diagrams constructed from graph in Figure 2a with v=4 and v=5. (c)(d) Parts of lower levels of diagrams constructed from graph in Figure 2a with v=2 and v=3; (c) depicts part below Φ82⁢({e2,e5,e6}) and (d) depicts part below Φ83⁢({e1,e4,e7}). Solid arcs indicate connection from Φ to Φ.𝗁𝗂, while dashed arcs indicate connection from Φ to Φ.𝗅𝗈.

4 Linear-Time Influence Spread Computation

We now describe the proposed algorithm for Problem 2.1. First, we explain the high-level concept of the proposed algorithm. In computing σ⁢(S) with the algorithm described in Section 3, different diagrams of TCs are generated for different v∈V∖S in computing Pr⁢(S↝v). To argue the similarities among these diagrams, we divide each of them into three parts: upper levels, lower levels, and middle levels. More specifically, let Ai⊆V be the vertices that only appear in E<i and do not appear in E≥i, and Bi⊆V be those that only appear in E≥i and do not appear in E<i. Ai, Bi, and Wi (Definition 3.1) constitute a partition of V. Moreover, since E<i⊂E<i+1 and E≥i⊃E≥i+1 for i=1,…,m, V=B1⊇⋯⊇Bm+1=∅ and ∅=A1⊆⋯⊆Am+1=V. Thus, by fixing v, the diagram of TCs Φiv⁢(⋅) made from the reachability to v can be divided into three parts according to i: levels i s.t. v∈Bi (upper levels), those s.t. v∈Wi (middle levels), and those s.t. v∈Ai (lower levels).

We first find that upper levels of these diagrams exhibit an identical structure, i.e., diagrams of Φiv and Φiw exhibit an identical structure as long as v,w∈Bi (Observation 4.2); we extract the essential information to build this identical diagram as a shared transversal configuration (STC) Ψ=Ψi⁢(E′). We can also confirm that middle levels of these diagrams were also governed by the STCs (Lemma 4.8). Thus, by considering STCs Ψi⁢(⋅), we can have a similar formula to (5) using the STCs when v∈Bi∪Wi:

Pr⁢(S↝v)=∑Ψ∈ℳiPr⁢(Ψ)⋅Pr⁢(S↝v∣Ψ), (9)
wherePr(Ψ)≔∑E′⊆E<i:Ψi⁢(E′)=ΨPr<i(E′),ℳi≔{Ψi(E′)∣E′⊆E<i}.

For every v, there exists i such that v∈Bi∪Wi. Thus, for every v, if Pr⁢(Ψ) and Pr⁢(S↝v∣Ψ) are efficiently computed for all Ψ=Ψi⁢(⋅) with the above i, we can compute Pr⁢(S↝v) with (9). Here, since Pr⁢(Ψ) has a similar recursion as Pr⁢(Φ) (Lemma 4.9), all Pr⁢(Ψ)s can be computed in a manner similar to that used in Section 3 by building a diagram of STCs from i=1 to m+1. Since |ℳi| is constant for a graph with bounded pathwidth (Lemma 4.16), it can be performed in O⁢(m) time.

Indeed, when v∈Wi (middle levels), Pr⁢(S↝v∣Ψ) for Ψ=Ψi⁢(⋅) can also be computed efficiently. To compute this, we use the lower levels of the diagram of TCs Ψiv⁢(⋅). Although naively constructing the diagrams of TCs Φ for every v costs O⁢(m⁢n) time, we find that the lower levels of these diagrams have many identical substructures (Lemma 4.5). By using this, we can build all possible substructures of diagrams that appear in the lower level of these diagrams in O⁢(m) time. In addition, we again use middle levels’ equivalence (Lemma 4.8) to compute Pr⁢(S↝v∣Ψ) on middle levels in O⁢(m) time. Here we use the recursion on Pr⁢(S↝v∣Ψ) (Lemmas 4.11 and 4.12).

Eventually, for every v and i where v∈Wi, we obtain Pr⁢(Ψ) and Pr⁢(S↝v∣Ψ) for Ψ=Ψi⁢(⋅). Thus, by choosing i such that v∈Wi, we can compute Pr⁢(S↝v) with (9). Since (9) contains O⁢(|ℳi|) terms, which is constant for bounded-pathwidth graphs, the computation of Pr⁢(S↝v) for every v costs O⁢(n) time in total. The overall time complexity is bounded by O⁢(m+n) for a graph with bounded pathwidth. Note that, for every v, there exists i such that v∈Wi if v has degree more than 1. For vertices with degree 1, such i might not exist, but we can easily compute Pr⁢(S↝v) for such vertices, as described later.

In the following, we first identify the similarities in the previous algorithm [15] for different v in Section 4.1. Then, we derive DP formulas for computing Pr⁢(S↝v) in Section 4.2. Finally, we explain the main procedures and the complexity in Sections 4.3 and 4.4.

4.1 Equivalence of Diagrams for Different Vertices

We formally state the equivalence of different diagrams of TCs for upper levels (v∈Bi), lower levels (v∈Ai), and middle levels (v∈Wi).

Upper level equivalence.

First, we consider the case v,w∈Bi. No edges in E<i are incident to v, meaning that no vertex in Wi can reach v on (V,E<i). Furthermore, no vertex in S can reach v on (V,E<i). Therefore, for any E′⊆E<i, Φiv⁢(E′)u⁢v=0 for any u. This means we need to consider the reachability relations among only Wi∪{S}, not Wi∪{S,v}.

Definition 4.1.

Let Ψi⁢(E′) be a binary matrix indexed by (Wi∖WiS↝⁢(E′)∪{S})×Wi, where Ψi⁢(E′)u⁢x=1 if and only if u↝(V,E′)x. Here, S is treated as a special (single) row index. We call Ψi⁢(⋅) a shared transversal configuration (STC).

Since v∈Bi, we can recover Φiv⁢(E′) from Ψi⁢(E′) by Φiv⁢(E′)u⁢x=Ψi⁢(E′)u⁢x for any u as well as x≠v and Φiv⁢(E′)u⁢v=0 for any u. In other words, the diagram structure is completely determined by the transition of Ψi⁢(⋅) instead of Φiv⁢(⋅) when v∈Bi. The above argument also holds for the other w∈Bi. Therefore, the following observation holds.

Observation 4.2.

Consider the diagrams generated using Algorithm 1 with different v,w. If v,w∈Bi, the diagrams above any TCs Φiv⁢(E′) and Φiw⁢(E′) are identical. Moreover, we can instead use STC Ψi⁢(⋅) in building the diagram.

Example 4.3.

Figures 3a and 3b show the upper four levels of the diagram generated using Algorithm 1 with the graph of Figures 2a and v=4 or v=5. Since 4,5∈B4, the first four levels are identical, as depicted in these figures.

Lower level equivalence.

Next, we consider the case v,w∈Ai. Recall that Φiv⁢(⋅) captures the reachability among Wi∪{S,v}, and Φiw⁢(⋅) captures those among Wi∪{S,w}. Since v,w∈Ai, all edges incident to v and w are in E<i, meaning that all incident edges are determined when the edges in E<i are determined. Thus, intuitively, if Φiv and Φiw are “identical,” i.e., the reachability relations are identical by substituting v with w, S↝v and S↝w can be regarded as equivalent events. We formally define such an equivalence.

Definition 4.4.

For E′,F′⊆E<i, consider two TCs Φiv⁢(E′) and Φiw⁢(F′), where v,w∈Ai. We say these TCs are identical if Φiv⁢(E′)u⁢x=Φiw⁢(F′)u⁢x for any u and x≠v,w and Φiv⁢(E′)u⁢v=Φiw⁢(F′)u⁢w for any u. This means that Φiv⁢(E′) and Φiw⁢(F′) are identical matrices, except for the column indices being different.

Lemma 4.5.

Suppose Φiv⁢(E′) and Φiw⁢(F′) are identical for v,w∈Ai and E′,F′⊆E<i. Then, for any H⊆E≥i, S↝(V,E′∪H)v if and only if S↝(V,F′∪H)w.

Proof.

Fix H⊆E≥i and suppose that S↝(V,E′∪H)v. There is then a directed walk P from some s∈S to v in (V,E′∪H). The walk P can be divided into small walks P=P0⁢P1⁢P2⁢⋯⁢P2⁢k−1⁢P2⁢k satisfying the conditions that P2⁢j consists of only the edges in E′⊆E<i and that P2⁢j+1 consists of only the edges in H⊆E≥i. Let pj be the contact vertex of Pj and Pj+1. Note that P0 may be empty when s∈Wi∪Bi; in such a case, we set p0=s. Since pj⁢(j≥1) is incident to both edges in E′⊆E<i and those in H⊆E≥i, pj∈Wi. If P0 is nonempty, p0 is also in Wi. We can also assume that p1,p2,…,p2⁢k−2∉WiS↝⁢(E′); otherwise, we can take a directed walk P⋆ from some s∈S to pj within (V,E′) and consider a walk P⋆⁢Pj+1⁢⋯⁢P2⁢k instead. With a similar argument, we can assume that p1,p2,…,p2⁢k−2∉Wi↝v⁢(E′). Now, we constitute a directed walk P′ from some s′∈S to w in (V,F′∪H). First, when P0 is not empty, Φiv⁢(E′)S⁢p0=1. Since Φiv⁢(E′) and Φiw⁢(F′) are identical, Φiw⁢(F′)S⁢p0=1; thus, there is a directed walk P0′ from some s′∈S to p0 in (V,F′). This also holds when P0 is empty; in such a case, s′=s=p0 and P0′ is also empty. Next, for 1≤j≤k−1, P2⁢j’s existence and identity indicate Φiv⁢(E′)p2⁢j−1⁢p2⁢j=1=Φiw⁢(F′)p2⁢j−1⁢p2⁢j, meaning that there is a directed walk P2⁢j′ from p2⁢j−1 to p2⁢j in (V,F′). Finally, P2⁢k’s existence and identity indicate Φiv⁢(E′)p2⁢k−1⁢v=1=Φiw⁢(F′)p2⁢k−1⁢w, meaning that there is a directed walk P2⁢k′ from p2⁢k−1 to w in (V,F′). Now P′=P0′⁢P1⁢P2′⁢⋯⁢P2⁢k−1⁢P2⁢k′ is a directed walk from s′∈S to w in (V,F′∪H), indicating S↝(V,F′∪H)w.

In the same manner, we can show the reverse direction. Thus, the lemma holds. ◀ This indicates that Pr⁢(S↝v∣Φiv)=Pr⁢(S↝w∣Φiw) when Φiv and Φiw are identical.

Observation 4.6.

Consider the diagrams generated using Algorithm 1 with different v,w. If v,w∈Ai and identical TCs Φiv,Φiw appear in each diagram, the diagram structures below Φiv and below Φiw are identical.

Example 4.7.

Figures 3c and 3d show parts of the last four levels of the diagrams below Φ82⁢({e2,e5,e6}) (v=2) and below Φ83⁢({e1,e4,e7}) (v=3). Since 2,3∈A8 and these TCs are identical, these diagram structures are also identical.

Middle level equivalence.

Finally, we examine the case v,w∈Wi. In this case, the TC Φiv⁢(⋅) captures the reachability among Wi∪{S,v}=Wi∪{S}. In addition, the STC Ψi⁢(⋅) also captures the reachability among Wi∪{S}. Thus, we can recover Φiv⁢(E′) from Ψi⁢(E′) by removing the columns corresponding to Wi↝v⁢(E′). In other words, if Ψi⁢(E′)=Ψi⁢(F′), then E′,F′⊆E<i satisfy condition (#).

For Ψ=Ψi⁢(E′), let WiS↝⁢(Ψ) be the set of vertices in Wi that can be reached from S under Ψ, which is determined by the missing row indices of Ψ. Consider a graph Gi⁢(Ψ)≔(Wi∖WiS↝⁢(Ψ),Ei⁢(Ψ)), where Ei⁢(Ψ)≔{(u,x)∣u,x∈Wi∖WiS↝⁢(Ψ),Ψu⁢x=1}. In other words, when Ψ=Ψi⁢(E′), Gi⁢(Ψ) is the subgraph of the transitive closure of (V,E′) induced by Wi∖WiS↝⁢(Ψ). Then, we can prove the following.

Lemma 4.8.

Suppose Ψi⁢(E′)=Ψi⁢(F′)≕Ψ for E′,F′⊆E<i and v,w∈Wi∖WiS↝⁢(E′) are in the same SCC of Gi⁢(Ψ). Then, for any H⊆E≥i, S↝(V,E′∪H)v if and only if S↝(V,F′∪H)w.

Proof.

Fix H⊆E≥i. We can prove the equivalence of S↝(V,E′∪H)v and S↝(V,F′∪H)v from Ψi⁢(E′)=Ψi⁢(F′) with almost the same argument as that in the proof of Lemma 4.5. Since v and w are in the same SCC of Gi⁢(Ψ), v↝(V,F′)w and w↝(V,F′)v. Consequently, S↝(V,F′∪H)v indicates S↝(V,F′∪H)w and vice versa. This concludes S↝(V,E′∪H)v⇔S↝(V,F′∪H)w. ◀

4.2 New Decomposition and DP Formulas

Decomposition formula.

Using the equivalences described above, we derive a formula for Pr⁢(S↝v) using the STCs. Since we confirmed that Φiv⁢(E′) can be recovered from Ψi⁢(E′) when v∈Ai∪Wi, we can derive the decomposition formula (9). If v∈Wi, it can be further transformed. Based on Lemma 4.8, we can rewrite Pr⁢(S↝v∣Ψ) as Pr⁢(S↝CΨ⁢(v)∣Ψ), where CΨ⁢(v) is the SCC of Gi⁢(Ψ) containing v when v∉WiS↝⁢(Ψ). If v∈WiS↝⁢(Ψ), we immediately have Pr⁢(S↝v∣Ψ)=1. Now (9) can be further transformed into

Pr⁢(S↝v) =∑Ψ∈ℳi{Pr⁢(Ψ)(v∈WiS↝⁢(Ψ))Pr⁢(Ψ)⋅Pr⁢(S↝CΨ⁢(v)∣Ψ)(v∈Wi∖WiS↝⁢(Ψ)). (10)

If we can obtain Pr⁢(Ψ) and Pr⁢(S↝C∣Ψ) for every STC Ψ and every SCC C of Gi⁢(Ψ), we can compute every Pr⁢(S↝v) by choosing i such that v∈Wi and then use (10). Note that if all vertices have degree not less than 2, there must exist index i such that v∈Wi, since G contains no self-loops. The Pr⁢(S↝v) value for degree 1 vertices can be easily obtained; details are given in Section 4.3.

DP formulas.

Since TCs can be recovered from STCs and admit transition functions 𝗁𝗂v,𝗅𝗈v, STCs also admit transition functions 𝗅𝗈 and 𝗁𝗂 satisfying that, for any E′⊆E<i, 𝗅𝗈⁢(Ψi⁢(E′))=Ψi+1⁢(E′) and 𝗁𝗂⁢(Ψi⁢(E′))=Ψi+1⁢(E′∪{ei}). Here, we set 𝖿⁢(Ψ)=⊥ for 𝖿∈{𝗁𝗂,𝗅𝗈} when i≥iS and 𝖿⁢(Ψ)S⁢u=0 for any u, which confirms Pr⁢(S↝w∣𝖿⁢(Ψ))=0 for any further vertices w∈Wi+1∪Bi+1 (⊥-pruning). Now Pr⁢(Ψ) can be computed in the same manner as described in Section 3: From the definition of Pr⁢(Ψ) (Eq. (9)), we have the following.

Lemma 4.9.

For Ψ=Ψi⁢(E′) for some E′⊆E<i, we have

Pr⁢(Ψ)=pi⋅∑Ψ′∈ℳi−1′:𝗁𝗂⁢(Ψ′)=ΨPr⁢(Ψ′)+(1−pi)⋅∑Ψ′∈ℳi−1′:𝗅𝗈⁢(Ψ′)=ΨPr⁢(Ψ′), (11)

where ℳ1′≔{Ψ1⁢(∅)} and ℳi′≔(⋃Ψ∈ℳi−1′{𝗁𝗂⁢(Ψ),𝗅𝗈⁢(Ψ)})∖{⊥}, i.e., we remove pruned STCs from ℳi.

It remains to be explained how to compute Pr⁢(S↝C∣Ψ) for an SCC C of Gi⁢(Ψ). If there exists u∈C such that u∈Wi+1, we can decompose it using the case analysis of ei: If ei is present, Pr⁢(S↝C∣Ψ) equals Pr⁢(S↝C′∣𝗁𝗂⁢(Ψ)), where C′ is the SCC of Gi+1⁢(𝗁𝗂⁢(Ψ)) containing u. If ei is absent, Pr⁢(S↝C∣Ψ) equals Pr⁢(S↝C′′∣𝗅𝗈⁢(Ψ)), where C′′ is the SCC of Gi+1⁢(𝗅𝗈⁢(Ψ)) containing u. Here, the relation between C and C′,C′′ can be seen as the transition from C to successive SCCs C′,C′′. By considering the pruned cases, we formally define the successive SCCs as follows.

Definition 4.10.

For SCC C of Gi⁢(Ψ), we define successive SCC 𝖿⁢(C) for 𝖿∈{𝗅𝗈,𝗁𝗂} as follows. (i) If 𝖿=𝗁𝗂, and ei=(u,v) with u∈WiS↝⁢(Ψ)∪S and v∈C, 𝗁𝗂⁢(C)≔⊤, meaning that C can be reached from S by determining the presence of ei. (ii) If (i) does not hold and 𝖿⁢(Ψ)=⊥, 𝖿⁢(C)≔⊥, meaning that C cannot be reached from S. (iii) If neither (i) nor (ii) holds and there exists u∈C such that u∈Wi+1, 𝖿⁢(C)≔C𝖿⁢(Ψ)⁢(u). (iv) Otherwise, 𝖿⁢(C)≔∅, meaning that there is no successive SCC.

Lemma 4.11.

If there exists u∈C such that u∈Wi+1, i.e., successive SCCs exist, we can decompose Pr⁢(S↝C∣Ψ) for Ψ=Ψi⁢(E′) and SCC C of Gi⁢(Ψ) as follows:

Pr⁢(S↝C∣Ψ)=pei⋅Pr⁢(S↝𝗁𝗂⁢(C)∣𝗁𝗂⁢(Ψ))+(1−pei)⋅Pr⁢(S↝𝗅𝗈⁢(C)∣𝗅𝗈⁢(Ψ)). (12)

Note that if u∈Wi+1S↝⁢(𝗁𝗂⁢(Ψ)), since Pr⁢(S↝u∣𝗁𝗂⁢(Ψ))=1, we replace Pr⁢(S↝C𝗁𝗂⁢(Ψ)⁢(u)∣𝗁𝗂⁢(Ψ)) in the above formula with 1. This replacement is reflected in case (i) of Definition 4.10.

What can be done when such a vertex u does not exist? In this case, we attempt to use the original TC. We observe in Section 4.1 that if u∈Wi, we can recover Φ=Φiu⁢(E′) from Ψi⁢(E′) with an appropriate transformation. Thus, by fixing some u∈C and letting Φu be a TC recovered from STC Ψ, we have the following case analysis: If ei is present, Pr⁢(S↝C∣Ψ)=Pr⁢(S↝u∣Φu) equals Pr⁢(S↝u∣𝗁𝗂u⁢(Φu)). If ei is absent, Pr⁢(S↝C∣Ψ) equals Pr⁢(S↝u∣𝗅𝗈u⁢(Φu)). This leads to the following decomposition.

Lemma 4.12.

For Ψ=Ψi⁢(E′) and SCC C of Gi⁢(Ψ), suppose that successive SCCs do not exist. Let u∈C and Φu be a TC recovered from STC Ψ. Then,

Pr⁢(S↝C∣Ψ)=pei⋅Pr⁢(S↝u∣𝗁𝗂u⁢(Φu))+(1−pei)⋅Pr⁢(S↝u∣𝗅𝗈u⁢(Φu)). (13)

To compute the terms in the right-hand-side of (13), we can use the previous algorithm in Section 3. However, naively computing these terms for every u∈V requires O⁢(m⁢n⁢ωp2⋅2ωp2) time, since this amounts to constructing a diagram of the previous algorithm for every u.

To overcome this, we use Lemma 4.5. Since we only need to compute Pr⁢(S↝v∣Φv) for the case v∈Ai, we can share identical TCs, as in Observation 4.6. Accordingly, we do not need to construct different diagrams for every v to compute Pr⁢(S↝v∣Φv), that is, if identical TCs Φv and Φw from different v,w appear, we share them. This enables us to compute all Pr⁢(S↝v∣Φv)s in linear time.

4.3 Procedure

We formally describe the proposed method in Algorithm 2. Lines 1–6 construct the diagram of STCs Ψ. Ψ.𝖿 stores a pointer to 𝖿⁢(Ψ). We consider the successive SCCs in lines 7–11. If a successive SCC of C exists, C.𝖿 stores the pointer to it. Otherwise, following the approach of Section 4.2, we recover the original TC Φu, where u∈C, and then carry out transition 𝗅𝗈u or 𝗁𝗂u on it. Φu⁢(Ψ) recovers the original TC by removing every column x satisfying Ψx⁢u=1 from Ψ, that is, we remove columns whose indices can reach u. If a pruning occurs by considering Φ=𝖿u⁢(Φu⁢(Ψ)), C.𝖿 stores ⊥ or ⊤. Otherwise, C.𝖿 stores a pointer to 𝖼𝗁𝖺𝗇𝗀𝖾t⁢(Φ), where 𝖼𝗁𝖺𝗇𝗀𝖾t⁢(⋅) changes the column index u to t. Here, t is an imaginary vertex that is assumed to be contained within Ai. Since Observation 4.6 confirms that the transitions of identical TCs are identical, we standardize the column index u by changing it to t. We build a diagram of Φit⁢(⋅) in Lines 12–15.

Lines 17–19 compute p⁢[Ψ]=Pr⁢(Ψ) for every Ψ∈ℳi′ in the same manner as Algorithm 1, and lines 20–22 compute q⁢[Φ]=Pr⁢(S↝t∣Φ) for every Φ∈𝒩i′ in a bottom-up manner. Lines 23–26 compute r⁢[Ψ,C]=Pr⁢(S↝C∣Ψ) for every Ψ and every SCC C of Gi⁢(Ψ). Here, ⟨c⁢ ? ⁢x⁢ : ⁢y⟩ stands for a conditional operator that returns x if c is satisfied or y otherwise. When C.𝖿 is either an original TC Φt or ⊥,⊤, we use the q value; otherwise, we use the r value. Finally, lines 27–31 compute every res⁢[v]=Pr⁢(S↝v) using (10).

Algorithm 2 Proposed algorithm for computing Pr⁢(S↝v) for every v.

Here, we confirm the correctness of Algorithm 2.

Lemma 4.13.

After executing Algorithm 2, res⁢[v] equals Pr⁢(S↝v).

Proof.

First, we confirm p⁢[Ψ]=Pr⁢(Ψ). Starting from p⁢[Ψ1⁢(∅)]=Pr⁢(Ψ1⁢(∅))=1 for Ψ1⁢(∅)∈ℳ1′, lines 17–19 compute every Pr⁢(Ψ) value for ℳ2′,…,ℳm′ according to (11).

Second, we confirm q⁢[Φ]=Pr⁢(S↝t∣Φ), but this is much simpler; with the case analysis of whether ei is present or absent, we have

Pr⁢(S↝t∣Φ)=pi⋅Pr⁢(S↝t∣𝗁𝗂t⁢(Φ))+(1−pi)⋅Pr⁢(S↝t∣𝗅𝗈t⁢(Φ)). (14)

Starting from q⁢[⊥]=Pr⁢(S↝t∣⊥)=0 and q⁢[⊤]=Pr⁢(S↝t∣⊤)=1, lines 20–22 compute every Pr⁢(S↝t∣Φ) value for 𝒩m′,𝒩m−1′,… according to (14).

Third, we confirm r⁢[Ψ,C]=Pr⁢(S↝C∣Ψ). If there exists u∈C such that u∈Wi+1, i.e., a successive SCC exists, we can apply (12). Otherwise (i.e., a successive SCC does not exist), we can apply (13). Here, without considering the pruning, C.𝖿 stores a pointer to 𝖿⁢(C) if a successive SCC exists or, otherwise, to 𝖼𝗁𝖺𝗇𝗀𝖾t⁢(𝗅𝗈u⁢(Φu)). Consequently, lines 23–26 correctly compute r⁢[Ψ,C] according to (12) if a successive SCC exists or to (13) otherwise. For the latter case, we use Lemma 4.5; i.e., Pr⁢(S↝u∣𝗅𝗈u⁢(Φu))=Pr⁢(S↝t∣𝖼𝗁𝖺𝗇𝗀𝖾t⁢(𝗅𝗈u⁢(Φu)))=q⁢[𝖼𝗁𝖺𝗇𝗀𝖾t⁢(𝗅𝗈u⁢(Φu))].

Finally, by choosing i⋆ such that v∈Wi⋆, res⁢[v]=Pr⁢(S↝v) is correctly computed using (10) through lines 27–30. ◀

Treatment of degree 𝟏 vertices.

We finally describe how to deal with degree 1 vertices. By obtaining the Pr⁢(S↝v) values for all vertices with degree not less than 2, we can easily obtain the Pr⁢(S↝v) values for degree 1 vertices. Let v∈V∖S be a vertex whose degree is 1. Let ev be the unique edge incident to v. If ev=(v,w) for some w∈V, i.e., v is the tail of ev, we have Pr⁢(S↝v)=0 because v has no incoming edges. Otherwise (i.e., v is the head of ev), we have Pr⁢(S↝v)=pev⋅Pr⁢(S↝w) because every path from some s∈S to v must go through w, thus ev. Since G is connected and thus w has degree at least 2 except for the trivial case where ev is the only edge of G, we can obtain Pr⁢(S↝v) for v whose degree is 1 from the value of Pr⁢(S↝w).

4.4 Complexity

To analyze the complexity, we again use ω=maxi⁡|Wi|. First, we consider the diagram construction. The key lemma is as follows.

Lemma 4.14.

Given Φ=Φiv⁢(E′) for some E′⊆E<i, we can compute the transitions 𝗅𝗈v⁢(Φ) and 𝗁𝗂v⁢(Φ) in O⁢((|Wi|+|Wi+1|)2) time. Similarly, given Ψ=Ψi⁢(E′) for some E′⊆E<i, we can also compute 𝗅𝗈⁢(Ψ) and 𝗁𝗂⁢(Ψ) in O⁢((|Wi|+|Wi+1|)2) time.

The full proof is deferred to the full version; here, we describe the ideas for computing transitions. For TC Φ, we build a graph G⋆=(Wi∪{S,v},E⋆), where S is regarded as an individual special vertex and E⋆={(u,w)∣Φu⁢w=1}. By adding and removing edges and vertices according to the transition and computing the transitive closure, we can obtain the updated graph, whose adjacency matrix constitutes 𝗁𝗂⁢(Φ) or 𝗅𝗈⁢(Φ). The transition of STC Ψ can be computed in very similar way.

Similar to Φiv, we can compute the transition 𝗅𝗈,𝗁𝗂 of Ψ in O⁢(ω2) by recomputing the transitive closure. Note that we can also compute the SCCs and their successive SCCs within this process, as described in the proof of Lemma 4.14. Thus, the total time for diagram construction is bounded by O⁢(ω2)⋅O⁢(∑i(|ℳi|+|𝒩i|)) time. Here, we can bound the number of possible patterns on Φiv and Ψi, i.e., |𝒩i| and |ℳi|, as follows. Since the proofs of Lemmas 4.15 and 4.16 are much similar; the proof of Lemma 4.16 is put on the full version.

Lemma 4.15.

|ℳi|=|{Φiv⁢(E′)∣E′⊆E<i}| is bounded by O⁢(2|Wi|2).

Proof.

If we fix WiS↝⁢(E′) and Wi↝v⁢(E′), some entries of Φiv⁢(E′) are determined as follows: Φiv⁢(E′)S⁢w=1 if w∈WiS↝⁢(E′) or 0 if w∈Wi∖WiS↝⁢(E′), and Φiv⁢(E′)u⁢v=1 if u∈Wi↝v⁢(E′) or 0 if u∈Wi∖Wi↝v⁢(E′). Therefore, the possible patterns on Φiv⁢(E′) is bounded by O⁢(2(|Wi|−|WiS↝⁢(E′)|)⁢(|Wi|−|Wi↝v⁢(E′)|)) because Φiv⁢(E′) is a binary matrix of size (|Wi|−|WiS↝⁢(E′)|+1)×(|Wi|−|Wi↝v⁢(E′)|+1), and the entries of one row and one column are already determined.

We conduct a case analysis of k=|WiS↝⁢(E′)|+|Wi↝v⁢(E′)| when fixing WiS↝⁢(E′) and Wi↝v⁢(E′). When k=0, the bound is O⁢(2|Wi|2). When k=1, the bound is O⁢(2|Wi|2−|Wi|), and the number of patterns on (WiS↝⁢(E′),Wi↝v⁢(E′)) is bounded by O⁢(|Wi|). When k≥2, since (|Wi|−|WiS↝⁢(E′)|)⁢(|Wi|−|Wi↝v⁢(E′)|)≤(|Wi|−1)⁢(|Wi|−1)=|Wi|2−2⁢|Wi|+1 (supposing that |Wi|≥3), the number of possible patterns is bounded by O⁢(2|Wi|2−2⁢|Wi|). The number of possible patterns on (WiS↝⁢(E′),Wi↝v⁢(E′)) is bounded by 2|Wi|⋅2|Wi| because WiS↝,Wi↝v⊆Wi. Thus, the total number of patterns on Φiv⁢(E′) is bounded by O⁢(2|Wi|2)+O⁢(|Wi|⋅2|Wi|2−|Wi|)+O⁢(22⁢|Wi|)⋅O⁢(2|Wi|2−2⁢|Wi|)=O⁢(2|Wi|2)+O⁢(2|Wi|2+log⁡|Wi|−|Wi|)+O⁢(2|Wi|2)=O⁢(2|Wi|2). ◀

Lemma 4.16.

|𝒩i|=|{Ψi⁢(E′)∣E′⊆E<i}| is bounded by O⁢(2|Wi|2).

Therefore, |ℳi|=|𝒩i|=O⁢(2ω2), and the total time complexity for diagram construction can be bounded by O⁢(m⁢ω2⋅2ω2).

Next, we consider the DP. Each value can be computed in constant time. The number of values to compute for Ψi and Φiv is bounded by O⁢(|ℳi|+|Wi|⁢|ℳi|+|𝒩i|)=O⁢(ω⋅2ω2+2ω2)=O⁢(ω⋅2ω2). Thus, the total complexity is O⁢(m⁢ω⋅2ω2).

Finally, computing each Pr⁢(S↝v) using (10) requires O⁢(|ℳi|)=O⁢(2ω2) time. Thus, it needs O⁢(n⋅2ω2) time in total for all Pr⁢(S↝v) values.

Proposition 4.17.

Given directed graph G, seed set S, each edge’s probability pe of presence, and the edge ordering e1,…,em, the probability Pr⁢(S↝v) for every vertex v can be computed in O⁢((m+n)⋅ω2⋅2ω2) time in total.

Since we can generate an edge ordering with ω≤ωp from a path decomposition of width ωp [9] in linear time, we achieve Theorem 1.2. Moreover, with the linear-time path-decomposition algorithm for a bounded-pathwidth graph [2], we have the following.

Theorem 4.18.

Given directed graph G, seed set S, and each edge’s probability pe of presence, suppose that G’s pathwidth is bounded by a constant. Then, Pr⁢(S↝v) for every vertex v can be computed in O⁢(m+n) time in total.

The previous algorithm [15] requires O⁢(m⁢ω2⋅2ω2) time for computing Pr⁢(S↝v), as discussed in Section 3. Thus, it takes O⁢(n⁢m⁢ω2⋅2ω2) time for computing σ⁢(S). In contrast, the proposed algorithm takes O⁢((n+m)⁢ω2⋅2ω2) time. Therefore, in terms of time complexity, our algorithm reduces the dependence on the graph size from O⁢(m⁢n) to O⁢(m+n) while the dependence on ω=maxi⁡|Wi| is kept the same.

5 Discussion

Here, we point out the differences between the proposed algorithm and the existing algorithm that computes the probability of connection for undirected graphs [16]. These algorithms basically share the same idea: In computing the probability of reachability (or connectivity in the undirected graphs) of every vertex, the previous top-down style algorithms, like that in Section 3, generate similar diagrams for different vertices v, so they attempt to share equivalent structures. The algorithm for undirected graphs uses connected components (CCs) among frontier vertices to efficiently compute the conditional probabilities, similar to Pr⁢(S↝C∣Ψ) in our algorithm. The difference comes from the computation of conditional probability when a successive SCC or CC does not exist. In undirected graphs, if a successive CC does not exist, the current CC is disconnected from any further vertex, so we immediately have the conditional probability 0 (or 1 in an exceptional case). In contrast, in directed graphs, even if a successive SCC does not exist, the current SCC may still reach or be reached from further vertices because it can reach or be reached from the frontier vertices. This makes the computation of the conditional probabilities difficult because we cannot immediately determine them when no successive SCC exists. We resolve this issue by focusing on the equivalence of lower levels of diagrams (Lemma 4.5). This enables us to compute the conditional probabilities using a constant number of diagrams (STCs Ψ and TCs Φt of imaginary vertex t) without breaking the linear complexity.

6 Conclusion

We proposed an algorithm for computing the influence spread under IC model exactly in O⁢((m+n)⁢ωp2⋅2ωp2) time. For graphs with bounded pathwidth ωp, we improved the complexity from O⁢(m⁢n) to O⁢(m+n), linear in the graph size, while the dependence on the pathwidth ωp is kept the same.

Finally, we mention some future directions. First, a more efficient exact evaluation of influence spread, suitable for the greedy algorithm [10], should be investigated. Chen et al. [4] developed an algorithm that simultaneously approximates σ⁢(S∪{v})−σ⁢(S) for all v∈V∖S, which corresponds to one iteration of the greedy algorithm. Nakamura et al. [17] developed an algorithm for undirected graphs that exactly and simultaneously computes the expected number of connected vertices for all vertices. This algorithm is promising for adoption with directed graphs as a way to simultaneously compute σ⁢(S∪{v}) for all v∈V∖S exactly. Second, we should investigate whether a linear time algorithm for computing σ⁢(S) is possible for graphs with bounded treewidth. A roadmap for achieving this may be to fit the diagram construction method based on tree decomposition [1] to the computation of influence spread and then observe the equivalences. However, such an improvement may not be straightforward due to the complicated nature of these algorithms.

References

  • [1] Antoine Amarilli, Pierre Bourhis, Louis Jachiet, and Stefan Mengel. A circuit-based approach to efficient enumeration. In Proc. of the 44th International Colloquium on Automata, Languages, and Programming (ICALP 2017), pages 111:1–111:15, 2017. doi:10.4230/LIPIcs.ICALP.2017.111.
  • [2] Hans L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM Journal on Computing, 25(6):1305–1317, 1996. doi:10.1137/S0097539793251219.
  • [3] Wei Chen, Chi Wang, and Yajun Wang. Scalable influence maximization for prevalent viral marketing in large-scale social networks. In Proc. of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2010), pages 1029–1038, 2010. doi:10.1145/1835804.1835934.
  • [4] Wei Chen, Yajun Wang, and Siyu Yang. Efficient influence maximization in social networks. In Proc. of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2009), pages 199–208, 2009. doi:10.1145/1557019.1557047.
  • [5] Pedro Domingos and Matt Richardson. Mining the network value of customers. In Proc. of the 7th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2001), pages 57–66, 2001. doi:10.1145/502512.502525.
  • [6] Jacob Goldenberg, Barak Libai, and Eitan Muller. Talk of the network: A complex systems look at the underlying process of word-of-mouth. Marketing Letters, 12:211–223, 2001. doi:10.1023/A:1011122126881.
  • [7] Amit Goyal, Wei Lu, and Laks V.S. Lakshmanan. CELF++: optimizing the greedy algorithm for influence maximization in social networks. In Proc. of the 20th International Conference Companion on World Wide Web (WWW 2011), pages 47–48, 2011. doi:10.1145/1963192.1963217.
  • [8] Gary Hardy, Corinne Lucet, and Nikolaos Limnios. K-terminal network reliability measures with binary decision diagrams. IEEE Transactions on Reliability, 56(3):506–515, 2007. doi:10.1109/TR.2007.898572.
  • [9] Yuma Inoue and Shin-ichi Minato. Acceleration of ZDD construction for subgraph enumeration via pathwidth optimization. Technical Report TCS-TR-A-16-80, Division of Computer Science, Hokkaido University, 2016.
  • [10] David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a social network. In Proc. of the 9th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2003), pages 137–146, 2003. doi:10.1145/956750.956769.
  • [11] Jure Leskovec, Andreas Krause, Carlos Guestrin, Christos Faloutsos, Jeanne VanBriesen, and Natalie Glance. Cost-effective outbreak detection in networks. In Proc. of the 13th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2007), pages 420–429, 2007. doi:10.1145/1281192.1281239.
  • [12] Yuchen Li, Ju Fan, Yanhao Wang, and Kian-Lee Tan. Influence maximization on social graphs: A survey. IEEE Transactions on Knowledge and Data Engineering, 30(10):1852–1872, 2018. doi:10.1109/TKDE.2018.2807843.
  • [13] Yuchen Li, Dongxiang Zhang, and Kian-Lee Tan. Real-time targeted influence maximization for online advertisements. Proc. of the VLDB Endowment, pages 1070–1081, 2015. doi:10.14778/2794367.2794376.
  • [14] Chen Ling, Junji Jiang, Junxiang Wang, My T. Thai, Renhao Xue, James Song, Meikang Qiu, and Liang Zhao. Deep graph representation learning and optimization for influence maximization. In Proc. of the 40th International Conference on Machine Learning (ICML 2023), volume 202 of Proceedings of Machine Learning Research, pages 21350–21361, 2023. URL: https://proceedings.mlr.press/v202/ling23b.html.
  • [15] Takanori Maehara, Hirofumi Suzuki, and Masakazu Ishihata. Exact computation of influence spread by binary decision diagrams. In Proc. of the 26th International Conference on World Wide Web (WWW 2017), pages 947–956, 2017. doi:10.1145/3038912.3052567.
  • [16] Kengo Nakamura, Takeru Inoue, Masaaki Nishino, and Norihito Yasuda. Efficient network reliability evaluation for client-server model. In Proc. of the 2021 IEEE Global Communications Conference (GLOBECOM 2021), pages 1–6, 2021. doi:10.1109/GLOBECOM46510.2021.9685283.
  • [17] Kengo Nakamura, Takeru Inoue, Masaaki Nishino, Norihito Yasuda, and Shin-ichi Minato. A fast and exact evaluation algorithm for the expected number of connected nodes: an enhanced network reliability measure. In Proc. of the 2023 IEEE International Conference on Computer Communications (INFOCOM 2023), pages 1–10, 2023. doi:10.1109/INFOCOM53939.2023.10228897.
  • [18] Naoto Ohsaka, Takuya Akiba, Yuichi Yoshida, and Ken-ichi Kawarabayashi. Fast and accurate influence maximization on large networks with pruned monte-carlo simulations. In Proc. of the 28th AAAI Conference on Artificial Intelligence (AAAI 2014), pages 138–144, 2014. doi:10.1609/aaai.v28i1.8726.
  • [19] Shashank Sheshar Singh, Divya Srivastva, Madhushi Verma, and Jagendra Singh. Influence maximization frameworks, performance, challenges and directions on social network: A theoretical study. Journal of King Saud University - Computer and Information Sciences, 34(9):7570–7603, 2022. doi:10.1016/j.jksuci.2021.08.009.
  • [20] Hirofumi Suzuki, Masakazu Ishihata, and Shin-ichi Minato. Exact computation of strongly connected reliability by binary decision diagrams. In Proc. of the 12th International Conference on Combinatorial Optimization and Applications (COCOA 2018), pages 281–295, 2018. doi:10.1007/978-3-030-04651-4_19.
  • [21] Robert Tarjan. Depth-first search and linear graph algorithms. SIAM Journal on Computing, 1(2):146–160, 1972. doi:10.1137/0201010.
  • [22] Leslie G. Valiant. The complexity of enumeration and reliability problems. SIAM Journal on Computing, 8(3):410–421, 1979. doi:10.1137/0208032.
  • [23] Peng Wu and Li Pan. Scalable influence blocking maximization in social networks under competitive independent cascade models. Computer Networks, 123:38–50, 2017. doi:10.1016/j.comnet.2017.05.004.
  • [24] Mao Ye, Xingjie Liu, and Wang-Chien Lee. Exploring social influence for recommendation: a generative model approach. In Proc. of the 35th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2012), pages 671–680, 2012. doi:10.1145/2348283.2348373.