3.1 Line-clique Banzhaf index
In what follows, we shall refer to \(\mathtt {bnz}[i] = P_{\mathcal {G}}(i)\) as the data structure necessary to calculate the Banzhaf index. Then, the number of i-critical coalitions \(S \cup \{i\}\) such that \(|S| = k\), that is the data structure necessary to calculate the Shapley index, will be denoted \(\mathtt {shp}[i,k]\).
For
\(c \in \{1,\ldots , m\}\) and
\(q = 0, 1,\ldots , W\), we define the following data structures:
-
\(\mathtt {clt}[c,q]\), the number of connected coalitions \(S \subseteq V_c\) and \(w(S) = q\);
-
\(\mathtt {clt}[i,c,q]\), the number of connected coalitions \(S \subseteq V_c-\{i\}\) and \(w(S) = q\);
-
\(\mathtt {clt_u}[c,q]\), the number of connected coalitions \(S \subseteq V\) such that \(u(S) = c\) and \(w(S) = q\);
-
\(\mathtt {clt_l}[c,q]\), the number of connected coalitions \(S \subseteq V\) such that \(l(S) = c\) and \(w(S) = q\).
Since
\(V_c\) is a complete subgraph,
\(\mathtt {clt}[c,q]\) and
\(\mathtt {clt}[i,c,q]\) can be calculated with any algorithm for the Banzhaf index of simple voting games.
For computational convenience (the dynamic programming initialization), we assume \(\mathtt {clt}[c,0] = 0\), \(\mathtt {clt}[i,c,0] = 1\), \(\mathtt {clt_u}[c,0] = 1\) and \(\mathtt {clt_l}[c, 0] = 1\).
\(\mathtt {clt_u}[c,q]\) and
\(\mathtt {clt_l}[c,q]\) can be computed through recursion. For
\(q \in [1,W]\),
\(\mathtt {clt_u}[1, q] = \mathtt {clt}[1,q]\). For
\(c > 1\), the recursive formula for
\(\mathtt {clt_u}[c,q]\) is:
$$\begin{aligned} \mathtt {clt_u}[c,q] = \sum _{j=1}^{q} \mathtt {clt}[c,j] \mathtt {clt_u}[c-1,q-j]. \end{aligned}$$
(11)
Formula (
11) combines any coalition in
\(V_c\) with all connected coalitions whose rightmost voter belongs to
\(V_{c-1}\) (including the empty set), forming new coalitions whose rightmost voters is in
\(V_c\).
Similarly, for
\(q \in [1,W]\),
\(\mathtt {clt_l}[m,q]=\mathtt {clt}[m,q]\) and the recursive formula is:
$$\begin{aligned} \mathtt {clt_l}[c,q] = \sum _{j = 1}^{q} \mathtt {clt}[c,j] \mathtt {clt_l}[c + 1, q-j]. \end{aligned}$$
(12)
Formula (
12) combines any coalition in
\(V_c\) with all the connected coalitions whose leftmost voter is in
\(V_{c+1}\) (including the empty set), forming new coalitions whose leftmost voters is in
\(V_c\).
A voter i in \(V_c\) has positional power when it bridges two loosing connected coalitions, one on the left and one on the right of \(V_c\). Let \(S_1\) and \(S_2\) be these coalitions. We enumerate them in the following data structure.
For \(c \in \{2,\ldots , m-1\}\), let \(\mathtt {clt_p}[c,q]\) be the number of coalitions \(S \subseteq V - V_c\) with \(w(S) = q\) and such that S can be partitioned into two connected coalitions \(S_1\) and \(S_2\) with the properties: \(\max \{w(S_1), w(S_2)\} < {\overline{q}}\), \(u(S_1) = c - 1\) and \(l(S_2) = c + 1\).
The data structure can be worked out by recursion:
$$\begin{aligned} \mathtt {clt_p}[c,q] = \sum _{j = \max (1,q-({\overline{q}}-1))}^{\min ({\overline{q}}-1,q-1)} \mathtt {clt_u}[c-1,j] \, \mathtt {clt_l}[c + 1, q - j]. \end{aligned}$$
(13)
Formula (
13) combines all the loosing connected coalitions on the right of
\(V_c\) with those on the left.
The positional power of voter
i can be readily computed from
\(\mathtt {clt_p}[c,q]\). Let
\(\mathtt {pos}[i]\) be the number of coalitions in which
i has positional power. If
\(i \in V_1 \cup V_m\), then
\(\mathtt {pos}[i] = 0\). If
\(i \in V_c\) with
\(c \in \{2,\ldots , m-1\}\), then:
$$\begin{aligned} \mathtt {pos}[i] = \sum _{q = {\overline{q}} - w_i}^{W-w_i} \mathtt {clt_p}[c,q]. \end{aligned}$$
(14)
.
Formula (
14) sums all the not connected coalitions that turn out connected and winning when joined by
i.
Next, we focus on those situations in which
i has coalitional power. Given voter
\(i \in V_c\) and coalition
\(S \subseteq V - \{i\}\) (such that
\(S \cup \{i\}\) is connected), we must consider four cases:
1.
\(l(S \cup \{i\}) < c\) and \(u(S \cup \{i\}) = c\), i.e., voters belong to more than one clique and i is a rightmost voter of \(S \cup \{i\}\);
2.
\(l(S \cup \{i\}) = c\) and \(u(S \cup \{i\}) > c\), i.e., voters belong to more than one clique and i is a leftmost voter of \(S \cup \{i\}\);
3.
\(l(S \cup \{i\}) < c\) and \(u(S \cup \{i\}) > c\), i.e., voters belong to more than one clique and i is in a middle position in \(S \cup \{i\}\);
4.
\(l(S \cup \{i\}) = u(S \cup \{i\}) = c\), i.e., all voters belong to \(V_c\).
We consider the four cases:
Rightmost voter: Let
\(\mathtt {vot_u}[i, q]\) be the number of coalitions
S (not containing
i) for which case 1 applies and moreover
\(w(S) = q\). Then, for all
i and
\(q \le W - w_i\), the data structure can be calculated as follows:
$$\begin{aligned} \mathtt {vot_u}[i,q] = \sum _{j=0}^{q-1} \mathtt {clt}[i,c,j] \, \mathtt {clt_u}[c-1,q-j]. \end{aligned}$$
(15)
Formula (
15) combines the subsets of
\(V_c\) without
i (including the empty set, as
\(\mathtt {clt}[i, c, 0] = 1\)) with the subsets on the left of
\(V_c\).
Leftmost voter: Let
\(\mathtt {vot_l}[i,q]\) be the number of coalitions
S (not containing
i) for which case 2 applies, and moreover
\(w(S) = q\). Then, for all
i and
\(q \le W - w_i\), the data structure can be calculated as follows:
$$\begin{aligned} \mathtt {vot_l}[i,q] = \sum _{j=0}^{q-1} \mathtt {clt}[i,c,j] \, \mathtt {clt_l}[c+1,q-j]. \end{aligned}$$
(16)
Formula (
16) combines the subsets in
\(V_c\) without
i (including the empty set) with the subsets on the right of
\(V_c\).
Middle voter: Let
\(\mathtt {vot_{lu}}[i,q]\) be the number of coalitions
S (not containing
i) for which case 3 applies and moreover
\(w(S) = q\). Then, for all
i and
\(q \le W - w_i\), we have:
$$\begin{aligned} \mathtt {vot_{lu}}[i,q] =\sum _{\begin{array}{c} 1 \le j_1 \le q-2 \\ 1 \le j_2 \le q-1-j_1 \end{array}} \mathtt {clt}[i,c,q - (j_1+j_2)] \, \mathtt {clt_u}[c-1,j_1] \, \mathtt {clt_l}[c+1,j_2] \end{aligned}$$
(17)
where the subscript conditions on
\(j_1\) and
\(j_2\) guarantee that
\(j_1 \ge 1\),
\(j_2 \ge 1\) and
\(q-(j_1+j_2) \ge 1\), so that there is at least one voter other than
i in
\(V_c\) (
i must not have positional power).
Formula (
16) combines the non empty subsets in
\(V_c\) with the subsets that are on the right and on the left of
\(V_c\).
One clique: Let
\(\mathtt {vot_c}[i,q]\) be the number of coalitions
S for which case 4 applies and moreover
\(w(S)=q\). Then, for all
i and
\(q \le W - w_i\), we have:
$$\begin{aligned} \mathtt {vot_c}[i,q] = \mathtt {clt}[i,c,q]. \end{aligned}$$
(18)
Since the coalitions are all contained in
\(V_c\), formula (
18) relabels
\(\mathtt {clt}[i,c,q]\).
Having computed the previous data structures, we can calculate the number
\(\mathtt {vot}[i]\) of subsets for which
i has coalitional power as:
$$\begin{aligned} \mathtt {vot}[i] = \sum _{q={\overline{q}}-w_i}^{{\overline{q}}-1} \Big (\mathtt {vot_l}[c,q]+\mathtt {vot_u}[c,q]+\mathtt {vot_{lu}}[c,q]+\mathtt {vot_c}[c,q]\Big ). \end{aligned}$$
(19)
Let
\(\mathtt {bnz}[i]\) be the number of
i-critical coalitions. It is equal to the sum:
$$\begin{aligned} \mathtt {bnz}[i] = \mathtt {pos}[i] + \mathtt {vot}[i] \end{aligned}$$
(20)
from which the computation of the Banzhaf index (
9) easily follows.
Regarding the complexity of the computation, the calculation of formulas (
11), (
12), (
13), (
15), (
16) and (
17) has worst case complexity
O(
W), that must be repeated
mW or
nW times at most. As
\(n > m\), the greatest complexity is
\(O(nW^2)\), that is quadratic in the input size
W. This proves that calculating the line-clique Banzhaf index has pseudo-polynomial complexity, being #P-complete in the weak sense.
3.2 Line-clique Shapley index
To compute the line-clique Shapley index, one has to consider both the coalition weight and the coalition size. Moreover, the Shapley index considers coalitions that are not connected. For unconnected coalitions, we must keep track of their connected component, whose weight is to be stored, and keep track of unconnected voters that are important to define the coalition size. As a consequence, notations are cumbersome, but dynamic programming principles are simple.
Let \(\mathtt {clt}[c,q,k]\) be the number of connected coalitions such that \(S \subseteq V_c\) (\(S \subseteq V_c - \{i\}\)), \(w(S) = q\) and \(|S| = k\), with \(c \in \{1,\ldots , m\}\) and \(q = 0,\ldots , W\).
Similarly, let \(\mathtt {clt}[i,c,q,k]\) be the number of connected coalitions such that \(S \subseteq V_c - \{i\}\), \(w(S) = q\) and \(|S| = k\), with \(c \in \{1,\ldots , m\}\) and \(q = 0,\ldots , W\).
As
\(V_c\) is a complete subgraph, all its subsets
S are connected coalitions and therefore these values can be calculated using any algorithm for the Shapley index of simple voting games, Uno (
2012).
For each
c, the following constants, representing the number of voters on the left and the right of
\(V_c\), are defined:
$$\begin{aligned} L(c) = \sum _{j=1}^{c} |V_j|; \,\,\,\,&U(c) = \sum _{j=c}^m |V_j|. \end{aligned}$$
Let
\(\mathtt {clt_{lu}}[l,u,q,k]\) be the number of connected coalitions
S of
k voters (
\(|S| = k\)) with coalition weight
q (
\(w(S) = q\)) such that
\(l(S) = l\) and
\(u(S) = u\).
This number can be computed via recursion. When
\(u = l\),
\(\mathtt {clt_{lu}}[l,l,q,k] = \mathtt {clt}[l,q,k]\). For
\(u > l\), we have:
$$\begin{aligned} \mathtt {clt_{lu}}[l,u,q,k] = \sum _{j_1=1}^{q-1} \sum _{j_2=1}^{k-1} \mathtt {clt}[u,j_1,j_2] \, \mathtt {clt_{lu}}[l,u-1,q-j_1,k-j_2]. \end{aligned}$$
(21)
Using formula (
21), we can combine coalitions contained in
\(V_u\) with coalitions in which the rightmost voter is in
\(V_{u-1}\).
Let \(\mathtt {sqn_l}[l,u,q,k]\) be the number of coalitions \(S \subseteq V\) of k voters (\(|S| = k\)) that can be partitioned into two disjoint sets Q and T, where Q is the component of S with \(l(Q) = l\), \(u(Q) = u\) and \(w(Q) = q\), whereas \(T \subseteq V_1\cup \ldots \cup V_{l(Q)-2}\).
For
\(l \in \{1,2\}\),
\(\mathtt {sqn_l}[l, u, q, k] = \mathtt {clt_{lu}}[l, u, q, k]\), because
\(T = \emptyset \). For
\(l > 2\), the data structure can be calculated through the formula:
$$\begin{aligned} \mathtt {sqn_l}[l,u,q,k] = \sum _{j = 0}^{k-1} \left( {\begin{array}{c}L(l-2)\\ j\end{array}}\right) \ \mathtt {clt_{lu}}[l,u,q,k-j]. \end{aligned}$$
(22)
Formula (
22) combines the aforementioned connected coalitions
Q with all the subsets of voters
T, unconnected to
Q and located on the left of it.
Similarly, let \(\mathtt {sqn_u}[l,u,q,k]\) be the number of coalitions \(S \subseteq V\) of k voters (\(|S| = k\)) that can be partitioned into two disjoint sets Q and T, where Q is the component of S with \(l(Q) = l\), \(u(Q) = u\) and \(w(Q) = q\), and \(T \subseteq V_{u(Q) + 2}\cup \cdots \cup V_m\).
If
\(u=m\) or
\(u=m-1\),
\(\mathtt {sqn_u}[l,u,q,k] = \mathtt {clt_{lu}}[l,u,q,k]\), because
\(T=\emptyset \). If
\(u < m - 1\), the data structure can be calculated through the formula:
$$\begin{aligned} \mathtt {sqn_u}[l,u,q,k] = \sum _{j=0}^{k-1} \left( {\begin{array}{c}U(u + 2)\\ j\end{array}}\right) \mathtt {clt_{lu}}[l,u,q,k-j]. \end{aligned}$$
(23)
Formula (
23) combines the connected coalitions
Q with all the subsets
T, unconnected to
Q and located on the right of it.
Formulas (
22) and (
23) are combined to enumerate all the coalitions with respect to player
\(i \in V_c\) has positional power: for
\(c \in \{ 2,\ldots ,m-1 \}\)),
i will form a link with a coalition
\(S_1\) located on the left of
\(V_c\) (
\(u(S_1)=c-1\)), with a coalition
\(S_2\) located on the right (
\(l(S_2) = c + 1\)).
Let
\(\mathtt {sqn_p}[c,q,k]\) be the number of coalitions
S of
k voters (
\(|S|=k\)) that can be partitioned into two subsets
\(S_1\) and
\(S_2\) such that:
-
\(S_1 \subseteq V_1 \cup \ldots \cup V_{c-1}\) and \(S_2 \subseteq V_{c+1} \cup \ldots \cup V_{m}\);
-
\(S_1\) can be partitioned into two disjoint subsets \(Q_1\) and \(T_1\), with \(u(Q_1) = c-1\);
-
\(S_2\) can be partitioned into two disjoint subsets \(Q_2\) and \(T_2\) with \(l(Q_2) = c+1\);
-
\(w(Q_1) < {\overline{q}}\), \(w(Q_2) < {\overline{q}}\) and \(w(Q_1) + w(Q_2) = q\).
Note the data structure is useful to determine when
i has positional power, as the data structure enumerates those coalitions
S for which
i is a bridge. Each coalition
\(S \cup \{i\}\) has a component
\(Q = Q_1 \cup Q_2 \cup \{i\}\) with associated weight
\(w(Q) = q+w_i\). If
\(q + w_i > {\overline{q}}\) then
i has positional power.
The formula to compute
\(\mathtt {sqn_p}[c,q,k]\) is:
$$\begin{aligned} \begin{aligned} \mathtt {sqn_p}[c,q,k]&= \sum _{l = 1}^{c - 1} \sum _{u = c+1}^m \sum _{j_1 = \max (1, q - {\overline{q}} +1 )}^{\min ( {\overline{q}}-1,q-1 )} \sum _{j_2 = 1}^{k - 1} \mathtt {sqn_u}[c + 1, u, q - j_1, k - j_2] \cdot \\&\cdot \mathtt {sqn_l}[l, c - 1, j_1, j_2] \\ \end{aligned} \end{aligned}$$
(24)
Formula (
24) combines two non-winning subsets: one on the left and one on the right of
\(V_c\), keeping track of the weight
q and the size
k.
Let
\(\mathtt {pos}[i,k]\) be the number of
i-critical coalitions
S of
k voters (
\(|S| = k\)) where player
i has positional power. If
\(i \in V_1 \cup V_m\), then
\(\mathtt {pos}[i, k] = 0\). If instead
\(i \in V_c\) with
\(c \in \{ 2, \ldots , m-1 \}\):
$$\begin{aligned} \mathtt {pos}[i,k] = \sum _{q = {\overline{q}} - w_i}^{W-w_i} \mathtt {sqn_p}[c,q,k] \end{aligned}$$
(25)
Next, we focus on the situations in which
i has coalitional power, but no positional power. In particular, we consider a voter
\(i \in V_c\) and a coalition
\(S \subseteq V - \{i\}\).
S is partitioned into two subsets,
Q and
T, such that
Q is connected (
Q is the coalition for which we recorded
w(
Q)) and voters of
Q are not connected to voters of
T. We have four possible cases:
1.
i is a rightmost voter of \(Q \cup \{i\}\): \(l(Q \cup \{i\}) < c\) and \(u(Q\cup \{i\}) = c\);
2.
i is a leftmost voter of \(Q \cup \{i\}\): \(l(Q \cup \{i\}) = c\) and \(u(Q \cup \{i\}) > c\);
3.
i is a middle voter of \(Q \cup \{i\}\): \(l(Q \cup \{i\}) < c\) and \(u(Q \cup \{i\}) > c\);
4.
all the voters of \(Q \cup \{i\}\) belongs to \(V_c\): \(l(Q \cup \{i\}) = u(Q \cup \{i\}) = c\).
We consider the four cases:
Rightmost voter: In case 1, the enumeration of coalitions is made in two steps. In the first step, we combine the subsets of
\(V_c\) with the ones located on the left of
\(V_c\), computed in formula (
22). In the second step, we combine these coalitions with the unconnected ones on the right of
\(V_c\).
In particular, let
\(\mathtt {clt_l}[i,q,k]\) be the number of coalitions
S of
k voters (
\(|S| = k\)) that do not include
i (
\(i \notin S\)) and have a component
Q with
\(w(Q) = q\). In case 1,
\(S \cap V_j = \emptyset \) for all
\(j > c\),
\(l(Q) < c\) and
\(u(Q \cup \{i\}) = c\). Then, by assuming for computational convenience
\(\mathtt {clt}[c,i,0,0] = 1\), we can write:
$$\begin{aligned} \mathtt {clt_l}[i,q,k] = \sum _{l=1}^{c-1} \sum _{j_1=1}^q \sum _{j_2=1}^k \mathtt {sqn_l}[l,c-1,j_1,j_2] \mathtt {clt}[c,i,q-j_1,k-j_2] \end{aligned}$$
(26)
Let
\(\mathtt {vot_l}[c,i,q,k]\) be the number of coalitions
S of
k voters (
\(|S| = k\)) having a component
Q with
\(u(Q \cup \{i\}) = c\) and
\(w(Q) = q\). Then we have:
$$\begin{aligned} \mathtt {vot_l}[c,i,q,k] = \sum _{j=0}^{k} \left( {\begin{array}{c}U(c+2)\\ j\end{array}}\right) \mathtt {clt_l}[i,q,k-j] \end{aligned}$$
(27)
Formula (
27) combines all the coalitions enumerated through (
26) with all the coalitions on the right of
\(V_c\), whose number is accounted for by the binomial coefficient.
Leftmost voter: Also in this case, the enumeration of coalitions can be accomplished in two steps.
In particular, let
\(\mathtt {clt_u}[i, q, k]\) be the number of coalitions
S of
k voters (
\(|S| = k\)) that do not include
i (
\(i \notin S\)) and have a component
Q such that
\(w(Q) = q\). In case 2, we have
\(S \cap V_j = \emptyset \) for all
\(j < c\),
\(l(Q \cup \{i\}) = c\) and
\(u(Q) > c\). Assuming
\(\mathtt {clt}[c,i,0,0]=1\), we have:
$$\begin{aligned} \mathtt {clt_u}[i,q,k] = \sum _{u=c+1}^{m} \sum _{j_1=1}^q \sum _{j_2=1}^k \mathtt {sqn_u}[c+1,u,j_1,j_2] \mathtt {clt}[c,i,q-j_1,k-j_2] \end{aligned}$$
(28)
Let
\(\mathtt {vot_u}[c,i,q,k]\) denote the number of coalitions
S of
k voters having a component
Q with
\(l(Q \cup \{i\} = c\) and
\(w(Q) = q\). Then we have:
$$\begin{aligned} \mathtt {vot_u}[c,i,q,k] = \sum _{j=0}^{k} \left( {\begin{array}{c}L(c-2)\\ j\end{array}}\right) \mathtt {clt_l}[i,q,k-j] \end{aligned}$$
(29)
Formula (
29) combines all the coalitions in (
28) with all the unconnected coalitions on the left of
\(V_c\), whose number is accounted for by the binomial coefficient.
Middle voter: Let \(\mathtt {vot_{lu}}[i,q,k]\) be the number of coalitions S of k voters (\(|S| = k\)) that do not include i (\(i \notin S\)) and have a component Q such that \(w(Q) = q\). In case 3 we have \(l(Q) < c\) and \(u(Q) > c\). Moreover, since we are considering only the situations where i has coalitional power and excluding the ones in which the player has positional power, it must be that \(Q \cap V_c \ne \emptyset \) and therefore \(|(Q \cup \{i\}) \cap V_c | \ge 2\).
The formula to calculate
\(\mathtt {vot_{lu}}[i,q,k]\) is thus:
$$\begin{aligned} \begin{aligned} \mathtt {vot_{lu}}[i,q,k] =&\sum _{l=1}^{c-1} \sum _{u=c+1}^{m} \sum _{\begin{array}{c} {1 \le j_1 \le q - 2}\\ {2 \le j_1+j_2 \le q-1} \end{array}} \sum _{\begin{array}{c} {1 \le j_3 \le k-2}\\ {2 \le j_3+j_4 \le k-1} \end{array}} \mathtt {sqn_u}[l,c-1,j_1,j_3] \cdot \\&\cdot \mathtt {sqn_l}[c+1,u,j_2,j_4]\ \mathtt {clt}[c,i,q-(j_1+j_2),k-(j_3+j_4)] \\ \end{aligned} \end{aligned}$$
(30)
Formula (
30) combines all the coalitions in
\(V_c\) with those that are on the left and on the right of
\(V_c\). The range of
\(j_3\) and
\(j_4\) guarantees that there is at least one voter in
\(V_c\), at least one on the right of
\(V_c\), and at least one on the left of it.
One clique: Let \(\mathtt {vot_c}[i,q,k]\) be the number of coalitions S of k voters (\(|S| = k\)) not including i (\(i \notin S\)) and having a component Q with coalition weight q (\(w(Q) = q\)). In case 4, we have \(S \cap V_{c+1} = S \cap V_{c-1} = \emptyset \).
Assuming for convenience that
\(L(c) = 0\) for
\(c < 1\) and
\(U(c) = 0\) for
\(c > m\),
$$\begin{aligned} \mathtt {vot_c}[i,q,k] = \sum _{j=0}^{k} \left( {\begin{array}{c}L(c-2)+U(c+2)\\ j\end{array}}\right) \mathtt {clt}[c,i,q,k-j] \end{aligned}$$
(31)
Formula (
31) combines all the coalitions in
\(V_c\) with all the ones made up of the non critical players located on the left and on the right of
\(V_c\).
Formulas (
27), (
29), (
30) and (
31) can be summed up to compute the number of coalitions with respect to which player
i has coalitional power. Let
\(\mathtt {vot}[i,k]\) be the number of such coalitions
S of
k voters (
\(|S| = k\)), then:
$$\begin{aligned} \mathtt {vot}[i,k] = \sum _{q={\overline{q}}-w_i}^{{\overline{q}}-1} \Big ( \mathtt {vot_u}[i,q,k] + \mathtt {vot_l}[i,q,k] + \mathtt {vot_{lu}}[i,q,k] +\mathtt {vot_c}[i,q,k] \Big ) \end{aligned}$$
(32)
The data structure
\(\mathtt {shp}[i,k]\) needed to calculate the Shapley index on line-clique graphs is:
$$\begin{aligned} \mathtt {shp}[i,k] = \mathtt {vot}[i,k] + \mathtt {pos}[i,k] \end{aligned}$$
(33)
Regarding the computational complexity, the calculation of formulas (
21), (
22), (
23), (
24), (
26), (
27), (
28), (
29), (
30) and (
31) has at most pseudo-polynomial complexity, depending on polynomial functions of
n,
m and
W. The greatest attained complexity is
\(O(m^3W^2n^2)\) for formula (
24). This proves that calculating the Shapley index on line-clique graphs is #P-complete in the weak sense.