arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:2609.19960v1 [cs.DS] 17 Sep 2026

Exact Greedy Influence Maximization in Linear Time
on Bounded-Treewidth Graphs

Matic Požar Affiliation: UP FAMNIT, University of Primorska Affiliation: Koper, Slovenia Email: matic.pozar@upr.si
Abstract

Computing influence spread under the Independent Cascade (IC) model is #P-hard in general, and influence maximization is therefore commonly approached using Monte Carlo simulation or reverse-reachable-set sampling.

We study IC diffusion on graphs of bounded treewidth. Prior work on probabilistic reachability and provenance establishes the tractability of exact probabilistic reachability on bounded-treewidth instances. We give an explicit IC formulation based on probability distributions over separator reachability relations, yielding exact influence evaluation in

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

time, for a graph with nn nodes and treewidth ww.

Our main contribution is an exact all-marginal-gains algorithm. We introduce variable artificial source edges whose probabilities parameterize potential seed selection and show that, at a deterministic seed set, the partial derivative with respect to each source-edge probability is exactly the corresponding greedy marginal gain. Reverse-mode differentiation through the exact inference computation therefore obtains all node marginal gains simultaneously, with the same asymptotic complexity as one exact influence evaluation.

This yields an exact implementation of the classical greedy influence maximization algorithm in

O⁡(K​n​ 2O⁡(w2)​poly⁡(w))O\!\left(Kn\,2^{O(w^{2})}\operatorname{poly}(w)\right)

time, which is linear in graph size for fixed treewidth ww and seed budget KK. We further show that the separator-relation representation has tight 2Θ⁡(w2)2^{\Theta(w^{2})} state complexity within the class of exact context-independent compositional separator summaries. This tractability of exact greedy optimization contrasts with the NP-hardness of globally optimal IC influence maximization already on graphs of treewidth one and pathwidth two.

Experiments on synthetic bounded-treewidth networks are consistent with the predicted linear scaling in graph size for fixed width and show that the runtime is largely insensitive to the numerical propagation and seed-activation probabilities. In demanding diffusion regimes, the proposed method substantially outperforms reverse-reachable-set and optimized Monte Carlo greedy baselines while computing the classical greedy marginal gains exactly.

1 Introduction

The Influence Maximization (IM) problem [9] asks for a set of at most KK seed vertices whose initial activation maximizes the expected extent of a subsequent diffusion process. One of the most widely studied diffusion models is the Independent Cascade (IC) model. Influence maximization under IC is NP-hard, while exactly computing the expected influence spread of a fixed seed set is itself #P-hard [5].

Consequently, practical IM algorithms generally rely on approximate influence evaluation or randomized sampling. A classical approach is Monte Carlo (MC) simulation of the diffusion process. However, greedy influence maximization requires repeated influence evaluations for many candidate vertices, making straightforward MC-based optimization expensive even when the number of evaluations is reduced through lazy submodular techniques such as CELF [10].

A major improvement is obtained through reverse-reachable (RR) set sampling. Algorithms such as TIM/TIM+ [17] and IMM [16] provide strong approximation guarantees together with near-linear theoretical running times. Their practical computational requirements, however, remain sampling-dependent and can vary substantially across diffusion regimes and target accuracy levels.

An alternative source of tractability is structural restriction of the underlying graph. Many graph problems that are intractable in general become efficiently solvable when the treewidth [8] of the input graph is bounded [2, 4]. We denote the treewidth by ww.

Relatively little work has examined the consequences of bounded treewidth for IC influence maximization. Influence maximization on trees admits an FPTAS [3]; the same work notes that the approach can be extended to bounded-treewidth graphs, although at a substantial increase in complexity, without developing this extension further. More recently, exact IC influence spread has been shown to be computable in linear time on graphs of bounded pathwidth  [12].

Closely related results also arise in probabilistic databases and provenance. Under the live-edge interpretation of IC, every directed edge can be viewed as an independently present probabilistic tuple, and the activation probability of a vertex becomes a probabilistic reachability query. General bounded-treewidth probabilistic-query machinery therefore provides exact structural inference for such queries, while recent provenance systems additionally implement shared all-target reachability compilation on bounded-treewidth instances [15]. These results suggest that exact IC influence evaluation on bounded-treewidth graphs should be viewed as an instance of a broader class of tractable probabilistic-reachability problems.

This paper asks a different question: what does this structural tractability of exact influence evaluation imply for influence maximization itself? Our main observation is that exact evaluation of a single influence function can be extended to provide all greedy marginal gains simultaneously. By introducing variable artificial source edges and differentiating the resulting exact inference computation, the marginal gain of every possible new seed is recovered from a single reverse pass.

The main contributions are as follows:

  1. 1.

    We give an explicit exact IC inference formulation for bounded-treewidth graphs using probability distributions over transitively closed separator reachability relations.

  2. 2.

    We show that exact influence evaluation and all vertex activation marginals can be computed in

    O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

    arithmetic operations.

  3. 3.

    We introduce source-edge variables θv\theta_{v} and prove that, for every v∉Sv\notin S,

    ∂F∂θv​(𝟏S)=σ⁡(S∪{v})−σ⁡(S),\frac{\partial F}{\partial\theta_{v}}(\mathbf{1}_{S})=\sigma(S\cup\{v\})-\sigma(S),

    where FF is a differentiable function that computes the exact IC diffusion in bounded treewidth graphs. Reverse-mode differentiation therefore computes all exact greedy marginal gains simultaneously within the same asymptotic complexity as one exact influence evaluation.

  4. 4.

    We obtain an exact implementation of classical greedy IM with running time

    O⁡(K​n​ 2O⁡(w2)​poly⁡(w)).O\!\left(Kn\,2^{O(w^{2})}\operatorname{poly}(w)\right).

    Hence, for fixed treewidth ww and seed budget KK, exact greedy IM is linear in the graph size.

  5. 5.

    We show that the separator-relation representation has 2Θ⁡(w2)2^{\Theta(w^{2})} worst-case state complexity within the class of exact context-independent compositional separator summaries.

  6. 6.

    We experimentally compare the proposed method with IMM and a directed NewGreedy/Cohen-style all-gains Monte Carlo baseline, studying both scaling in graph size and sensitivity to stochastic diffusion parameters.

2 Preliminaries and Related Work

2.1 Independent Cascade Model

Let G=(V,E)G=(V,E) be a simple directed graph with n=|V|n=|V|. Each edge e=(u,v)∈Ee=(u,v)\in E is associated with an independent propagation probability pe∈[0,1],p_{e}\in[0,1], which represents the probability with which newly active nodes activate their inactive neighbors.

Given a seed set S⊆VS\subseteq V, the Independent Cascade process starts with all vertices of SS active. Then the diffusion proceeds in discrete steps. Whenever uu becomes active at time tt, it gets one independent opportunity to activate each currently inactive out-neighbor vv with probability pu​vp_{uv}. Successfully activated neighbors then attempt to activate their own inactive out-neighbors at time t+1t+1. The process terminates when no new activations occur.

What is of interest is not any particular unfolding of the IC, but rather the probability with which each node is activated. Let σ⁡(S)\sigma(S) denote the expected number of activated vertices, which equals the sum of activation probabilities of all the nodes.

2.2 Live-Edge Representation

The IC model, and more generally triggering models [9, 14], admits an equivalent live-edge formulation. Since all the influence attempts are independent, each edge ee can be regarded as live with probability pep_{e} and dead with probability 1−pe1-p_{e}. A vertex vv is activated by seed set SS iff it is reachable from SS in the resulting live-edge graph.

Thus

ℙ⁡(v​ active∣S)=ℙ⁡(S↝v).\mathbb{P}(v\text{ active}\mid S)=\mathbb{P}(S\rightsquigarrow v).

This equivalence turns IC inference into probabilistic reachability.

2.3 Influence Maximization

The influence maximization problem asks for

S⋆∈arg⁡maxS⊆V,|S|≤K⁡σ⁡(S).S^{\star}\in\arg\max_{S\subseteq V,\ |S|\leq K}\sigma(S).

For IC, σ\sigma is monotone and submodular. Therefore the classical greedy algorithm, which repeatedly selects the node with maximum marginal gain, Δ⁡(v∣S)=σ⁡(S∪{v})−σ⁡(S),\Delta(v\mid S)=\sigma(S\cup\{v\})-\sigma(S), achieves the approximation guarantee

σ⁡(Sgreedy)≥(1−1e)​σ​(S⋆).\sigma(S_{\mathrm{greedy}})\geq\left(1-\frac{1}{e}\right)\sigma(S^{\star}).

The difficulty is that exact marginal evaluation is itself computationally expensive in general graphs.

2.4 Tree Decompositions

Definition 2.1 (Tree decomposition).

