Exact Greedy Influence Maximization in Linear Time
on Bounded-Treewidth Graphs
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
time, for a graph with nodes and treewidth .
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
time, which is linear in graph size for fixed treewidth and seed budget . We further show that the separator-relation representation has tight 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 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 .
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.
We give an explicit exact IC inference formulation for bounded-treewidth graphs using probability distributions over transitively closed separator reachability relations.
- 2.
We show that exact influence evaluation and all vertex activation marginals can be computed in
arithmetic operations.
- 3.
We introduce source-edge variables and prove that, for every ,
where 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.
We obtain an exact implementation of classical greedy IM with running time
Hence, for fixed treewidth and seed budget , exact greedy IM is linear in the graph size.
- 5.
We show that the separator-relation representation has worst-case state complexity within the class of exact context-independent compositional separator summaries.
- 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 be a simple directed graph with . Each edge is associated with an independent propagation probability which represents the probability with which newly active nodes activate their inactive neighbors.
Given a seed set , the Independent Cascade process starts with all vertices of active. Then the diffusion proceeds in discrete steps. Whenever becomes active at time , it gets one independent opportunity to activate each currently inactive out-neighbor with probability . Successfully activated neighbors then attempt to activate their own inactive out-neighbors at time . 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 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 can be regarded as live with probability and dead with probability . A vertex is activated by seed set iff it is reachable from in the resulting live-edge graph.
Thus
This equivalence turns IC inference into probabilistic reachability.
2.3 Influence Maximization
The influence maximization problem asks for
For IC, is monotone and submodular. Therefore the classical greedy algorithm, which repeatedly selects the node with maximum marginal gain, achieves the approximation guarantee
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 is a pair
where each is a bag satisfying:
- 1.
every vertex occurs in at least one bag;
- 2.
every edge has both endpoints in at least one bag;
- 3.
the bags containing any fixed vertex form a connected subtree of .
The width of a decomposition is
and the treewidth 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 as an uncertain tuple whose presence probability is 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 from a seed set is the probability of the recursive reachability query .
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 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 with separator
For a fixed live-edge realization on the -side of the decomposition edge, define a relation by using only vertices and edges on the -side.
Lemma 3.1 (Separator sufficiency).
Let be a directed graph component whose only intersection with the remainder of the graph is a separator . For a fixed realization of , let
Replacing by directed arcs representing preserves all reachability relations among vertices outside and vertices of .
Proof.
Any path entering can be decomposed into maximal excursions from a separator vertex to a separator vertex . Each such excursion can be replaced by the relation arc .
Conversely, replacing by introduces no new reachability. Every relation arc exists only because there is a directed path from to inside . 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 . ∎
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 , let be the corresponding separator. We define
where is the reachability relation induced on by the part of the graph represented on the -side of the decomposition edge .
For a bag , let denote the probability that the uncertain edges owned locally by induce the reachability relation
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 , the edge variables owned in distinct incident branches are disjoint from one another and from those owned locally by . 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 .
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 , and let
be the neighbors of other than .
Suppose the local state is , and the incoming branches induce states For this fixed tuple, define the outgoing separator relation by their transitive closure restricted to as
Note that the relations are aggregated with the 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
because the corresponding edge-variable sets are disjoint and independent. Here denotes the locally computed probability of relation .
Different tuples may produce the same outgoing relation. Their probability masses are therefore accumulated, giving the recursion
Thus the relation operation 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 . Remove the decomposition edge , and let denote the component containing . Assume that every uncertain graph edge has exactly one owning bag and is sampled only at that bag.
Then, for every relation the message recursion computes exactly the probability that the edges whose owners lie in induce relation on :
Proof.
We prove the claim by induction on the number of bags in .
Let By the induction hypothesis, each incoming message is the exact distribution of the separator relation induced by the corresponding branch.
Fix one realization of the uncertain edges on the -side, and let 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
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
The recursion sums these probabilities over exactly those tuples whose image under is . Since these tuples partition the live-edge realizations inducing outgoing relation , the resulting sum is precisely
For the base case, has no neighbor other than , so the outgoing message is obtained directly from the local relation distribution by transitive closure and restriction to . ∎
3.3 Upward and Downward Message Passing
Lemma 3.2 gives the exact recursion for a directed decomposition message , assuming that all incoming messages
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 at an arbitrary bag . The messages are evaluated in two passes.
Upward sweep.
Process the bags from the leaves toward the root. For every non-root bag with parent , compute
using the recursion of Lemma 3.2. All required incoming messages come from children of 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 is the parent of , compute
using the same recursion. The messages from the other children of were computed during the upward sweep, while, if , the message from the parent of was computed earlier in the downward sweep. Thus every incoming message required for is available when the edge is processed.
The two sweeps therefore use the same symmetric update
where 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 , every required message entering from a neighbor other than is already exact: child-to- messages were computed during the upward sweep, and the parent-to- 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 that does not belong to the original graph. For every seed vertex add a deterministic directed edge These artificial edges have probability . No edge is added for a non-seed vertex .
To obtain a valid tree decomposition of the augmented graph, add to every bag: Because now occurs in every bag, the connectedness condition of a tree decomposition is automatically satisfied. Moreover, every artificial edge is contained in every bag that originally contained , 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 , the augmented decomposition has width at most Thus the artificial source changes the width only by one.
The purpose of is that, in every fixed live-edge realization, holds if and only if there exists a seed such that through live original edges. Indeed, any path starting at must first use one of the deterministic edges , and every seed is reachable directly from . Therefore
The artificial source is retained in all separator and bag relations throughout the dynamic program. In particular, after augmentation the separator associated with is
Lemma 3.4 (Artificial-source equivalence).
For every live-edge realization of the original IC graph and every vertex ,
in the augmented graph. Consequently,
Proof.
If is activated from , then some seed has a live directed path to . Since is deterministic, prefixing this path with yields a path from to .
Conversely, every path from to an original vertex must leave through an artificial edge for some . The remainder of the path consists of live original edges, so 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 has an exact incoming message from each neighboring decomposition branch . Together with the locally owned edges at , these branches account for every uncertain edge of the graph exactly once.
For a local relation and incoming branch relations , define the resulting relation on the augmented bag by
The corresponding global bag distribution is
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 . Therefore is exactly the probability that the complete augmented live-edge graph induces relation on .
Now let be an original graph vertex and let be any bag containing . Since belongs to every augmented bag,
By Lemma 3.4,
A vertex may occur in several bags, but the value above is independent of the chosen bag because every is a restriction of the same global live-edge distribution. We therefore assign each vertex an arbitrary home bag containing it and evaluate only there.
Finally,
3.4 Running Time
A bag contains at most graph vertices. Including the artificial source gives boundary objects (nodes of the original graph). A directed reachability relation can therefore be represented by Boolean entries. Hence there are at most 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 with bags, all IC activation marginals can be computed exactly in
arithmetic operations. For fixed , the running time is linear in .
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- bag, after inclusion of the artificial source, contains boundary objects and therefore admits at most directed reachability states. Combining two relation distributions, including the required transitive closure and restriction, therefore takes arithmetic operations.
Each directed decomposition edge is processed once in each sweep. Likewise, the global bag distribution from Section 3.3.2 is obtained by successively combining the local relation distribution at with the incoming messages using the same relation-combination operation as in the message recursion. The work needed to construct for each bag is since the size of each bag is with edges. Hence the work at bag is proportional to times , and since
for a linear-size tree decomposition, constructing all global bag distributions requires
operations.
Finally, each graph vertex is evaluated only at its home bag. Computing
requires scanning at most relation states, so extracting all activation marginals also costs
Combining these bounds gives the claimed
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 be a separator of size and partition it into two sets
We construct a family of deterministic subgraphs whose only interface with the remainder of the graph is the separator . These subgraphs should be thought of as possible components lying on one side of a decomposition edge.
For every subset define one such subgraph as follows. For every pair include the directed edge with activation probability , and include no edge from to when No other edges are present in .
Thus is deterministic: there is only one live-edge realization. Moreover, because every edge is directed from to and there are no edges leaving vertices of , no directed path can use more than one edge. Consequently, the reachability relation induced by on the separator is exactly
Hence every subset corresponds to a distinct possible separator behavior. Since there are such subsets, there are 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 that preserves reachability under arbitrary external contexts requires
distinguishable states in the worst case.
Proof.
The construction above gives 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 Since , there exists a pair Without loss of generality, suppose and
We now construct an external context that distinguishes the two branch behaviors. Add a new source vertex with the deterministic edge and add a new target vertex with the deterministic edge No other edges are added by the external context.
When the branch is attached, the relation holds, and therefore When is attached, this reachability does not hold. Since the construction of contains only edges from to , there is no alternative path from to , and hence Thus and 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 , all separator behaviors must be distinguishable. Hence at least 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 as before. For every original graph vertex , add an artificial directed edge whose live probability is a variable Let
The augmented live-edge model therefore contains two types of independent Bernoulli variables:
- •
every original graph edge is live independently with its fixed IC probability ; and
- •
every artificial source edge is live independently with probability .
For any event in this augmented random graph, write for its probability under these edge probabilities. In particular, denotes the probability that is reachable from when the original edges are sampled according to their fixed probabilities and the artificial source edges are sampled according to .
Define
For a deterministic seed set , let where
Under this assignment, the artificial edge is deterministically present exactly when and deterministically absent otherwise. Hence the augmented model reduces exactly to the artificial-source construction for the deterministic seed set . By Lemma 3.4,
and therefore
4.2 Derivative Identity
Theorem 4.1 (Exact marginal gains from derivatives).
Let and let . Then
Proof.
Fix every coordinate except according to the indicator vector , and allow only the -th coordinate to vary. For , define
where is the -th standard basis vector. Since , this means
Under this assignment, the artificial source edges corresponding to vertices in are deterministically live, the source edges corresponding to vertices outside are deterministically absent, and the single remaining artificial edge is live with probability .
Conditioning on the state of this edge gives
Indeed, when is absent, the deterministic seed set is exactly , whereas when it is present, the deterministic seed set is .
Differentiating with respect to yields
Since the derivative on the left at is precisely the partial derivative of with respect to evaluated at . Therefore
∎
Consequently, for every , is exactly the greedy marginal gain of adding to . Thus the gradient 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 and whose scalar output is
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 and produces a contribution 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 .
Consequently, after the relation transitions have been compiled, the entire inference algorithm is an arithmetic directed acyclic graph. Let denote the number of arithmetic operations in this computation. A forward evaluation computes in 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 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 then propagates derivatives backward through all additions and multiplications and returns
for every vertex 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 partial derivatives
are obtained in additional time, rather than requiring separate evaluations of the inference algorithm.
One implementation detail is important at Boolean seed assignments. For an artificial edge , a probability mass is split into and for the absent and present cases, respectively. Both arithmetic branches must remain in the computation even when . 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
Theorem 4.2 (All exact marginal gains).
Given a width- tree decomposition of the original graph and a current seed set , the exact marginal gains
for all can be computed simultaneously in
time.
Proof.
Augment the graph with the artificial source and the variable source edges with probabilities . Adding to every bag increases the decomposition width from to at most , and therefore does not change the asymptotic width dependence:
By Theorem 3.5, a forward evaluation of on this augmented decomposition requires
arithmetic operations. Let denote the size of the corresponding arithmetic circuit, so that
Evaluate this circuit at Since is scalar, reverse-mode differentiation computes the complete gradient by one backward traversal of the same circuit, requiring only additional arithmetic operations.
By Theorem 4.1, for every ,
Hence the single forward evaluation followed by a single reverse pass produces all exact candidate marginal gains simultaneously, with total running time
∎
Thus computing all 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.
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
time.
For fixed and , the running time is
Because IC influence is monotone and submodular, the returned solution satisfies
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 . Furthermore, the graph in the construction of [11] has its pathwidth bounded by .
Corollary 5.2.
Globally optimal IC influence maximization is NP-hard even on graphs of pathwidth at most .
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
whose final vertices are adjacent to a common vertex , followed by the path
Let . A path decomposition of the constructed graph is obtained by taking, consecutively for each , the bags
and then appending
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 .
Since the reduction of Lu et al. is NP-hard and all graphs produced by the reduction have pathwidth at most , globally optimal IC influence maximization is NP-hard even on graphs of pathwidth at most . ∎
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 | |
| All exact marginal gains | |
| Exact greedy, budget | |
| Globally optimal influence maximization | NP-hard for |
| NP-hard for |
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 be the probability that targeted node becomes active when selected for the seed set.
If represents whether is selected as a target (i.e. ), the artificial source edge becomes
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 and .
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:
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 and graph sizes ranging from to , subject to computational feasibility. The reported diffusion and seed-success regimes were
with seed budget . Not every combination of treewidth, stochastic regime, and graph size was evaluated up to the same maximum ; 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 -trees of exact treewidth , converted to bidirected IC graphs. Each directed edge probability was sampled independently as .
IMM was run with and 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 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 for treewidths . 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 () and a low seed activation probability ().
Robustness to Stochastic Parameters.
Figure 2 shows that the runtime of Algorithm 1 is largely insensitive to the particular values of the propagation parameter and seed activation probability . 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.
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.
| 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- tree decomposition, exact IC influence evaluation can be performed in
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
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 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 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 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 can be identified in 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 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] (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] (1991) Easy problems for tree-decomposable graphs. J. Algorithms 12 (2), pp. 308–340. External Links: Document Cited by: §1.
- [3] (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] (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] (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] (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] (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] (2015) Parameterized algorithms. Springer, Cham. External Links: Document Cited by: §1.
- [9] (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] (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] (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] (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] (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] (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] (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] (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] (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] (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.