Documentation

CslibFrontier.Computability.Complexity.Problems.InfluenceMaximization

Computational Hardness and Inapproximability of Network Influence Maximization #

This module formalizes Exercise 24.3(a)–(b) of [Kle07] (Section 24.4, p. 623, and Exercises, p. 632; originally [KKT03]), establishing both NP-hardness of exact influence maximization in the Independent Cascade Model and NP-hardness of n ^ (1 - ε)-approximation in the General Threshold and Order-Independent Cascade Models:

  1. Independent Cascade Influence Maximization (ICInfluence, Exercise 24.3(a)): An InfluenceMaxInstance encodes a weighted directed network (ICNetwork, with unary vertex count numVertices and rational directed edges ICEdge), a binary seed budget budget, and a binary target expected influence target. Every valid network embeds directly into Cslib.GameTheory.Network.IndependentCascadeModel. Reducing from VertexCover via a bipartite directed graph of vertex nodes and edge nodes with unit-probability directed edges proves VertexCover ≤ₚ ICInfluence and ICInfluence_npHard.
  2. Deterministic Sharp-Threshold General Threshold / Cascade Networks (SharpThresholdNetwork, Exercise 24.3(a)–(b)): Following [Kle07], Section 24.3 case (i) (p. 621), each vertex v < numVertices has an integer activation threshold τ_v ≥ 1 and activates deterministically once at least τ_v of its incoming neighbors are active (toGeneralThresholdModel, toCascadeModel). For every SharpThresholdNetwork, expected influence under both GeneralThresholdModel.influence and CascadeModel.influence equals the cardinality of the deterministic fixed point detFinal, which is polynomial-time computable (detFinalBits), placing SharpThresholdInfluence in NP.
  3. n ^ (1 - ε) Inapproximability (GapSharpThresholdInfluence, Exercise 24.3(b)): Appending a layer of M = (m_V + m_E + 4) ^ d amplifier nodes (each with incoming edges from all m_E edge nodes and sharp threshold m_E) to the bipartite vertex-cover gadget amplifies the YES/NO influence gap beyond n ^ (1 - ε) for every 0 < ε < 1 while keeping the instance polynomial-sized. This proves PromiseProblem.NPHard for GapSharpThresholdInfluence ε (GapSharpThresholdInfluence_npHard), NPComplete for SharpThresholdInfluence, and that for every ε > 0, any polynomial-time n ^ (1 - ε)-approximation algorithm (returning either a feasible seed list or a rational value estimate) implies P = NP (P_eq_NP_of_sharpThreshold_approx, P_eq_NP_of_sharpThreshold_valueApprox).

Main definitions #

Main results #

References #

Part 1: Independent Cascade Influence Maximization (Exercise 24.3(a)) #

A directed edge (src, dst) carrying a rational activation probability weight.

  • src : ℕ

    Source vertex label.

  • dst : ℕ

    Destination vertex label.

  • weight : ℚ

    Rational edge weight / activation probability.