A tree decomposition of an undirected graph GG is a pair

(𝒯,{Bt}t∈V⁡(𝒯))(\mathcal{T},\{B_{t}\}_{t\in V(\mathcal{T})})

where each Bt⊆V⁡(G)B_{t}\subseteq V(G) is a bag satisfying:

  1. 1.

    every vertex occurs in at least one bag;

  2. 2.

    every edge has both endpoints in at least one bag;

  3. 3.

    the bags containing any fixed vertex form a connected subtree of 𝒯\mathcal{T}.

The width of a decomposition is

maxt⁡|Bt|−1,\max_{t}|B_{t}|-1,

and the treewidth tw⁡(G)\operatorname{tw}(G) is the minimum width over all tree decompositions.

For directed graphs we use the treewidth of the underlying undirected graph.

2.5 Relation to Probabilistic Databases

The live-edge interpretation of the Independent Cascade model is closely related to tuple-independent probabilistic databases. In a tuple-independent database, every input fact is present independently with an associated probability. Hence, representing every directed edge (u,v)(u,v) as an uncertain tuple whose presence probability is pu​vp_{uv} produces exactly the same distribution over possible graphs as the live-edge formulation of the Independent Cascade model. Under this correspondence, the activation probability of a vertex vv from a seed set SS is the probability of the recursive reachability query S↝vS\rightsquigarrow v.

Probabilistic query evaluation is generally #P-hard, but structural restrictions on the underlying data can make it tractable. Amarilli, Bourhis, and Senellart [1] showed that, for fixed logical queries on instances of bounded treewidth, provenance circuits can be constructed in time linear in the size of the instance, yielding tractable exact probabilistic query evaluation on treelike instances. In particular, directed probabilistic reachability can therefore be computed exactly in linear time for fixed treewidth.

This connection is implemented explicitly in the recent ProvSQL [15] system, whose bounded-treewidth reachability compiler constructs reachability provenance along a tree decomposition of the probabilistic graph 11 1 provSQL Probabilities documentation page.. The current implementation additionally supports an all-target compilation in which the reachability events of all vertices share a single linear-size circuit for fixed treewidth.

In the influence-maximization literature, Nakamura and Nishino [12] independently considered the more restrictive bounded-pathwidth setting and showed that all activation probabilities, and hence the complete IC influence spread, can be computed exactly in O⁡((m+n)​ωp2​2ωp2)O\!\left((m+n)\omega_{p}^{2}2^{\omega_{p}^{2}}\right) time. Our construction can be viewed as a tree-decomposition formulation of the same underlying structural principle: a subgraph can be summarized, with respect to the rest of the graph, by its reachability behavior on a bounded-size separator. Our subsequent contribution is not the tractability of bounded-treewidth probabilistic reachability itself, but the use of this exact inference structure to compute all greedy influence-maximization marginal gains simultaneously.

We use this existing structural inference principle as the foundation for the influence-maximization results developed below.

3 Exact IC Inference on Bounded-Treewidth Graphs

In this section, the graphs in question are considered to be simple.

3.1 Separator Reachability Relations

Consider an oriented tree-decomposition edge x→yx\to y with separator Cx​y=Bx∩By.C_{xy}=B_{x}\cap B_{y}.

For a fixed live-edge realization on the xx-side of the decomposition edge, define a relation Rx→y⊆Cx​y×Cx​yR_{x\to y}\subseteq C_{xy}\times C_{xy} by (u,v)∈Rx→y⇔u↝v(u,v)\in R_{x\to y}\iff u\rightsquigarrow v using only vertices and edges on the xx-side.

Lemma 3.1 (Separator sufficiency).

Let HH be a directed graph component whose only intersection with the remainder of the graph is a separator CC. For a fixed realization of HH, let

RH={(u,v)∈C×C:u↝Hv}.R_{H}=\{(u,v)\in C\times C:u\rightsquigarrow_{H}v\}.

Replacing HH by directed arcs representing RHR_{H} preserves all reachability relations among vertices outside HH and vertices of CC.

Proof.

Any path entering HH can be decomposed into maximal excursions from a separator vertex u∈Cu\in C to a separator vertex v∈Cv\in C. Each such excursion can be replaced by the relation arc (u,v)(u,v).

Conversely, replacing HH by RHR_{H} introduces no new reachability. Every relation arc (u,v)∈RH(u,v)\in R_{H} exists only because there is a directed path from uu to vv inside HH. Hence any path in the compressed graph can be converted into a path in the original graph by replacing each relation arc by its witnessing path in HH. ∎

3.2 Probabilistic Messages

Because the IC live edges are random, a directed decomposition message is a probability distribution over separator reachability relations. For a directed decomposition edge x→yx\to y, let Cx​y=Bx∩ByC_{xy}=B_{x}\cap B_{y} be the corresponding separator. We define

Mx→y​(R)=ℙ⁡(Rx→y=R),M_{x\to y}(R)=\mathbb{P}(R_{x\to y}=R),

where Rx→yR_{x\to y} is the reachability relation induced on Cx​yC_{xy} by the part of the graph represented on the xx-side of the decomposition edge x,y{x,y}.

For a bag xx, let Pxloc​(R)P_{x}^{\mathrm{loc}}(R) denote the probability that the uncertain edges owned locally by xx induce the reachability relation R⊆Bx×Bx.R\subseteq B_{x}\times B_{x}.

Unique ownership of uncertain edges.

Every uncertain graph edge is assigned to exactly one bag containing both of its endpoints, and the corresponding live-edge variable is sampled only at this owning bag. This convention is necessary because the same graph edge may occur in several bags of a tree decomposition. Sampling it independently at every such occurrence would incorrectly replace one IC activation attempt by several independent random events.

Unique ownership partitions the uncertain edge variables among the bags. Consequently, after removing a decomposition node xx, the edge variables owned in distinct incident branches are disjoint from one another and from those owned locally by xx. Since IC live-edge variables are independent, the random relation produced by each branch is therefore independent of the local relation and of the relations produced by the other branches before they are combined at xx.

This independence is what allows the probability of a fixed tuple of relation states to factor as a product.

Message recursion.

Consider a directed decomposition edge x→yx\to y, and let

z1,…,zd=N𝒯​(x)∖{y}z_{1},\ldots,z_{d}=N_{\mathcal{T}}(x)\setminus\{y\}

be the neighbors of xx other than yy.

Suppose the local state is RxlocR_{x}^{\mathrm{loc}}, and the incoming branches induce states R1,…,Rd.R_{1},\ldots,R_{d}. For this fixed tuple, define the outgoing separator relation by their transitive closure restricted to Cx​y×Cx​yC_{xy}\times C_{xy} as

Ψx→y​(Rxloc,R1,…,Rd)=TC⁡(Rxloc∪R1∪⋯∪Rd)|Cx​y×Cx​y.\Psi_{x\to y}(R_{x}^{\mathrm{loc}},R_{1},\ldots,R_{d})=\left.\operatorname{TC}\left(R_{x}^{\mathrm{loc}}\cup R_{1}\cup\cdots\cup R_{d}\right)\right|_{C_{xy}\times C_{xy}}.

Note that the relations are aggregated with the TC\operatorname{TC} operation, since the individual reachability information of each relation may imply new reachability states not present in their union.

The probability of this tuple is

Pxloc​(Rxloc)​∏i=1dMzi→x​(Ri),P_{x}^{\mathrm{loc}}(R_{x}^{\mathrm{loc}})\prod_{i=1}^{d}M_{z_{i}\to x}(R_{i}),

because the corresponding edge-variable sets are disjoint and independent. Here Pxloc​(Rxloc)P_{x}^{\mathrm{loc}}(R_{x}^{\mathrm{loc}}) denotes the locally computed probability of relation RxlocR_{x}^{\mathrm{loc}}.

Different tuples may produce the same outgoing relation. Their probability masses are therefore accumulated, giving the recursion

Mx→y(R)=∑Rxloc,R1,…,Rd:Ψx→y​(Rxloc,R1,…,Rd)=RPxloc(Rxloc)∏i=1dMzi→x(Ri).\boxed{M_{x\to y}(R)=\sum_{\begin{subarray}{c}R_{x}^{\mathrm{loc}},R_{1},\ldots,R_{d}:\\ \Psi_{x\to y}(R_{x}^{\mathrm{loc}},R_{1},\ldots,R_{d})=R\end{subarray}}P_{x}^{\mathrm{loc}}(R_{x}^{\mathrm{loc}})\prod_{i=1}^{d}M_{z_{i}\to x}(R_{i}).}

Thus the relation operation Ψx→y\Psi_{x\to y} determines which outgoing state receives each contribution, while the product of the local and incoming message probabilities determines the mass of that contribution.

Lemma 3.2 (Exactness of the message recursion).

