Skip to main content
. 2021 Jun 23;23(7):796. doi: 10.3390/e23070796
Algorithm 1SubTSSH(H=(V,E),tV,tE)
  • 1:

    S=

  • 2:

    whileVdo

  • 3:

        if uV|tV(u)=0 then        ▹ Case 1.a: if a node exists with threshold 0, it is self-influenced

  • 4:

            V=V{u};         ▹ Remove u from the hypergraph

  • 5:

            UpdateThresholds(H,u);         ▹ Reduce the thresholds of the edges containing u

  • 6:

            UpdateSizes(H,u);         ▹ Reduce the size of the edges containing u

  • 7:

        else

  • 8:

            if eE|tE(e)=0 then        ▹ Case 1.b: if an edge exists with threshold 0, it is self-influenced

  • 9:

               E=E{e};         ▹ Remove e from the hypergraph

  • 10:

               UpdateThresholds(H,e);         ▹ Reduce the thresholds of the nodes belonging to e

  • 11:

               UpdateDegrees(H,e);         ▹ Reduce the degree of the nodes belonging to e

  • 12:

            else

  • 13:

               if uU|δ(u)<tV(u) then        ▹ Case 2: v cannot be influenced by its neighbors

  • 14:

                   S=S{u};         ▹ Add u to the seed set S

  • 15:

                   V=V{u};         ▹ Remove u from the hypergraph

  • 16:

                   UpdateThresholds(H,u);         ▹ Reduce the thresholds of the edges containing u

  • 17:

                   UpdateSizes(H,u);         ▹ Reduce the size of the edges containing u

  • 18:

               else        ▹ Remove a node v or an edge e

  • 19:

                   u=argminvVtV(v)δ(v)(δ(v)+1)         ▹δ(v) is the current degree of the node v

  • 20:

                   e=argminheEtE(he)λ(he)(λ(he)+1)        ▹λ(he) is the current size of the edge he

  • 21:

                   if tV(u)δ(u)(δ(u)+1)<tE(e)λ(e)(λ(e)+1) then        ▹ Case 3.a: Remove u

  • 22:

                       V=V{u};         ▹ Remove u from the hypergraph

  • 23:

                       UpdateSizes(H,u);         ▹ Reduce the size of the edges containing u

  • 24:

                   else        ▹ Case 3.b: Remove e

  • 25:

                       E=E{e};         ▹ Remove e from the hypergraph

  • 26:

                       UpdateDegrees(H,e);         ▹ Reduce the degree of the nodes belonging to e

  • 27:

    return S