Instances For
    theorem Cslib.Complexity.ICEdge.ext {x y : ICEdge} (src : x.src = y.src) (dst : x.dst = y.dst) (weight : x.weight = y.weight) :
    x = y
    @[instance_reducible]
    theorem Cslib.Complexity.encICEdge_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} {x2 : γ → ℚ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encNat budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encRat budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { src := x0 x, dst := x1 x, weight := x2 x }) encIn encICEdge budget
    theorem Cslib.Complexity.encICEdge_dst_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → ICEdge} :
    theorem Cslib.Complexity.encICEdge_mk_deg :
    Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × ℚ) => { src := p.1, dst := p.2.1, weight := p.2.2 }) encICEdgeFields encICEdge 1 1
    theorem Cslib.Complexity.encICEdge_dst_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ICEdge} :
    theorem Cslib.Complexity.encICEdge_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → ℚ} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encNat T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encRat T2 S2) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { src := x0 x, dst := x1 x, weight := x2 x }) encIn encICEdge (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
    theorem Cslib.Complexity.encICEdge_weight_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ICEdge} :
    theorem Cslib.Complexity.encICEdge_src_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ICEdge} :
    @[reducible, inline]

    The tuple of the fields of encICEdge.

    Framed encoding of ICEdge with binary endpoints and rational weight.

    theorem Cslib.Complexity.encICEdge_src_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → ICEdge} :

    A finite directed network on vertices 0, ..., numVertices - 1 with rational edge weights.

    • numVertices : ℕ

      Number of vertices n, encoded in unary so input length is at least n.

    • edges : List ICEdge

      Directed weighted edges.

    Instances For
      theorem Cslib.Complexity.ICNetwork.ext {x y : ICNetwork} (numVertices : x.numVertices = y.numVertices) (edges : x.edges = y.edges) :
      x = y
      theorem Cslib.Complexity.encICNetwork_numVertices_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ICNetwork} :
      theorem Cslib.Complexity.encICNetwork_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → List ICEdge} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList encICEdge) T1 S1) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numVertices := x0 x, edges := x1 x }) encIn encICNetwork (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
      @[reducible, inline]

      The tuple of the fields of encICNetwork.

      theorem Cslib.Complexity.encICNetwork_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → List ICEdge} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList encICEdge) budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numVertices := x0 x, edges := x1 x }) encIn encICNetwork budget

      Framed unary vertex count followed by the framed list of ICEdges.

      theorem Cslib.Complexity.encICNetwork_edges_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ICNetwork} :

      An instance of decision influence maximization: a weighted directed network, a seed budget k, and an integer target expected influence.

      • network : ICNetwork

        The underlying weighted directed network.

      • budget : ℕ

        Maximum number of initial seed vertices.

      • target : ℕ

        Target lower bound on expected activated nodes.

      Instances For
        theorem Cslib.Complexity.InfluenceMaxInstance.ext {x y : InfluenceMaxInstance} (network : x.network = y.network) (budget : x.budget = y.budget) (target : x.target = y.target) :
        x = y
        theorem Cslib.Complexity.encInfluenceMaxInstance_network_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → InfluenceMaxInstance} :
        theorem Cslib.Complexity.encInfluenceMaxInstance_target_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → InfluenceMaxInstance} :
        theorem Cslib.Complexity.encInfluenceMaxInstance_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ICNetwork} {T0 S0 x1 T1 S1 x2 T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encICNetwork T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encNat T2 S2) :
        Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { network := x0 x, budget := x1 x, target := x2 x }) encIn encInfluenceMaxInstance (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
        theorem Cslib.Complexity.encInfluenceMaxInstance_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → ICNetwork} {x1 x2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encICNetwork budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encNat budget) :
        Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { network := x0 x, budget := x1 x, target := x2 x }) encIn encInfluenceMaxInstance budget
        theorem Cslib.Complexity.encInfluenceMaxInstance_budget_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → InfluenceMaxInstance} :

        Well-formedness for an Independent Cascade network: all edge endpoints are in bounds, all edge probabilities lie in [0, 1], and no directed pair (src, dst) appears twice.

        theorem Cslib.Complexity.ICNetwork.toDigraph_adj_iff (N : ICNetwork) (u v : Fin N.numVertices) :
        N.toDigraph.Adj u v ↔ ∃ e ∈ N.edges, e.src = ↑u ∧ e.dst = ↑v

        Edge activation probability extracted from N.edges, defaulting to 0 when absent or outside [0, 1].

        On a valid Independent Cascade network, toIndependentCascadeModel.edgeProb agrees with the listed edge weight on every listed edge.

        Independent Cascade Influence Maximization ([Kle07], Section 24.4, p. 623, and Exercise 24.3(a), p. 632; [KKT03]): valid rational IC instances admitting a seed set of size at most budget with expected influence at least target.

        On any deterministic (0/1) Independent Cascade model where every edge of G has probability 1, expected influence from S equals the deterministic reachable-set size |liveReachable G S|.

        Reduction VertexCover ≤ₚ ICInfluence (Exercise 24.3(a)) #

        Bipartite Independent Cascade reduction from VertexCover: vertices 0, ..., m_V - 1 represent G.distinctVertices, vertices m_V, ..., m_V + m_E - 1 represent VertexCover.properEdges G, each proper edge e = (a, b) receives unit-probability directed edges from its two endpoints, the budget is x.k, and the target is x.k + m_E.

        Correctness of vertexCoverToIC ([Kle07], Exercise 24.3(a), p. 632): x ∈ VertexCover if and only if vertexCoverToIC x ∈ ICInfluence.

        NP-hardness of Independent Cascade Influence Maximization ([Kle07], Section 24.4, p. 623, and Exercise 24.3(a), p. 632; [KKT03]).

        Part 2: Deterministic Sharp-Threshold General Threshold / Cascade Networks #

        A finite directed network where each vertex v < numVertices has an integer activation threshold τ_v ≥ 1 ([Kle07], Section 24.3 case (i), p. 621).

        • numVertices : ℕ

          Number of vertices n, encoded in unary so input length is at least n.

        • edges : List (ℕ × ℕ)

          Directed edges (u, v) with u, v < numVertices.

        • thresholds : List ℕ

          Positive integer activation thresholds τ_0, ..., τ_{n-1}.

        Instances For
          theorem Cslib.Complexity.SharpThresholdNetwork.ext {x y : SharpThresholdNetwork} (numVertices : x.numVertices = y.numVertices) (edges : x.edges = y.edges) (thresholds : x.thresholds = y.thresholds) :
          x = y

          Framed unary vertex count, framed binary edge list, and framed list of binary thresholds.

          theorem Cslib.Complexity.encSharpThresholdNetwork_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → List (ℕ × ℕ)} {x2 : γ → List ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encEdgeList budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) budget) :
          Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { numVertices := x0 x, edges := x1 x, thresholds := x2 x }) encIn encSharpThresholdNetwork budget
          theorem Cslib.Complexity.encSharpThresholdNetwork_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → List (ℕ × ℕ)} {T1 S1 : γ → ℕ} {x2 : γ → List ℕ} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn encEdgeList T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) T2 S2) :
          Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { numVertices := x0 x, edges := x1 x, thresholds := x2 x }) encIn encSharpThresholdNetwork (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
          theorem Cslib.Complexity.encSharpThresholdNetwork_edges_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SharpThresholdNetwork} :

          An instance of sharp-threshold influence maximization: a SharpThresholdNetwork, a binary seed budget budget, and a binary influence target target.

          • The sharp-threshold directed network.

          • budget : ℕ

            Maximum number of initial seeds k.

          • target : ℕ

            Target expected number of activated nodes.

          Instances For
            theorem Cslib.Complexity.SharpThresholdInstance.ext {x y : SharpThresholdInstance} (network : x.network = y.network) (budget : x.budget = y.budget) (target : x.target = y.target) :
            x = y
            theorem Cslib.Complexity.encSharpThresholdInstance_target_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SharpThresholdInstance} :
            theorem Cslib.Complexity.encSharpThresholdInstance_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → SharpThresholdNetwork} {T0 S0 x1 T1 S1 x2 T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encSharpThresholdNetwork T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encNat T2 S2) :
            Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { network := x0 x, budget := x1 x, target := x2 x }) encIn encSharpThresholdInstance (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
            theorem Cslib.Complexity.encSharpThresholdInstance_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → SharpThresholdNetwork} {x1 x2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encSharpThresholdNetwork budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encNat budget) :
            Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { network := x0 x, budget := x1 x, target := x2 x }) encIn encSharpThresholdInstance budget
            theorem Cslib.Complexity.encSharpThresholdInstance_budget_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SharpThresholdInstance} :
            theorem Cslib.Complexity.encSharpThresholdInstance_network_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SharpThresholdInstance} :

            Well-formedness of a SharpThresholdNetwork: one positive threshold per vertex and all edge endpoints in 0, ..., numVertices - 1.

            Positive activation threshold max 1 (thresholds.getD v 1) at vertex v.

            Embed SharpThresholdNetwork as a GeneralThresholdModel on N.toDigraph ([Kle07], Section 24.3, pp. 619–621): g_v(X) = 1 if at least thresholdAt v incoming neighbors of v lie in X, and 0 otherwise.

            Equivalent Order-Independent Cascade Model (toGeneralThresholdModel.toCascadeModel, [Kle07], Section 24.3 case (i), p. 621).

            Exact match with [Kle07], Section 24.3 case (i) (p. 621): for an untried incoming neighbor u of v, N.toCascadeModel.prob v u X = 1 iff (X ∩ inNeighbors v).card + 1 = τ_v, and 0 otherwise.

            One deterministic sharp-threshold activation step on Fin N.numVertices.

            Deterministic final active set after numVertices steps from seed set S.

            Deterministic evaluation of expected influence: for every seed set S, the expected influence under N.toGeneralThresholdModel equals |(N.detFinal S)|.

            The equivalent Order-Independent Cascade Model has the exact same expected influence.

            Maximum expected influence achievable in N with at most k initial seeds.

            Executable polynomial-time simulation (detFinalBits) #

            Convert a list of vertex labels into a Finset (Fin n) of in-bounds vertices.

            Build a length-n Boolean activation vector indicating membership in l.

            One executable Boolean-vector step of the sharp-threshold cascade on N.

            Executable numVertices-step sharp-threshold cascade on a Boolean activation vector.

            Sharp-Threshold General Threshold / Cascade Influence Maximization ([Kle07], Section 24.4, p. 623, and Exercise 24.3, p. 632): valid sharp-threshold instances whose optimal budget-seed expected influence is at least target.

            SharpThresholdInfluence belongs to NP, witnessed by a subset of List.range numVertices verified by the polynomial-time deterministic cascade simulator detFinalBits.

            Part 3: n ^ (1 - ε) Inapproximability (Exercise 24.3(b)) #

            n ^ (1 - ε) Gap Problem for Sharp-Threshold Influence Maximization ([Kle07], Section 24.4, p. 623, and Exercise 24.3(b), p. 632; [KKT03]): among valid instances with 1 < numVertices, yes-instances achieve optimal expected influence at least target, while no-instances have optimal expected influence at most target / numVertices ^ (1 - ε).

            Amplifier gadget reduction from VertexCover #

            Three-layer amplifier reduction from VertexCover to GapSharpThresholdInfluence: given exponent d ≥ 2 and (G, k), trivial cases map to yesGapInstance d / noGapInstance d; otherwise, with mV = |distinctVertices|, mE = |properEdges|, L = mV + mE + 4, and M = L ^ d, the network has:

            • Layer 1 (0 .. mV - 1): vertex nodes (no incoming edges, threshold 1);
            • Layer 2 (mV .. mV + mE - 1): edge nodes (incoming edges from both endpoints, threshold 1);
            • Layer 3 (mV + mE .. mV + mE + M - 1): M amplifier nodes (incoming edges from all mE edge nodes, threshold mE).

            Gap-preserving correctness of vertexCoverToSharpThreshold ([Kle07], Exercise 24.3(b), p. 632): for 0 < ε < 1 and 2 ≤ d with 2 ≤ (d + 1) * ε, vertexCoverToSharpThreshold d maps VertexCover into (GapSharpThresholdInfluence ε).yes and VertexCoverᶜ into (GapSharpThresholdInfluence ε).no.

            GapSharpThresholdInfluence ε is NP-hard for every 0 < ε < 1 ([Kle07], Section 24.4, p. 623, and Exercise 24.3(b), p. 632; [KKT03]).

            Algorithmic n ^ (1 - ε)-inapproximability corollaries (P = NP) #

            Inapproximability within n ^ (1 - ε) for value-approximating algorithms ([Kle07], Section 24.4, p. 623, and Exercise 24.3(b), p. 632; [KKT03]): for every ε > 0, if a polynomial-time algorithm computes a rational estimate V x satisfying optInfluence / numVertices ^ (1 - ε) ≤ V x ≤ optInfluence on every valid sharp-threshold instance with 1 < numVertices, then P = NP.

            Inapproximability within n ^ (1 - ε) for seed-selecting algorithms ([Kle07], Section 24.4, p. 623, and Exercise 24.3(b), p. 632; [KKT03]): for every ε > 0, if a polynomial-time algorithm A outputs a seed list whose in-bounds vertex set S = seedFinset numVertices (A x) satisfies S.card ≤ budget and optInfluence / numVertices ^ (1 - ε) ≤ influence S (under GeneralThresholdModel.influence, equivalently CascadeModel.influence) on every valid sharp-threshold instance with 1 < numVertices, then P = NP.