Consider a directed decomposition edge x→yx\to y. Remove the decomposition edge x,y{x,y}, and let 𝒯x→y\mathcal{T}_{x\to y} denote the component containing xx. Assume that every uncertain graph edge has exactly one owning bag and is sampled only at that bag.

Then, for every relation R⊆Cx​y×Cx​y,R\subseteq C_{xy}\times C_{xy}, the message recursion computes exactly the probability that the edges whose owners lie in 𝒯x→y\mathcal{T}_{x\to y} induce relation RR on Cx​yC_{xy}:

Mx→y​(R)=ℙ⁡(Rx→y=R).M_{x\to y}(R)=\mathbb{P}(R_{x\to y}=R).
Proof.

We prove the claim by induction on the number of bags in 𝒯x→y\mathcal{T}_{x\to y}.

Let z1,…,zd=N𝒯​(x)∖{y}.z_{1},\ldots,z_{d}=N_{\mathcal{T}}(x)\setminus\{y\}. By the induction hypothesis, each incoming message Mzi→xM_{z_{i}\to x} is the exact distribution of the separator relation induced by the corresponding branch.

Fix one realization of the uncertain edges on the xx-side, and let Rxloc,R1,…,RdR_{x}^{\mathrm{loc}},R_{1},\ldots,R_{d} be the resulting local and incoming relation states. By Lemma 3.1, each incoming branch may be replaced by its separator relation without changing reachability outside that branch. Hence the relation induced on the outgoing separator is exactly

Ψx→y​(Rxloc,R1,…,Rd).\Psi_{x\to y}(R_{x}^{\mathrm{loc}},R_{1},\ldots,R_{d}).

By unique edge ownership, the local edge variables and those belonging to the incoming branches are disjoint. Their relation states are therefore independent, so the probability of the fixed tuple is

Pxloc​(Rxloc)​∏i=1dMzi→x​(Ri).P_{x}^{\mathrm{loc}}(R_{x}^{\mathrm{loc}})\prod_{i=1}^{d}M_{z_{i}\to x}(R_{i}).

The recursion sums these probabilities over exactly those tuples whose image under Ψx→y\Psi_{x\to y} is RR. Since these tuples partition the live-edge realizations inducing outgoing relation RR, the resulting sum is precisely

ℙ⁡(Rx→y=R).\mathbb{P}(R_{x\to y}=R).

For the base case, xx has no neighbor other than yy, so the outgoing message is obtained directly from the local relation distribution by transitive closure and restriction to Cx​yC_{xy}. ∎

3.3 Upward and Downward Message Passing

Lemma 3.2 gives the exact recursion for a directed decomposition message Mx→yM_{x\to y}, assuming that all incoming messages

Mz→x,z∈N𝒯​(x)∖{y},M_{z\to x},\qquad z\in N_{\mathcal{T}}(x)\setminus\{y\},

are already available. To recover reachability information from the entire graph at every bag, we therefore compute the message in both directions across every decomposition edge.

Root the decomposition tree 𝒯\mathcal{T} at an arbitrary bag rr. The messages are evaluated in two passes.

Upward sweep.

Process the bags from the leaves toward the root. For every non-root bag xx with parent yy, compute

Mx→yM_{x\to y}

using the recursion of Lemma 3.2. All required incoming messages Mz→xM_{z\to x} come from children of xx and have therefore already been computed. For a leaf, there are no incoming branch messages and the message is obtained directly from the local relation distribution.

Downward sweep.

Process the bags from the root toward the leaves. For every edge in which xx is the parent of yy, compute

Mx→yM_{x\to y}

using the same recursion. The messages from the other children of xx were computed during the upward sweep, while, if x≠rx\neq r, the message from the parent of xx was computed earlier in the downward sweep. Thus every incoming message required for Mx→yM_{x\to y} is available when the edge is processed.

The two sweeps therefore use the same symmetric update

Mx→y=Φx→y​(Pxloc,{Mz→x:z∈N𝒯​(x)∖{y}}),M_{x\to y}=\Phi_{x\to y}\left(P_{x}^{\mathrm{loc}},\{M_{z\to x}:z\in N_{\mathcal{T}}(x)\setminus\{y\}\}\right),

where Φx→y\Phi_{x\to y} denotes the relation-combination, transitive closure, restriction, and probability accumulation operation defined in Section 3.2. The distinction between upward and downward messages is only their evaluation order.

Lemma 3.3 (Exactness of the two-sweep computation).

After one upward sweep followed by one downward sweep, both directed messages associated with every decomposition edge are exact.

Proof.

During the upward sweep, every child-to-parent message is evaluated only after all messages entering the child from its other neighbors have been computed. Hence Lemma 3.2 implies that every upward message is exact.

During the downward sweep, when computing a parent-to-child message Mx→yM_{x\to y}, every required message entering xx from a neighbor other than yy is already exact: child-to-xx messages were computed during the upward sweep, and the parent-to-xx message, when one exists, was computed earlier in the downward sweep. Applying Lemma 3.2 again therefore makes every downward message exact. Thus both orientations of every decomposition edge are computed exactly. ∎

3.3.1 Adding the seed set as an artificial source

We next convert reachability from a seed set into ordinary single-source reachability.

Introduce a new vertex ρ\rho that does not belong to the original graph. For every seed vertex s∈S,s\in S, add a deterministic directed edge ρ→s.\rho\to s. These artificial edges have probability 11. No edge ρ→v\rho\to v is added for a non-seed vertex vv.

To obtain a valid tree decomposition of the augmented graph, add ρ\rho to every bag: Bx+=Bx∪{ρ}.B_{x}^{+}=B_{x}\cup\{\rho\}. Because ρ\rho now occurs in every bag, the connectedness condition of a tree decomposition is automatically satisfied. Moreover, every artificial edge ρ→s\rho\to s is contained in every bag that originally contained ss, so it can be assigned to one such bag according to the same unique-ownership convention used for ordinary edges.

If the original decomposition has width ww, the augmented decomposition has width at most w+1.w+1. Thus the artificial source changes the width only by one.

The purpose of ρ\rho is that, in every fixed live-edge realization, ρ↝v\rho\rightsquigarrow v holds if and only if there exists a seed s∈Ss\in S such that s↝vs\rightsquigarrow v through live original edges. Indeed, any path starting at ρ\rho must first use one of the deterministic edges ρ→s\rho\to s, and every seed ss is reachable directly from ρ\rho. Therefore

ℙ⁡(v​ is activated by ​S)=ℙ⁡(ρ↝v).\mathbb{P}(v\text{ is activated by }S)=\mathbb{P}(\rho\rightsquigarrow v).

The artificial source is retained in all separator and bag relations throughout the dynamic program. In particular, after augmentation the separator associated with x,y{x,y} is Cx​y+=(Bx∩By)∪{ρ}.C_{xy}^{+}=(B_{x}\cap B_{y})\cup\{\rho\}.

Lemma 3.4 (Artificial-source equivalence).

For every live-edge realization of the original IC graph and every vertex v∈Vv\in V,

v is activated from S⟺ρ↝vv\text{ is activated from }S\quad\Longleftrightarrow\quad\rho\rightsquigarrow v

in the augmented graph. Consequently,

ℙ⁡(v​ active∣S)=ℙ⁡(ρ↝v).\mathbb{P}(v\text{ active}\mid S)=\mathbb{P}(\rho\rightsquigarrow v).
Proof.

If vv is activated from SS, then some seed s∈Ss\in S has a live directed path to vv. Since ρ→s\rho\to s is deterministic, prefixing this path with ρ→s\rho\to s yields a path from ρ\rho to vv.

Conversely, every path from ρ\rho to an original vertex must leave ρ\rho through an artificial edge ρ→s\rho\to s for some s∈Ss\in S. The remainder of the path consists of live original edges, so vv is reachable from a seed and is therefore activated under the IC live-edge interpretation. ∎

3.3.2 Global Bag Distributions and Activation Marginals

After the upward and downward sweeps, every bag xx has an exact incoming message Mz→xM_{z\to x} from each neighboring decomposition branch z∈N𝒯​(x)z\in N_{\mathcal{T}}(x). Together with the locally owned edges at xx, these branches account for every uncertain edge of the graph exactly once.

For a local relation RxlocR_{x}^{\mathrm{loc}} and incoming branch relations {Rz}z∈N𝒯​(x)\{R_{z}\}_{z\in N_{\mathcal{T}}(x)}, define the resulting relation on the augmented bag Bx+B_{x}^{+} by

Ψx​(Rxloc,{Rz})=TC⁡(Rxloc∪⋃z∈N𝒯​(x)Rz)|Bx+×Bx+.\Psi_{x}\left(R_{x}^{\mathrm{loc}},\{R_{z}\}\right)=\left.\operatorname{TC}\left(R_{x}^{\mathrm{loc}}\cup\bigcup_{z\in N_{\mathcal{T}}(x)}R_{z}\right)\right|_{B_{x}^{+}\times B_{x}^{+}}.

The corresponding global bag distribution is

Px(R)=∑Rxloc,{Rz}:Ψx​(Rxloc,{Rz})=RPxloc(Rxloc)∏z∈N𝒯​(x)Mz→x(Rz).\boxed{P_{x}(R)=\sum_{\begin{subarray}{c}R_{x}^{\mathrm{loc}},\{R_{z}\}:\\ \Psi_{x}(R_{x}^{\mathrm{loc}},\{R_{z}\})=R\end{subarray}}P_{x}^{\mathrm{loc}}(R_{x}^{\mathrm{loc}})\prod_{z\in N_{\mathcal{T}}(x)}M_{z\to x}(R_{z}).}

By Lemma 3.3, all incoming messages are exact, and by Lemma 3.1, replacing each incident branch by its separator relation preserves reachability on Bx+B_{x}^{+}. Therefore Px​(R)P_{x}(R) is exactly the probability that the complete augmented live-edge graph induces relation RR on Bx+B_{x}^{+}.

Now let vv be an original graph vertex and let xx be any bag containing vv. Since ρ\rho belongs to every augmented bag,

ℙ(ρ↝v)=∑RPx(R) 1[(ρ,v)∈R].\mathbb{P}(\rho\rightsquigarrow v)=\sum_{R}P_{x}(R)\,\mathbf{1}[(\rho,v)\in R].

By Lemma 3.4,

πv(S)=ℙ(v active∣S)=∑RPx(R) 1[(ρ,v)∈R].\boxed{\pi_{v}(S)=\mathbb{P}(v\text{ active}\mid S)=\sum_{R}P_{x}(R)\,\mathbf{1}[(\rho,v)\in R].}

A vertex may occur in several bags, but the value above is independent of the chosen bag because every PxP_{x} is a restriction of the same global live-edge distribution. We therefore assign each vertex vv an arbitrary home bag h⁡(v)h(v) containing it and evaluate πv​(S)\pi_{v}(S) only there.

Finally,

σ⁡(S)=∑v∈Vπv​(S).\sigma(S)=\sum_{v\in V}\pi_{v}(S).

3.4 Running Time

A bag contains at most w+1w+1 graph vertices. Including the artificial source gives O⁡(w)O(w) boundary objects (nodes of the original graph). A directed reachability relation can therefore be represented by O⁡(w2)O(w^{2}) Boolean entries. Hence there are at most 2O⁡(w2)2^{O(w^{2})} possible relation states. Here we measure complexity as the number of arithmetic operations.

Theorem 3.5 (Exact bounded-treewidth IC inference).

Given a tree decomposition of width ww with O⁡(n)O(n) bags, all IC activation marginals can be computed exactly in

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

arithmetic operations. For fixed ww, the running time is linear in nn.

Proof.

By Lemmas 3.2 and 3.3, one upward and one downward sweep compute the exact directed message on every decomposition edge. A width-ww bag, after inclusion of the artificial source, contains O⁡(w)O(w) boundary objects and therefore admits at most 2O⁡(w2)2^{O(w^{2})} directed reachability states. Combining two relation distributions, including the required transitive closure and restriction, therefore takes 2O⁡(w2)​poly⁡(w)2^{O(w^{2})}\operatorname{poly}(w) arithmetic operations.

Each directed decomposition edge is processed once in each sweep. Likewise, the global bag distribution PxP_{x} from Section 3.3.2 is obtained by successively combining the local relation distribution at xx with the incoming messages {Mz→x:z∈N𝒯​(x)},\{M_{z\to x}:z\in N_{\mathcal{T}}(x)\}, using the same relation-combination operation as in the message recursion. The work needed to construct PxlocP_{x}^{\text{loc}} for each bag xx is O⁡(2O⁡(w2)​poly⁡(w))O(2^{O(w^{2})}\operatorname{poly}(w)) since the size of each bag is O⁡(w)O(w) with O⁡(w2)O(w^{2}) edges. Hence the work at bag xx is proportional to deg𝒯⁡(x)\deg_{\mathcal{T}}(x) times 2O⁡(w2)​poly⁡(w)2^{O(w^{2})}\operatorname{poly}(w), and since

∑xdeg𝒯⁡(x)=O⁡(n)\sum_{x}\deg_{\mathcal{T}}(x)=O(n)

for a linear-size tree decomposition, constructing all global bag distributions requires

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

operations.

Finally, each graph vertex is evaluated only at its home bag. Computing

πv(S)=∑RPh⁡(v)(R) 1[(ρ,v)∈R]\pi_{v}(S)=\sum_{R}P_{h(v)}(R)\,\mathbf{1}[(\rho,v)\in R]

requires scanning at most 2O⁡(w2)2^{O(w^{2})} relation states, so extracting all nn activation marginals also costs

O⁡(n​ 2O⁡(w2)).O\!\left(n\,2^{O(w^{2})}\right).

Combining these bounds gives the claimed

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

running time. ∎

3.5 State-Complexity Lower Bound

We next show that the quadratic exponent in the separator-relation representation is unavoidable within the class of context-independent compositional summaries.

Let CC be a separator of size Θ⁡(w)\Theta(w) and partition it into two sets

C=L∪R,|L|,|R|=Θ⁡(w).C=L\cup R,\qquad|L|,|R|=\Theta(w).

We construct a family of deterministic subgraphs whose only interface with the remainder of the graph is the separator CC. These subgraphs should be thought of as possible components lying on one side of a decomposition edge.

For every subset X⊆L×R,X\subseteq L\times R, define one such subgraph HXH_{X} as follows. For every pair (ℓ,r)∈X,(\ell,r)\in X, include the directed edge ℓ→r\ell\to r with activation probability 11, and include no edge from ℓ\ell to rr when (ℓ,r)∉X.(\ell,r)\notin X. No other edges are present in HXH_{X}.

Thus HXH_{X} is deterministic: there is only one live-edge realization. Moreover, because every edge is directed from LL to RR and there are no edges leaving vertices of RR, no directed path can use more than one edge. Consequently, the reachability relation induced by HXH_{X} on the separator is exactly

ℓ↝r⟺(ℓ,r)∈X.\ell\rightsquigarrow r\quad\Longleftrightarrow\quad(\ell,r)\in X.

Hence every subset X⊆L×RX\subseteq L\times R corresponds to a distinct possible separator behavior. Since there are 2|L|​|R|=2Θ⁡(w2)2^{|L||R|}=2^{\Theta(w^{2})} such subsets, there are 2Θ⁡(w2)2^{\Theta(w^{2})} distinct reachability behaviors that a separator summary may have to represent.

Theorem 3.6 (Separator-state lower bound).

Any exact context-independent compositional summary of a separator of size Θ⁡(w)\Theta(w) that preserves reachability under arbitrary external contexts requires

2Ω⁡(w2)2^{\Omega(w^{2})}

distinguishable states in the worst case.

Proof.

The construction above gives 2|L|​|R|=2Θ⁡(w2)2^{|L||R|}=2^{\Theta(w^{2})} different separator reachability relations. It remains to show that an exact context-independent summary cannot merge two distinct such relations into the same state.

Consider two distinct subsets X,Y⊆L×R.X,Y\subseteq L\times R. Since X≠YX\neq Y, there exists a pair (ℓ,r)∈X​△​Y.(\ell,r)\in X\triangle Y. Without loss of generality, suppose (ℓ,r)∈X(\ell,r)\in X and (ℓ,r)∉Y.(\ell,r)\notin Y.

We now construct an external context that distinguishes the two branch behaviors. Add a new source vertex ρ\rho with the deterministic edge ρ→ℓ,\rho\to\ell, and add a new target vertex tt with the deterministic edge r→t.r\to t. No other edges are added by the external context.

When the branch HXH_{X} is attached, the relation ℓ↝r\ell\rightsquigarrow r holds, and therefore ρ↝t.\rho\rightsquigarrow t. When HYH_{Y} is attached, this reachability does not hold. Since the construction of HYH_{Y} contains only edges from LL to RR, there is no alternative path from ℓ\ell to rr, and hence ρ↝̸t.\rho\not\rightsquigarrow t. Thus HXH_{X} and HYH_{Y} produce different reachability answers under the same external context. Any exact context-independent compositional summary must therefore assign them different states; otherwise the remainder of the computation could not distinguish which answer is correct.

Since this argument applies to every pair of distinct subsets X,Y⊆L×RX,Y\subseteq L\times R, all 2|L|​|R|=2Θ⁡(w2)2^{|L||R|}=2^{\Theta(w^{2})} separator behaviors must be distinguishable. Hence at least 2Ω⁡(w2)2^{\Omega(w^{2})} summary states are required in the worst case. ∎

Remark 3.7.

Theorem 3.6 is a lower bound for exact context-independent separator summaries. It is not claimed to be a universal lower bound for every possible bounded-treewidth algorithm.

4 Exact All-Node Marginal Gains in Linear Time

This section contains the main influence-maximization observation.

4.1 Variable Seed Edges

We now replace the deterministic artificial source edges used in the previous section by probabilistic source edges.

Introduce the artificial source vertex ρ\rho as before. For every original graph vertex v∈Vv\in V, add an artificial directed edge ρ→v\rho\to v whose live probability is a variable θv∈[0,1].\theta_{v}\in[0,1]. Let 𝜽=(θv)v∈V.\boldsymbol{\theta}=(\theta_{v})_{v\in V}.

The augmented live-edge model therefore contains two types of independent Bernoulli variables:

  • •

    every original graph edge e∈Ee\in E is live independently with its fixed IC probability pep_{e}; and

  • •

    every artificial source edge ρ→v\rho\to v is live independently with probability θv\theta_{v}.

For any event AA in this augmented random graph, write ℙ𝜽​(A)\mathbb{P}_{\boldsymbol{\theta}}(A) for its probability under these edge probabilities. In particular, ℙ𝜽​(ρ↝u)\mathbb{P}_{\boldsymbol{\theta}}(\rho\rightsquigarrow u) denotes the probability that uu is reachable from ρ\rho when the original edges are sampled according to their fixed probabilities pee∈E{p_{e}}_{e\in E} and the artificial source edges are sampled according to 𝜽\boldsymbol{\theta}.

Define

F⁡(𝜽)=∑u∈Vℙ𝜽​(ρ↝u).F(\boldsymbol{\theta})=\sum_{u\in V}\mathbb{P}_{\boldsymbol{\theta}}(\rho\rightsquigarrow u).

For a deterministic seed set S⊆VS\subseteq V, let 𝜽=𝟏S,\boldsymbol{\theta}=\mathbf{1}_{S}, where

(𝟏S)v={1,v∈S,0,v∉S.(\mathbf{1}_{S})_{v}=\begin{cases}1,&v\in S,\\ 0,&v\notin S.\end{cases}

Under this assignment, the artificial edge ρ→v\rho\to v is deterministically present exactly when v∈Sv\in S and deterministically absent otherwise. Hence the augmented model reduces exactly to the artificial-source construction for the deterministic seed set SS. By Lemma 3.4,

ℙ𝟏S​(ρ↝u)=ℙ⁡(u​ is activated from ​S),\mathbb{P}_{\mathbf{1}_{S}}(\rho\rightsquigarrow u)=\mathbb{P}(u\text{ is activated from }S),

and therefore

F⁡(𝟏S)=σ⁡(S).\boxed{F(\mathbf{1}_{S})=\sigma(S).}

4.2 Derivative Identity

Theorem 4.1 (Exact marginal gains from derivatives).

Let S⊆VS\subseteq V and let v∉Sv\notin S. Then

∂F∂θv​(𝟏S)=σ⁡(S∪{v})−σ⁡(S).\boxed{\frac{\partial F}{\partial\theta_{v}}(\mathbf{1}_{S})=\sigma(S\cup\{v\})-\sigma(S)}.
Proof.

Fix every coordinate except θv\theta_{v} according to the indicator vector 𝟏S\mathbf{1}_{S}, and allow only the vv-th coordinate to vary. For t∈[0,1]t\in[0,1], define

𝜽(v)​(t)=𝟏S+t​𝐞v,\boldsymbol{\theta}^{(v)}(t)=\mathbf{1}_{S}+t\mathbf{e}_{v},

where 𝐞v\mathbf{e}_{v} is the vv-th standard basis vector. Since v∉Sv\notin S, this means

θu(v)​(t)={1,u∈S,t,u=v,0,u∉S∪{v}.\theta_{u}^{(v)}(t)=\begin{cases}1,&u\in S,\\ t,&u=v,\\ 0,&u\notin S\cup\{v\}.\end{cases}

Under this assignment, the artificial source edges corresponding to vertices in SS are deterministically live, the source edges corresponding to vertices outside S∪vS\cup{v} are deterministically absent, and the single remaining artificial edge ρ→v\rho\to v is live with probability tt.

Conditioning on the state of this edge gives

F⁡(𝜽(v)​(t))=(1−t)​σ​(S)+t​σ​(S∪{v}).F(\boldsymbol{\theta}^{(v)}(t))=(1-t)\sigma(S)+t\,\sigma(S\cup\{v\}).

Indeed, when ρ→v\rho\to v is absent, the deterministic seed set is exactly SS, whereas when it is present, the deterministic seed set is S∪vS\cup{v}.

Differentiating with respect to tt yields

dd​t​F​(𝜽(v)​(t))=σ⁡(S∪{v})−σ⁡(S).\frac{d}{dt}F(\boldsymbol{\theta}^{(v)}(t))=\sigma(S\cup\{v\})-\sigma(S).

Since 𝜽(v)​(0)=𝟏S,\boldsymbol{\theta}^{(v)}(0)=\mathbf{1}_{S}, the derivative on the left at t=0t=0 is precisely the partial derivative of FF with respect to θv\theta_{v} evaluated at 𝟏S\mathbf{1}_{S}. Therefore

∂F∂θv​(𝟏S)=σ⁡(S∪{v})−σ⁡(S).\frac{\partial F}{\partial\theta_{v}}(\mathbf{1}_{S})=\sigma(S\cup\{v\})-\sigma(S).

∎

Consequently, for every v∉Sv\notin S, [∇F​(𝟏S)]v\left[\nabla F(\mathbf{1}_{S})\right]_{v} is exactly the greedy marginal gain of adding vv to SS. Thus the gradient ∇F​(𝟏S)\nabla F(\mathbf{1}_{S}) contains all candidate marginal gains simultaneously.

4.3 Reverse-Mode Differentiation

The bounded-treewidth inference procedure described above can be viewed as an acyclic arithmetic computation whose inputs are the artificial source-edge probabilities 𝜽=(θv)v∈V\boldsymbol{\theta}=(\theta_{v})_{v\in V} and whose scalar output is F⁡(𝜽).F(\boldsymbol{\theta}).

Once the graph, tree decomposition, edge ownership, and relation-state transitions have been fixed, all remaining numerical computations consist of additions and multiplications of probability masses. For example, combining two relation states with masses aa and bb produces a contribution a​bab to the relation state determined by their union and transitive closure. The transitive-closure computation itself is discrete: it determines which output relation receives the contribution, but introduces no additional dependence on 𝜽\boldsymbol{\theta}.

Consequently, after the relation transitions have been compiled, the entire inference algorithm is an arithmetic directed acyclic graph. Let LL denote the number of arithmetic operations in this computation. A forward evaluation computes F⁡(𝜽)F(\boldsymbol{\theta}) in O⁡(L)O(L) time.

This interpretation also gives a direct implementation-level view of the differentiation. Suppose, for example, that the same dynamic program is implemented using an automatic-differentiation framework such as PyTorch [13], with the vector 𝜽\boldsymbol{\theta} declared to require gradients. The forward execution constructs the same computation graph used to evaluate the exact influence. Calling the reverse-mode operation on the scalar output, conceptually F.backward⁡(),F.\mathrm{backward()}, then propagates derivatives backward through all additions and multiplications and returns

θv.grad=∂F∂θv\theta_{v}.\mathrm{grad}=\frac{\partial F}{\partial\theta_{v}}

for every vertex vv simultaneously.

This is precisely reverse-mode automatic differentiation applied to the arithmetic circuit defined by the tree-decomposition dynamic program. Since the circuit has one scalar output, reverse mode visits each arithmetic operation only a constant number of times. Therefore all nn partial derivatives

∂F∂θ1,…,∂F∂θn\frac{\partial F}{\partial\theta_{1}},\ldots,\frac{\partial F}{\partial\theta_{n}}

are obtained in O⁡(L)O(L) additional time, rather than requiring nn separate evaluations of the inference algorithm.

One implementation detail is important at Boolean seed assignments. For an artificial edge ρ→v\rho\to v, a probability mass pp is split into p⁡(1−θv)p(1-\theta_{v}) and p​θvp\theta_{v} for the absent and present cases, respectively. Both arithmetic branches must remain in the computation even when θv∈0,1\theta_{v}\in{0,1}. Numerically pruning the zero-mass branch would remove the corresponding derivative path and could therefore destroy the marginal-gain information. Retaining both branches preserves the correct derivative at 𝜽=𝟏S.\boldsymbol{\theta}=\mathbf{1}_{S}.

Theorem 4.2 (All exact marginal gains).

Given a width-ww tree decomposition of the original graph and a current seed set SS, the exact marginal gains

Δ⁡(v∣S)=σ⁡(S∪{v})−σ⁡(S)\Delta(v\mid S)=\sigma(S\cup\{v\})-\sigma(S)

for all v∈V∖Sv\in V\setminus S can be computed simultaneously in

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

time.

Proof.

Augment the graph with the artificial source ρ\rho and the variable source edges ρ→v,\rho\to v, v∈V,v\in V, with probabilities θv\theta_{v}. Adding ρ\rho to every bag increases the decomposition width from ww to at most w+1w+1, and therefore does not change the asymptotic width dependence:

2O⁡((w+1)2)​poly⁡(w+1)=2O⁡(w2)​poly⁡(w).2^{O((w+1)^{2})}\operatorname{poly}(w+1)=2^{O(w^{2})}\operatorname{poly}(w).

By Theorem 3.5, a forward evaluation of F⁡(𝜽)F(\boldsymbol{\theta}) on this augmented decomposition requires

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

arithmetic operations. Let LL denote the size of the corresponding arithmetic circuit, so that

L=O⁡(n​ 2O⁡(w2)​poly⁡(w)).L=O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right).

Evaluate this circuit at 𝜽=𝟏S.\boldsymbol{\theta}=\mathbf{1}_{S}. Since FF is scalar, reverse-mode differentiation computes the complete gradient ∇F​(𝟏S)\nabla F(\mathbf{1}_{S}) by one backward traversal of the same circuit, requiring only O⁡(L)O(L) additional arithmetic operations.

By Theorem 4.1, for every v∉Sv\notin S,

∂F∂θv​(𝟏S)=σ⁡(S∪{v})−σ⁡(S)=Δ⁡(v∣S).\frac{\partial F}{\partial\theta_{v}}(\mathbf{1}_{S})=\sigma(S\cup\{v\})-\sigma(S)=\Delta(v\mid S).

Hence the single forward evaluation followed by a single reverse pass produces all exact candidate marginal gains simultaneously, with total running time

O⁡(n​ 2O⁡(w2)​poly⁡(w)).O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right).

∎

Thus computing all n−|S|n-|S| exact marginal gains has the same asymptotic complexity as one exact influence evaluation, up to the constant-factor overhead of the reverse pass. In particular, the algorithm does not perform a separate influence computation for each candidate vertex.

5 Exact Greedy Influence Maximization

The previous result immediately yields an exact implementation of the classical greedy algorithm.

Algorithm 1 Exact Greedy Influence Maximization on Bounded-Treewidth Graphs
1: Graph G=(V,E)G=(V,E), edge probabilities pee∈E{p_{e}}_{e\in E}, tree decomposition 𝒯\mathcal{T}, seed budget KK
2: Seed set SS
3: Introduce the artificial source ρ\rho and add ρ\rho to every bag
4: For each v∈Vv\in V, add the variable source edge ρ→v\rho\to v with influence probability θv\theta_{v}
5: Assign every original and artificial edge to one owning bag
6: Compile the bag and separator reachability states, together with the combination, transitive-closure, and restriction maps described in Section 3.2 and Lemma 3.2.
7: S←∅S\leftarrow\emptyset
8: for i=1,…,Ki=1,\ldots,K do
9:   Set 𝜽←𝟏S\boldsymbol{\theta}\leftarrow\mathbf{1}_{S}
10:   Compute the local relation distributions for the current 𝜽\boldsymbol{\theta}
11:   Perform the upward and downward sweeps to compute all exact directed messages Mx→yM_{x\to y}
12:   Combine the incoming messages at each bag and evaluate
F⁡(𝜽)=∑v∈Vℙ𝜽​(ρ↝v)F(\boldsymbol{\theta})=\sum_{v\in V}\mathbb{P}_{\boldsymbol{\theta}}(\rho\rightsquigarrow v)
13:   Reverse the arithmetic computation to obtain
gv←∂F∂θv​(𝟏S),v∈Vg_{v}\leftarrow\frac{\partial F}{\partial\theta_{v}}(\mathbf{1}_{S}),\qquad v\in V
14:   Select v⋆←arg⁡maxv∉S⁡gvv^{\star}\leftarrow\arg\max_{v\notin S}g_{v}
15:   S←S∪{v⋆}S\leftarrow S\cup\{v^{\star}\}
16: end for
17: return SS
Theorem 5.1 (Running time of exact greedy).

Algorithm 1 computes exactly the same seed set as classical greedy influence maximization using exact marginal gains, in

O⁡(K​n​ 2O⁡(w2)​poly⁡(w))O\!\left(Kn\,2^{O(w^{2})}\operatorname{poly}(w)\right)

time.

For fixed KK and ww, the running time is O⁡(n).O(n).

Because IC influence is monotone and submodular, the returned solution satisfies

σ⁡(S)≥(1−1e)​OPTK.\sigma(S)\geq\left(1-\frac{1}{e}\right)\operatorname{OPT}_{K}.

5.1 Why Not Solve Influence Maximization Exactly?

Algorithm 1 computes the greedy solution exactly. It does not solve globally optimal influence maximization exactly.

This distinction is unavoidable in general even on extremely simple graph topologies.

Existing results show that IC influence maximization is NP-hard on in-arborescences [11]. The underlying undirected graph of every arborescence is a tree, and therefore has treewidth 11. Furthermore, the graph in the construction of [11] has its pathwidth bounded by 22.

Corollary 5.2.

Globally optimal IC influence maximization is NP-hard even on graphs of pathwidth at most 22.

Proof.

Lu et al. [11] prove NP-hardness of IC influence maximization by a reduction from Subset Sum to an in-arborescence. Their construction consists of paths

vi,1,vi,2,…,vi,L1+L2,i=1,…,n,v_{i,1},v_{i,2},\ldots,v_{i,L_{1}+L_{2}},\qquad i=1,\ldots,n,

whose final vertices are adjacent to a common vertex g1g_{1}, followed by the path

g1,g2,…,gL3.g_{1},g_{2},\ldots,g_{L_{3}}.

Let L=L1+L2L=L_{1}+L_{2}. A path decomposition of the constructed graph is obtained by taking, consecutively for each i=1,…,ni=1,\ldots,n, the bags

{vi,j,vi,j+1,g1},j=1,…,L−1,\{v_{i,j},v_{i,j+1},g_{1}\},\qquad j=1,\ldots,L-1,

and then appending

{g1,g2},{g2,g3},…,{gL3−1,gL3}.\{g_{1},g_{2}\},\{g_{2},g_{3}\},\ldots,\{g_{L_{3}-1},g_{L_{3}}\}.

Every graph edge is contained in some bag, and the bags containing any fixed vertex form a contiguous interval. The largest bag has size three, so the constructed graph has pathwidth at most 22.

Since the reduction of Lu et al. is NP-hard and all graphs produced by the reduction have pathwidth at most 22, globally optimal IC influence maximization is NP-hard even on graphs of pathwidth at most 22. ∎

Thus bounded pathwidth/treewidth makes exact probabilistic inference tractable, but does not eliminate the combinatorial hardness of globally optimal seed selection. This contrast is summarized in Table 1.

Interestingly, the IM problem under the Linear Threshold diffusion model is solvable exactly in polynomial time on in-arborescences [18]. Thus, determining whether exact IM under the LT model is tractable on bounded-pathwidth or bounded-treewidth graphs remains an interesting direction for future research.

Task Complexity
Exact influence evaluation O⁡(n​f​(w))O(nf(w))
All exact marginal gains O⁡(n​f​(w))O(nf(w))
Exact greedy, budget KK O⁡(K​n​f​(w))O(Knf(w))
Globally optimal influence maximization NP-hard for tw⁡(G)=1\operatorname{tw}(G)=1
NP-hard for pw⁡(G)≤2\operatorname{pw}(G)\leq 2
Table 1: Complexity of exact IC inference and influence maximization on graphs of bounded width. Here f⁡(w)=2O⁡(w2)​poly⁡(w).f(w)=2^{O(w^{2})}\operatorname{poly}(w).

6 Probabilistic Seed Activation

In many applications, selecting a node as a target does not guarantee that the node becomes active. It is more realistic to consider interventions as having a probability of success. Let qv∈[0,1]q_{v}\in[0,1] be the probability that targeted node vv becomes active when selected for the seed set.

If θv\theta_{v} represents whether vv is selected as a target (i.e. θv∈{0,1}\theta_{v}\in\{0,1\}), the artificial source edge becomes ρ→qv​θvv.\rho\xrightarrow{q_{v}\theta_{v}}v.

The exact bounded-treewidth circuit is unchanged structurally. Only its numerical edge weights change.

Consequently, the asymptotic running time of the treewidth algorithm is independent of the numerical values of pep_{e} and qvq_{v}.

This contrasts with sampling-based methods, whose running times may depend strongly on cascade sizes, estimator variance, RR-set sizes, and the estimated optimal spread.

7 Experiments

We conducted a series of experiments to empirically evaluate the behavior of the proposed exact bounded-treewidth influence-maximization algorithm. Our aim is not to provide an exhaustive empirical study, but rather to demonstrate the practical feasibility of the method and to investigate its scaling behavior under different diffusion regimes.

In particular, we study how the running time depends on graph size and treewidth, how the methods respond to different propagation and seed activation probabilities, and how the proposed exact greedy algorithm compares with representative scalable influence-maximization baselines on bounded-treewidth instances.

Baselines.

We compare the following methods:

  • •

    TW exact greedy, the proposed method;

  • •

    IMM [16];

  • •

    a directed NewGreedy (NG)/Cohen-style all-gains Monte Carlo method [6, 7]; and

  • •

    CELF with Monte Carlo influence estimation  [10].

For a fair comparison of solution quality, the seed set returned by each method is evaluated afterwards using the same exact bounded-treewidth influence evaluator. This post-hoc evaluation is not included in the optimization running time of any method.

CELF with Monte Carlo estimation was included in preliminary experiments, but its running time became noncompetitive already at substantially smaller graph sizes than those reached by the remaining methods. We therefore omit it from the large-scale results presented below.

7.1 Additional Benchmark Details

All experiments were run on a Dell Precision 7710 workstation with an Intel Core i7-6820HQ processor (8 logical CPUs), 16 GB of RAM, and a 256.1 GB disk, running Ubuntu 24.04.4 LTS.

For the experiments reported below, we considered treewidths w∈{1,2}w\in\{1,2\} and graph sizes ranging from n=300n=300 to n=100000n=100000, subject to computational feasibility. The reported diffusion and seed-success regimes were

(a,q)∈{(0.1,1),(0.5,1),(1,1),(1,0.1),(1,0.05)},(a,q)\in\{(0.1,1),(0.5,1),(1,1),(1,0.1),(1,0.05)\},

with seed budget K=10K=10. Not every combination of treewidth, stochastic regime, and graph size was evaluated up to the same maximum nn; Table 2 therefore reports the largest completed instance available for each setting. All recorded method runs completed with successful status, and no method-level timeout was observed. We therefore do not attribute the termination of the larger benchmark to any particular method; rather, it appears to have resulted from overall hardware-resource limitations of the experimental machine. The underlying graphs were random kk-trees of exact treewidth k=wk=w, converted to bidirected IC graphs. Each directed edge probability was sampled independently as pe∼U⁡(0,a)p_{e}\sim U(0,a).

IMM was run with ε=0.1\varepsilon=0.1 and ℓ=1\ell=1 and without an explicit cap on the number of RR sets. The directed NewGreedy/Cohen-style baseline used 500 live-edge snapshots per greedy round and five Cohen exponential-min sketch repetitions per snapshot. Thus, a completed K=10K=10 NewGreedy run used 5000 live-edge snapshots.

Each method was given an independent wall-clock limit of 3600 seconds. The treewidth circuit compilation had a separate timeout of 1800 seconds. A timeout of one method did not prevent the remaining methods from being evaluated. Each parameter setting was run once.

For every returned seed set, solution quality was evaluated afterwards using the same exact bounded-treewidth influence evaluator. This post-hoc evaluation time was excluded from the reported optimization runtime. For the proposed method, the reported total runtime includes both the one-time treewidth-circuit compilation and exact greedy seed selection, whereas the reported IMM and NewGreedy runtimes contain seed selection only.

For the large-scale benchmark, we attempted graph sizes n∈{30000,100000,300000,1000000}n\in\{30000,100000,300000,1000000\} for treewidths w∈{1,2}w\in\{1,2\}. Not all requested configurations completed on the available hardware. The missing configurations were not caused by the configured per-method wall-clock timeout: no corresponding method-level timeout was recorded before termination of the benchmark process. We therefore report only configurations for which complete results were successfully produced. The termination appears to have resulted from overall computational-resource limitations of the experimental machine rather than a recorded timeout of any individual method.

Because termination occurred outside the method-level status reporting, we do not attribute the missing configurations to any particular method.

7.2 Results

Runtime Scaling.

The experiments were consistent with the linear dependence on graph size predicted for Algorithm 1 at fixed treewidth and seed budget. In the more demanding diffusion regimes, our method outperformed the sampling-based baselines, by several orders of magnitude in the most extreme cases. Figure 1 illustrates the runtime scaling in a particularly challenging stochastic regime, with strong diffusion (a=1a=1) and a low seed activation probability (q=0.05q=0.05).

Figure 1: Runtime as a function of graph size for treewidth 22 under strong diffusion and probabilistic seed activation.
Robustness to Stochastic Parameters.

Figure 2 shows that the runtime of Algorithm 1 is largely insensitive to the particular values of the propagation parameter aa and seed activation probability qq. This behavior is expected: these parameters change the numerical probability masses propagated by the algorithm, but not the underlying set of reachability states or the structure of the compiled computation.

As further illustrated in Table 2, the dominant factors determining the runtime of our method are instead the size and treewidth of the graph. In contrast, the runtimes of IMM and the NewGreedy-style Monte Carlo method vary substantially across stochastic regimes, since their computational requirements depend on the sampling behavior induced by the propagation and seed activation probabilities. This insensitivity to the numerical diffusion parameters is therefore an important practical advantage of the exact bounded-treewidth approach.

Figure 2: Runtime across propagation and seed-activation regimes.
Solution Quality.

Table 2 shows that all evaluated methods generally produced seed sets with very similar exact influence spread. Algorithm 1 most consistently achieved the highest observed spread. Unlike the sampling-based baselines, it computes every greedy marginal gain exactly and therefore reproduces the exact classical greedy trajectory without sampling error.

This does not imply that exact greedy always returns the globally optimal seed set: an approximate method may occasionally select a different sequence of vertices and obtain a seed set with slightly higher final spread. Nevertheless, the results indicate that the sampling-based methods require substantially greater computational effort to attain solution quality close to that of exact greedy on the bounded-treewidth instances considered here.

Table 2: Runtime and solution quality at the largest available graph size for each experimental regime. The runtime is measured in seconds (s), and the solution quality is measured in percentage of the best found solution of all baselines (%).
w n a q TW (s) IMM (s) NG (s) TW (%) IMM (%) NG (%)
1 100000 0.10 1.00 154.54 659.36 1502.84 100.00 99.98 94.28
1 10000 0.50 1.00 14.24 17.08 130.01 100.00 100.00 97.34
1 100000 1.00 0.05 153.65 608.95 1643.90 100.00 99.29 100.00
1 10000 1.00 0.10 14.07 44.63 118.47 100.00 99.86 99.76
1 100000 1.00 1.00 153.17 91.13 1596.28 100.00 99.66 97.13
2 10000 0.10 1.00 23.26 30.28 122.03 100.00 99.81 99.52
2 10000 0.50 1.00 23.22 74.24 134.45 98.99 100.00 96.38
2 10000 1.00 0.05 23.38 1016.79 68.08 100.00 99.08 99.83
2 10000 1.00 0.10 23.24 617.10 68.07 100.00 99.09 99.46
2 10000 1.00 1.00 23.34 483.93 68.85 100.00 99.90 98.59

8 Discussion and Conclusion

We studied Independent Cascade influence maximization on graphs of bounded treewidth. Given a width-ww tree decomposition, exact IC influence evaluation can be performed in

O⁡(n​ 2O⁡(w2)​poly⁡(w))O\!\left(n\,2^{O(w^{2})}\operatorname{poly}(w)\right)

time by propagating distributions over separator reachability relations.

By introducing variable artificial source edges, we further showed that every greedy marginal gain can be expressed as a partial derivative of a single multilinear influence function. Reverse-mode differentiation through the exact inference computation therefore produces all node marginal gains simultaneously, within the same asymptotic complexity as one exact influence evaluation.

This yields an exact implementation of classical greedy influence maximization with running time

O⁡(K​n​ 2O⁡(w2)​poly⁡(w)).O\!\left(Kn\,2^{O(w^{2})}\operatorname{poly}(w)\right).

Consequently, for fixed treewidth and fixed seed budget, exact greedy influence maximization is linear in the size of the graph. Importantly, “exact” here refers to the greedy marginal gains and the resulting classical greedy trajectory, rather than to globally optimal influence maximization.

This tractability stands in contrast to the hardness of the underlying combinatorial optimization problem: globally optimal influence maximization remains NP-hard already on graphs of treewidth one and pathwidth two. The results therefore highlight a sharp distinction between exact probabilistic inference and exact combinatorial optimization on structurally simple graphs.

A useful feature of the proposed approach is that it shifts the main computational difficulty from stochastic sampling to structural complexity. Once the graph topology, tree decomposition, and reachability-state transitions have been fixed, changing the numerical edge or seed-activation probabilities changes only the propagated probability masses, not the combinatorial state space. This is reflected in our experiments, where the runtime of the exact treewidth method was largely insensitive to the stochastic parameters, while the sampling-based baselines varied substantially across diffusion regimes. The experiments were also consistent with the predicted linear scaling in graph size for fixed width.

The main limitation is the dependence on treewidth. Although in practice only reachable relation states need to be materialized, the number of distinguishable separator behaviors can be 2Θ⁡(w2)2^{\Theta(w^{2})} in the worst case within the context-independent compositional separator-summary framework considered here. The method can therefore become impractical rapidly as the treewidth increases. Its natural domain is consequently graphs of very small treewidth, particularly in regimes where exactness is valuable or where sampling-based methods become expensive.

Our present experiments use synthetic graphs with controlled treewidth, allowing the structural dependence of the algorithm to be isolated cleanly. An important direction for future work is to identify natural networks, applications, or decomposition-based subproblems with sufficiently small effective width for exact inference to remain practical. More generally, reducing the practical dependence on treewidth, for example through improved state compression or hybrid exact–approximate methods, remains an interesting direction.

9 Future Work

Several directions appear promising.

Approximate separator inference.

The exact algorithm propagates complete distributions over separator reachability relations, which becomes expensive as the treewidth increases. A natural approximation is to restrict the amount of information propagated between bags, for example by retaining only a selected subset of relation states or by truncating propagation beyond a bounded number of decomposition-tree hops. Such methods could interpolate between exact bounded-treewidth inference and inexpensive local approximations, while potentially retaining much of the structural information captured by the exact method.

Other diffusion models.

The live-graph interpretation suggests that the framework may extend beyond the Independent Cascade model. The Linear Threshold model is particularly interesting. Under its triggering-set representation, the diffusion process can again be expressed through random reachability, but the possible incoming triggering edges of a vertex are locally correlated rather than independent. Extending the separator recursion to accommodate these local dependencies therefore appears feasible but requires additional state or factor information.

The Linear Threshold model is also interesting from an optimization perspective. Influence maximization on in-arborescences exhibits a sharp complexity distinction between the IC and LT models: the problem is tractable under LT while remaining hard under IC. This motivates the question of whether globally optimal LT influence maximization admits polynomial-time algorithms on graphs of bounded treewidth or bounded pathwidth.

Continuous optimization.

The variable-source construction does more than provide the discrete greedy marginal gains. The function F⁡(𝜽)F(\boldsymbol{\theta}) is the multilinear extension associated with independent probabilistic seed selection, and the proposed inference procedure provides exact values and gradients of this function. This suggests using the same machinery as an exact gradient oracle inside continuous-greedy or other continuous optimization procedures. Investigating whether this leads to useful algorithms in practice, and whether the structural setting permits stronger guarantees or more efficient implementations, is a natural direction for further work.

Faster maximum-marginal selection.

The current algorithm computes the complete gradient and therefore all nn marginal gains in every greedy iteration. While this is optimal if all gains are explicitly required, greedy influence maximization needs only the largest one. It is therefore natural to ask whether arg⁡maxv∉S⁡Δ⁡(v∣S)\arg\max_{v\notin S}\Delta(v\mid S) can be identified in o⁡(n​f​(w))o(nf(w)) time without materializing the complete gradient. This question is particularly interesting in combination with lazy greedy techniques such as CELF, where previously computed marginal gains provide upper bounds after the seed set grows. More generally, it may be possible to exploit the fact that consecutive greedy iterations differ by only one new seed and update the compiled inference computation incrementally.

Compact separator representations.

The lower bound of 2Ω⁡(w2)2^{\Omega(w^{2})} applies to exact context-independent compositional summaries that must preserve arbitrary external reachability contexts. Restricted graph families may admit substantially smaller state spaces, and practical instances may realize only a small fraction of all theoretically possible separator relations. Identifying structural conditions under which stronger compression is possible is therefore of both theoretical and practical interest. A broader open question is whether exact bounded-treewidth IC inference can avoid explicit separator-relation states altogether by using a fundamentally different, possibly more global, representation.

References

  • [1] A. Amarilli, P. Bourhis, and P. Senellart (2015) Provenance circuits for trees and treelike instances. In Automata, Languages, and Programming, M. M. Halldórsson, K. Iwama, N. Kobayashi, and B. Speckmann (Eds.), Berlin, Heidelberg, pp. 56–68. External Links: ISBN 978-3-662-47666-6 Cited by: §2.5.
  • [2] S. Arnborg, J. Lagergren, and D. Seese (1991) Easy problems for tree-decomposable graphs. J. Algorithms 12 (2), pp. 308–340. External Links: Document Cited by: §1.
  • [3] S. Bharathi, D. Kempe, and M. Salek (2007) Competitive influence maximization in social networks. In Internet and Network Economics, X. Deng and F. C. Graham (Eds.), Berlin, Heidelberg, pp. 306–311. External Links: ISBN 978-3-540-77105-0 Cited by: §1.
  • [4] H. L. Bodlaender (1996) A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput. 25 (6), pp. 1305–1317. External Links: Document Cited by: §1.
  • [5] W. Chen, C. Wang, and Y. Wang (2010) Scalable influence maximization for prevalent viral marketing in large-scale social networks. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1029–1038. Cited by: §1.
  • [6] W. Chen, Y. Wang, and S. Yang (2009) Efficient influence maximization in social networks. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, pp. 199–208. External Links: Document Cited by: 3rd item.
  • [7] E. Cohen (1997) Size-estimation framework with applications to transitive closure and reachability. J. Comput. Syst. Sci. 55 (3), pp. 441–453. External Links: Document Cited by: 3rd item.
  • [8] M. Cygan, F. V. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh (2015) Parameterized algorithms. Springer, Cham. External Links: Document Cited by: §1.
  • [9] D. Kempe, J. Kleinberg, and É. Tardos (2003) Maximizing the spread of influence through a social network. In Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 137–146. Cited by: §1, §2.2.
  • [10] J. Leskovec, A. Krause, C. Guestrin, C. Faloutsos, J. VanBriesen, and N. Glance (2007) Cost-effective outbreak detection in networks. In Proceedings of the 13th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 420–429. External Links: Document Cited by: §1, 4th item.
  • [11] Z. Lu, Z. Zhang, and W. Wu (2017) Solution of Bharathi–Kempe–Salek conjecture for influence maximization on arborescence. J. Comb. Optim. 33 (2), pp. 803–808. External Links: Document Cited by: §5.1, §5.1.
  • [12] K. Nakamura and M. Nishino (2026) Linear-time exact computation of influence spread on bounded-pathwidth graphs. In 20th Scandinavian Symposium on Algorithm Theory (SWAT 2026), P. Fraigniaud (Ed.), Leibniz International Proceedings in Informatics (LIPIcs), Vol. 370, Dagstuhl, Germany, pp. 34:1–34:17. External Links: Document Cited by: §1, §2.5.
  • [13] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala (2019) PyTorch: an imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (Eds.), pp. 8024–8035. External Links: Link Cited by: §4.3.
  • [14] M. Salek, S. Shayandeh, and D. Kempe (2010) You share, i share: network effects and economic incentives in p2p file-sharing systems. In Internet and Network Economics, A. Saberi (Ed.), Berlin, Heidelberg, pp. 354–365. External Links: ISBN 978-3-642-17572-5 Cited by: §2.2.
  • [15] A. Sen, S. Maniu, and P. Senellart (2026) ProvSQL: A General System for Keeping Track of the Provenance and Probability of Data. In Proc. ICDE, Montréal, Canada, pp. 1252–1265. External Links: Document, 2504.12058, Link Cited by: §1, §2.5.
  • [16] Y. Tang, Y. Shi, and X. Xiao (2015) Influence maximization in near-linear time: a martingale approach. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, SIGMOD ’15, New York, NY, USA, pp. 1539–1554. External Links: ISBN 9781450327589, Link, Document Cited by: §1, 2nd item.
  • [17] Y. Tang, X. Xiao, and Y. Shi (2014) Influence maximization: near-optimal time complexity meets practical efficiency. In Proceedings of the 2014 ACM SIGMOD International Conference on Management of Data, New York, pp. 75–86. External Links: Document Cited by: §1.
  • [18] A. Wang, W. Wu, and L. Cui (2016) On Bharathi–Kempe–Salek conjecture for influence maximization on arborescence. J. Comb. Optim. 31 (4), pp. 1678–1684. External Links: Document Cited by: §5.1.