scieee AI-readable full text Open interactive document viewer

Dynamic programming for computing power indices for weighted voting games with precoalitions

Staudacher, Jochen,Wagner, Felix,Filipp, Jan

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Staudacher, Jochen; Wagner, Felix; Filipp, Jan Article Dynamic programming for computing power indices for weighted voting games with precoalitions Games Provided in Cooperation with: MDPI – Multidisciplinary Digital Publishing Institute, Basel Suggested Citation: Staudacher, Jochen; Wagner, Felix; Filipp, Jan (2022) : Dynamic programming for computing power indices for weighted voting games with precoalitions, Games, ISSN 2073-4336, MDPI, Basel, Vol. 13, Iss. 1, pp. 1-17, https://doi.org/10.3390/g13010006 This Version is available at: https://hdl.handle.net/10419/257583 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/   Citation: Staudacher, J.; Wagner, F.; Filipp, J. Dynamic Programming for Computing Power Indices for Weighted Voting Games with Precoalitions. Games 2022,13, 6. https://doi.org/10.3390/g13010006 Academic Editors: Maria Montero and Ulrich Berger Received: 23 November 2021 Accepted: 22 December 2021 Published: 26 December 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). games Article Dynamic Programming for Computing Power Indices for Weighted Voting Games with Precoalitions Jochen Staudacher * , Felix Wagner and Jan Filipp Fakultät Informatik, Hochschule Kempten, 87435 Kempten, Germany; Felix.W[email protected] (F.W.); [email protected] (J.F.) *Correspondence: [email protected]; Tel.: +49-831-2523-513 Abstract: We study the efficient computation of power indices for weighted voting games with precoalitions amongst subsets of players (reflecting, e.g., ideological proximity) using the paradigm of dynamic programming. Starting from the state-of-the-art algorithms for computing the Banzhaf and Shapley–Shubik indices for weighted voting games, we present a framework for fast algorithms for the three most common power indices with precoalitions, i.e., the Owen index, the Banzhaf–Owen index and the symmetric coalitional Banzhaf index, and point out why our new algorithms are applicable for large numbers of players. We discuss implementations of our algorithms for the three power indices with precoalitions in C++ and review computing times, as well as storage requirements. Keywords: cooperative game theory; power indices; weighted voting games; dynamic programming; precoalitions; Shapley value; Owen value; Banzhaf index JEL Classification: C71 1. Introduction Weighted voting games (also known as weighted majority games) are a common model for decision-making and voting in committees, panels or boards. There are n players and each player i is assigned a positive weight wi , which, in some situations, may reflect the number of votes of a voting bloc. The decision-making body accepts a measure or motion if a certain quota q , normally more than 50 percent of the sum of all weights, is reached or exceeded, i.e., if and only if there is a winning coalition S with ∑i∈Swi≥q . In cooperative game theory, weighted voting games can be regarded as a special class of simple games, i.e., games in which coalitions are either winning with value 1 or losing with value 0. Power indices are applied to simple games and provide measures for the players’ abilities to influence results in voting situations. On the basis of different bargaining models and different axiomatic assumptions, numerous power indices have been introduced; see e.g., [ 1 ] for an overview, with the two most-widely used power indices being the Banzhaf index [2,3] and the Shapley–Shubik index [4]. Weighted voting games and power indices are applicable well beyond classical voting situations in politics, described e.g., in [ 5 – 8 ]. For example, power indices can also be used to analyze genetic networks and rank genes that may be responsible for genetic diseases [ 9 ], to solve reliability problems in the maintenance of computer networks [ 10 ], to understand indirect control power in corporate shareholding structures [ 11 – 13 ] or to analyze social networks [ 14 , 15 ]. In social, economic or corporate networks, and in voting settings alike, it is common for agents to agree beforehand to form a union and act as a voting bloc. This article deals with the special case of a partition of the player set into disjoint precoalitions (also known as a priori unions), i.e., we assume that either all or none of the members of a precoalition join a certain coalition. Precoalitions can model strict party discipline in a legislative chamber, but they can also be interpreted as a way to reduce negotiation costs, with each precoalition sending a delegate as its negotiator. The practical Games 2022,13, 6. https://doi.org/10.3390/g13010006 https://www.mdpi.com/journal/games Games 2022,13, 6 2 of 17 relevance of cooperative games with precoalitions is hard to overstate and there are practical applications abound. Vázquez-Brage et al. (1996) [ 16 ] point out that one needs to consider airlines rather than individual aircraft in order to determine aircraft landing fees; Alonso- Meijide and Bowles (2005) [ 17 ] investigate voting at the International Monetary Fund (IMF), where member states are obliged to form a limited number of groups before allowing a vote at its main decision-making committee (called the Executive Board); Alonso-Meijide et al. (2005) [ 18 ] discuss union formation in the Parliament of Catalonia during legislature from 1995 to 1999; Mayer (2018) [ 19 ] highlights the role of Luxembourg in the early days of the European Economic Community (EEC) by showing that this small country was no longer a powerless null player as soon as it formed a voting bloc together with the two other Benelux countries. As pointed out in the book by Owen [ 20 ], pp. 303, the players in such a union have agreed to keep together, but, even though they will do so in most situations, they are not forced to comply, and hence there is a need to evaluate their influence in a two-stage process. In an external stage, the power of the precoalition is evaluated, and in an internal stage, the results for the members of the precoalition are determined. Using the language of cooperative game theory, this two-stage process translates into an external game (also known as the quotient game) between the precoalitions and an internal game within each precoalition. Owen generalized the Shapley value from the cooperative game theory to the framework with a priori unions amongst subsets of players in his seminal 1977 paper [ 21 ]. However, the internal game within each precoalition is no longer a simple game if the external game is simple. Malawski [ 22 ] pointed out how this problem can be overcome by computing more than one simple game on the internal stage. For our study, this implies that, in general, the solution of more than one weighted voting game will be necessary on the internal level. Following an article by Alonso-Meijide et al. [ 23 ], this paper studies the efficient computation of the three power indices for weighted voting games with precoalitions discussed therein: the Owen index [ 21 ] employing the Shapley–Shubik index on both the external and the internal level, the symmetric coalitional Banzhaf index [ 24 ] employing the Banzhaf index on the external level and the Shapley–Shubik index on the internal level and the Banzhaf–Owen index [ 25 ] employing the Banzhaf index on both the external and the internal level. Computing these three power indices for weighted voting games with precoalitions is challenging, as we are dealing with NP-hard problems [ 26 ], and, as the voting and network applications outlined in the first two paragraphs [ 5 – 15 ], may involve large numbers of players. Power indices for simple games can be computed using generating functions; see, e.g., [ 5 , 27 , 28 ] and the work by Alonso-Meijide and Bowles [ 17 ] for the case of a priori unions. If the subsets of players reach only very few different weight sums, this method is favored [ 8 ] and fast-access data structures for polynomials with few coefficients in computer algebra systems, such as Mathematica [ 29 ], can be used. In this paper, we use the strongly related, though mathematically less sophisticated, paradigm of dynamic programming for power index computation [ 30 – 32 ]. The recent article [ 32 ] presents a new algorithm for the Johnston index [ 33 ], discusses algorithms for power indices based on minimal winning coalitions [ 34 – 36 ], surveys the state-of-the-art and introduces publicly available software. The work by Molinero and Blasco [ 37 ] studies algorithms for the Banzhaf–Owen and Owen indices and, to our knowledge, is the only paper on dynamic programming algorithms for weighted voting games with precoalitions. This paper presents new algorithms for the Banzhaf–Owen, Owen and symmetric coalitional Banzhaf indices with more favorable pseudopolynomial complexities. Our algorithms are based on a generalization of the concepts for computing the Banzhaf and Shapley–Shubik indices from the papers by Uno (2012) [31] and Kurz (2016) [8]. In Section 2, we introduce the basic concepts from cooperative game theory, including simple games, power indices and games with precoalitions along the lines of [ 23 , 38 ]. Section 3explains how dynamic programming is used to count coalitions efficiently for weighted voting games and presents the state-of-the-art algorithms for computing the Games 2022,13, 6 3 of 17 Banzhaf and Shapley–Shubik indices following the paper by Kurz [ 8 ]. Section 4forms the heart of this paper and presents the new algorithms for the three power indices with precoalitions. We point out how our algorithms reflect both the definition of the indices as well as the internal games described by Malawski [ 22 ]. Section 5discusses numerical experiments, reports supportive computing times and storage requirements for our methods and provides the reader with links to our C++ software and test problems. We end with some concluding remarks and an outlook to open problems in Section 6. 2. Preliminaries from Cooperative Game Theory Cooperative game theory [ 39 ] deals with the outcomes and benefits that players can gain by forming coalitions. In the following, we briefly review some terminology for cooperative games and precoalitions along the lines of the papers by Alonso-Meijide et al. (2008) [23] and Mercik and Ramsey (2017) [38]. 2.1. Cooperative Games and Simple Games Let N={ 1,..., n} denote a finite set of n players. A group of players S⊆N is called a coalition, whereas 2 N stands for the set of all subsets of N . ∅ symbolizes the empty coalition and N is called the grand coalition. By |S| , we express the cardinality of a coalition S , i.e., the number of its members; hence, |N|=n . An n -person cooperative game can be characterized as a pair (N , v) , where v: 2 N→R is referred to as the characteristic function assigning a real value to all coalitions S∈ 2 N , with v(∅) = 0. A cooperative game is monotone if, for all coalitions S,T∈2N, the relation S⊆Timplies v(S)≤v(T). We call a cooperative game simple if it is monotone and there holds v(N) = 1 and v(S) = 0 or v(S) = 1 for each coalition S⊂N . Coalitions for which v(S) = 1 are classified as winning coalitions in simple games, whereas coalitions for which v(S) = 0 are called losing coalitions. A player i is a critical player (also known as a decisive player or swing player) in a winning coalition S if v(S\{i}) = 0, i.e., the winning coalition S turns into a losing one if player ileaves S. We call a coalition Swith at least one critical player vulnerable. Weighted voting games (also known as weighted majority games) are possibly the most important subclass of simple games. They are useful for a large number of practical applications [ 5 – 15 ]. Weighted voting games are specified by n non-negative real weights wi , i= 1, . . . , n , and a non-negative real quota q , where normally q>1 2∑n i=1wi . Its characteristic function v: 2 N→ { 0,1 } takes the value v(S) = 1 in case of a winning coalition S , i.e., w(S) = ∑i∈Swi≥q , and v(S) = 0 otherwise, meaning that coalition S is losing. We finally note that not every simple game allows for a representation as a weighted voting game, and refer to the article by Molinero, Riquelme and Serna (2015) [ 40 ] for an overview of different forms of representation for simple games. 2.2. Power Indices and Marginal Contributions Let S⊂N denote a coalition and i/∈S a player not contained in S . We call the difference v(S∪ {i})−v(S) the marginal contribution of player i to coalition S . For simple games, the marginal contribution of player i to coalition S is 1 if and only if i is a critical player in the winning coalition S∪ {i}; in any other case, the marginal contribution is 0. Apower index is a function f that obtains an n -person simple game specified by its player set N and its characteristic function v as its input, and provides a unique vector f(N , v) = (f1(N , v) , . . . , fn(N , v)) as its output. We only introduce the Banzhaf index [ 2 , 3 ] and the Shapley–Shubik index [ 4 ] following the notation of the paper [ 23 ]. For a deeper discussion of the subject, we refer to the overview article [ 1 ] by Bertini, Freixas, Gambarelli and Stach. Let v be a simple n -player game. The (absolute) Banzhaf index [ 3 ] of player i and the Shapley–Shubik index [4] of player ican be written in the form fi(N,v) = ∑ S⊆N\{i} αi S·(v(S∪ {i})−v(S)) (1) Games 2022,13, 6 4 of 17 with the coefficients αi S=1 2n−1 for the Banzhaf index and αi S=|S|!(n− |S| − 1)! n! for the Shapley–Shubik index. We note that, for the coefficients αi S , the cardinality of a coalition S (which is turned from a losing coalition to a winning coalition by the entrance of critical player i ) plays a crucial role for the Shapley–Shubik index, whereas it can be ignored for the Banzhaf index. The coefficients αi S make it obvious that the Banzhaf index can seen as the probability of a player being crucial to a coalition it does not belong to, whereas the Shapley–Shubik index can be interpreted as the probability of a player being decisive over all permutations of players, i.e., assuming all sequential coalitions are equiprobable. We note that the Shapley–Shubik index is efficient, i.e., ∑n i=1fi(N , v) = v(N) = 1, whereas the (absolute) Banzhaf index is not. 2.3. Simple Games with Precoalitions and Coalitional Power Indices In this subsection, we introduce simple games with precoalitions and coalitional power indices borrowing some notation from [23,38]. We are establishing an external division of our set of players N={ 1, . . . , n} into precoalitions (also known as a priori unions) whose members will either enter a coalition together or not at all. Let P(N) stand for the set of all partitions of N , a partition being a set of non-empty subsets of N satisfying the condition that N is a disjoint union of these subsets. We refer to an element P∈ P(N) as a coalition structure (also known as a system of unions) of the set N . A simple game with a coalition structure can be identified as a triplet (N , v , P) . Following [ 23 ], we write our coalition structure in the form P={P1 , . . . , Pm} , i.e., we have m precoalitions P1 , . . . , Pm and the set M={ 1, . . . , m} serves as the index set of the partition P . For a weighted voting game with a coalition structure P , the external game (also known as the quotient game) is defined as the weighted voting game played between the m precoalitions [ 22 , 23 ]. The external game is formally defined as the weighted voting game [q ; w(P1) , . . . , w(Pm)] , i.e., it is represented by the (unaltered) quota q and the weights w(P1) , . . . , w(Pm) of the m precoalitions, where w(Pk) = ∑i∈Pkwi with k∈M , M={1, . . . , m}. Acoalitional power index g is a function that obtains an n -person simple game with a coalition structure specified by its player set N , its characteristic function v and a partition P as its input, and provides a unique vector g(N , v , P)=(g1(N , v , P) , . . . , gn(N , v , P)) as its output. As in [ 23 ], we define three coalitional power indices, i.e., the Banzhaf–Owen index (hereafter BO index) [ 25 ], the symmetric coalitional Banzhaf index (SCB index) [ 24 ] and the Owen index (OW index) [21], within a unified framework. Let P={P1 , . . . , Pm} stand for a set of m precoalitions P1 , . . . , Pm and the set M= { 1, . . . , m} serve as the index set of P . Further, let QR=∪l∈RPl denote the subset of players belonging to any precoalition referred to by the index subset R⊆M . For any player i∈N contained in precoalition k , i.e., i∈Pk , we write a coalitional power index as follows (cf. [38]): gi(N,v,P) = ∑ R⊆M\{k} αk R∑ T⊆Pk\{i} αi T·(v(QR∪T∪ {i})−v(QR∪T)) (2) As in [ 38 ], αk R is an appropriately defined weight for the external game, whereas αi T corresponds to internal games within a precoalition. For the BO index, we employ the weighting coefficients αk R=1 2m−1,αi T=1 2|Pk|−1, Games 2022,13, 6 5 of 17 For the SCB index, αk R=1 2m−1,αi T=|T|!(|Pk|−|T| − 1)! |Pk|!, and for the OW index, αk R=|R|!(m− |R| − 1)! m!,αi T=|T|!(|Pk|−|T| − 1)! |Pk|!. We note that the OW index is efficient, i.e., ∑n i=1gi(N , v , P) = v(N) = 1, whereas the BO and SCB indices are not. Let us emphasize a crucial difference between Formulas (1) and (2). While both expressions rely on marginal contributions of player i , in (2), we assume that precoalitions other than Pk (which contains player i ) have either joined with all of their members or not at all. As pointed out in [ 38 ], the power of player i∈Pk comes from scenarios in which both Pk is critical in the external game and i is a critical player in its precoalition in an appropriately defined internal voting game. For illustration, we look at the coalitional game (N , v , P) represented by the weighted voting game [5; 3, 1, 1,1,3]and the coalition structure P={{1},{2,3,4},{5}}. We obtain gBO(N,v,P) = (1 2,1 4,1 4,1 4,1 2) for the BO indices, gSCB(N,v,P) = (1 2,1 6,1 6,1 6,1 2) for the SCB indices and gOW(N,v,P) = (1 3,1 9,1 9,1 9,1 3) for the OW indices. Looking at the extreme coalition structures Pn={{ 1 } , { 2 } , . . . , {n}} and PN={N} , we recognize that the BO index reduces to the Banzhaf index in both cases, whereas the OW index reduces to the Shapley–Shubik index in both cases. As for the SCB index, it becomes the Banzhaf index for Pn={{ 1 } , { 2 } , . . . , {n}} and the Shapley–Shubik index in case PN={N} . The BO index [ 25 ] applies the Banzhaf index in both the external game and in the internal process between unions. As pointed out by Laruelle and Valenciano [ 41 ], the BO index assesses the a priori decisiveness of every voter within their bloc in the context of the coalitional structure, i.e., assuming that all of the other precoalitions will act as voting blocs. We refer the reader to that paper [ 41 ] for a detailed discussion of the probabilistic interpretations of the BO index. The SCB index by Alonso-Meijide and Fiestras-Janeiro [ 24 ] employs the Banzhaf index for the external game and the Shapley–Shubik index for the internal processes, whereas the OW index [ 21 ] invokes the Shapley–Shubik index on both levels of a two-level decision-making process. Taking a closer look at these two-level decision-making processes will play a crucial role in Section 4, where we derive efficient dynamic programming algorithms for the BO, SCB and OW indices for weighted voting games with precoalitions. 3. Dynamic Programming for the Banzhaf and Shapley–Shubik Indices In this section, we introduce the technique of dynamic programming for counting coalitions in weighted voting games efficiently, discuss the state-of-the-art algorithms for the Banzhaf and Shapley–Shubik indices [ 8 , 31 , 32 ] and present generalizations of existing algorithms that will prove to be useful when we deal with precoalitions and internal games within precoalitions in Section 4. In other words, we are not computing any power indices with precoalitions in this section, but lay the groundwork for doing so in Section 4. Games 2022,13, 6 6 of 17 3.1. Counting Winning and Losing Coalitions via Dynamic Programming It is well known that every weighted voting game allows for an integer representation [ 8 ]. Hence, we assume that the weights wi of the n players in our weighted voting game, as well as the quota q , are positive integers for the rest of the article. We set ˜ w=w(N) = ∑n i=1wi and assume q>˜ w 2 . Players with integer weight 0 are null players, i.e., they are never critical players, and for all power indices discussed in this paper, they can be handled in a preprocessing step and assigned the value 0 without any need to include them in any further computation. When we want to compute the Banzhaf index of player i , we need to be able to answer one of the following two questions: How many losing coalitions are turned into winning coalitions when player i is joining? Alternatively, in how many winning coalitions is player i critical? For the Shapley–Shubik index of player i , the same two questions are relevant, but we also need to take account of cardinalities of coalitions. Dynamic programming is an algorithmic paradigm resting on two pillars: dividing a given problem into subproblems and storing intermediate results efficiently. We will use dynamic programming to count losing and winning coalitions and present algorithms following the work by Kurz [ 8 ]. For a more general introduction to counting coalitions via dynamic programming (including examples), we refer to the recent article [ 32 ] or the textbook by Chakravarty, Mitra and Sarkar [39], chapter 12. Algorithm 1is a generalization of the first algorithm in the article by Kurz [ 8 ]. Equipped with the number n of players, the quota q , a vector w= (w1 , . . . , wn) of positive integer weights and an integer vector T with T( 0 ) = 1 and T(x) = 0 for x= 1, . . . , q− 1, as its four input arguments, it outputs a vector T , with T(x) listing the number of losing coalitions attaining weight 0 ≤x≤q− 1. We briefly note that, in our discussion of memory space requirements, we follow the convention by Uno [ 31 ] throughout the paper and do not include the need to store the n weights itself—and, later, we also omit the memory space for the corresponding n values of the power indices—as this allows for a clearer and more concise presentation. According to this convention, Algorithm 1needs O(nq) time and O(q)memory space. Algorithm 1 Generalized counting of number of losing coalitions per weight 1: procedure LosingCoalitionsByWeight(n,q,w,T) 2: for ifrom 1 to ndo 3: if (q > w(i)) then 4: for xfrom q−1 to w(i)do 5: if (x-w(i) == 0) then 6: T(x)←T(x) + T(0).initialize T(0)=1 for empty set 7: else 8: T(x)←T(x) + T(x−w(i)) 9: end if 10: end for 11: end if 12: end for 13: return T.number of losing coalitions of weight x∈[0, q−1] 14: end procedure Note that Algorithm 1echoes a boundary condition stating that we can obtain the sum 0 in exactly one way, i.e., via the empty set, reflected in T( 0 ) = 1. We admit that the if-else statement in lines 5 to 8 in Algorithm 1is superfluous, as T(x−w(i)) = T( 0 ) in case x=w(i) , but we wanted to highlight the role of T( 0 ) . The actual recursion in line 8 in Algorithm 1mirrors the fact that the first i weights can deliver a sum x> 0 either with or without player i . We will find providing an initial vector T as an input useful in the following section, where we wish to incorporate results from the external game in computations of internal games. Games 2022,13, 6 7 of 17 Kurz [ 8 ] pointed out that, rather than counting losing coalitions from below, we can also count winning coalitions from above, making use of the fact that we can write the sum of all weights in exactly one way, i.e., ˜ w=w(N) = ∑n i=1wi. Algorithm 2is a generalization of the second algorithm in the article by Kurz [ 8 ]. Provided with the number n of players, the quota q , the sum of all weights ˜ w=w(N) , a vector w= (w1 , . . . , wn) of positive integer weights and an integer vector T with T(˜ w) = 1 and T(x) = 0 for x=q , . . . , ˜ w− 1, as its five input arguments, it outputs a vector T , with T(x) listing the number of winning coalitions attaining weight q≤x≤˜ w . Algorithm 2 needs O(n(˜ w−q+1)) time and O(˜ w−q+1)space. Algorithm 2 Generalized counting of number of winning coalitions per weight 1: procedure WinningCoalitionsByWeight(n,q,˜ w,w,T) 2: for ifrom 1 to ndo 3: if (q+w(i)≤˜ w)then 4: for xfrom q+w(i)to ˜ wdo 5: T(x−w(i)) ←T(x) + T(x−w(i)) 6: end for 7: end if 8: end for 9: return T.number of winning coalitions of weight x∈[q,˜ w] 10: end procedure Algorithms 1and 2can be generalized for the distribution of cardinalities of coalitions in a straightforward manner [ 8 , 32 ]. Given that we normally assume q>˜ w 2 (and hence ˜ w−q+ 1 ≤q ), we prefer to work with the winning coalitions from above. Therefore, we provide only the corresponding algorithm for winning coalitions and cardinalities from above in Algorithm 3. Provided with the number n of players, the quota q , the sum of all weights ˜ w=w(N) , a vector w= (w1 , . . . , wn) of positive integer weights and a two-dimensional array C with C(˜ w , n) = 1 and C(x , s) = 0 for all other combinations of weights x=q , . . . , ˜ w , and cardinalities s= 1, . . . , n , as its five input arguments, it outputs a two-dimensional array C , with C(x , s) listing the number of winning coalitions attaining weight q≤x≤˜ w and cardinalities s= 1, . . . , n . Algorithm 3needs O(n2(˜ w−q+ 1 )) time and O(n(˜ w−q+1)) space. Algorithm 3 Generalized counting of number of winning coalitions per weight and cardinality 1: procedure WinningCoalitionsByWeightCardinality(n,q,˜ w,w,C) 2: for ifrom 1 to ndo 3: if q+w(i)≤˜ wthen 4: for xfrom q+w(i)to ˜ wdo 5: for sfrom 2 to ndo 6: C(x−w(i),s−1)←C(x,s) + C(x−w(i),s−1) 7: end for 8: end for 9: end if 10: end for 11: return C.number of winning coalitions of weight x∈[q,˜ w]and cardinality s∈[1, n] 12: end procedure 3.2. Computing the Banzhaf and Shapley–Shubik Indices The paper by Uno (2012) [ 31 ] presented the first algorithm for computing the Banzhaf and Shapley–Shubik indices of all players in a weighted voting game in O(qn) and O(qn2) time, respectively. By working from above, as in Algorithms 2and 3, Kurz (2016) [ 8 ] Games 2022,13, 6 8 of 17 improved this result to O(∆n) and O(∆n2) with ∆=min(q , ˜ w−q+ 1 ) for the Banzhaf and Shapley–Shubik indices, respectively. It is worthwhile to summarize these results and their proofs, together with some new generalizations of algorithms, which we will use later in Section 4. Theorem 1. For an n -player weighted voting game with positive integer weights, the Banzhaf indices for all players can be computed in O(∆n)time and O(∆)memory space. Proof. Let us focus on the case (˜ w−q+ 1 )≤q and compute the Banzhaf indices from above. We obtain the vector T(x) for q≤x≤˜ w via Algorithm 2in O(( ˜ w−q+ 1 )n) time and O(˜ w−q+1)space by calling T=WinningCoalitionsByWeight(n,q,˜ w,w,T) using an integer vector T with T(˜ w) = 1 and T(x) = 0 for x=q , . . . , ˜ w− 1, as our input. We set T+i(x) = T(x) for all x∈ { ˜ w−wi+ 1, . . . , ˜ w} and then loop for x from ˜ w−wi down to qin order to find T+i(x) = T(x)−T+i(x+wi). T+i(x) states how frequently player i belongs to a winning coalition with weight x and fBZ i(N,v) = 1 2n−1 q+wi−1 ∑ x=q T+i(x) gives us the Banzhaf index of player i. Algorithm 4is a generalization of this idea that we will use in the next section. It counts the number of coalitions containing a player with a specified weight. Algorithm 4 Count coalitions containing a player specified by its weight 1: procedure CoalitionsWithPlayer(q,˜ w,weight,T) 2: for xfrom qto ˜ wdo 3: Tw(x)←T(x) 4: end for 5: if (˜ w−weight ≥q)then 6: for xfrom ˜ w−weight to qdo 7: Tw(x)←T(x)−Tw(x+weight) 8: end for 9: end if 10: return Tw 11: end procedure Theorem 1and Algorithm 4can be carried over to versions with cardinalities and thus to the computation of Shapley–Shubik indices. Theorem 2. For an n -player weighted voting game with positive integer weights, the Shapley– Shubik indices for all players can be computed in O(∆n2)time and O(∆n)memory space. Proof. Again, we concentrate on the case (˜ w−q+ 1 )≤q and compute the Shapley–Shubik indices from above. We obtain C(x , s) for q≤x≤˜ w and all cardinalities 1 ≤s≤n from above via Algorithm 3in O(( ˜ w−q+1)n2)time and O(( ˜ w−q+1)n)space by calling C=WinningCoalitionsByWeightCardinality(n,q,˜ w,w,C) using a two-dimensional array C with C(˜ w , n) = 1 and C(x , s) = 0 for all other combinations of weights x=q , . . . , ˜ w , and cardinalities s= 1, . . . , n , as our input. We Games 2022,13, 6 15 of 17 Table 3. Computing times and memory requirements for an example with 3434 players, ˜ w= 72,068, 200 precoalitions, a maximum coalition size of 54 and an average coalition size of 17. q=36, 035 (50% Plus 1 Vote)q=54, 051 (75% of Votes) Index Time (s) Memory (MB) Time (s) Memory (MB) BZ 27.694 35.768 8.959 19.324 SCB 578.455 316.324 259.954 144.224 BO 6.067 17.028 2.879 11.896 OW 86,139.148 1154.708 39,411.552 559.856 6. Outlook and Conclusions In this paper, we present new dynamic programming algorithms for the three most common power indices with precoalitions, i.e., the Owen (OW), Banzhaf–Owen (BO) and symmetric coalitional Banzhaf (SCB) indices. Our algorithms reflect the external and internal decision processes between and within precoalitions used to specify these indices. We provide efficient C++ implementations of our new algorithms and point out that our methods can be applied for large numbers of players. Still, there are many open questions in connection with the computation of power indices with precoalitions. Certain power indices with a priori unions, such as e.g., [43,44], do not fit the framework used in this paper, and it will be interesting to see how dynamic programming can be applied efficiently in these cases. In this context, we would like to stress that the very general framework for computing power indices via quasi-ordered binary decision diagrams [ 45 – 48 ], i.e., a recent approach based on relational algebra, has not yet been extended to power indices with a coalition structure. Furthermore, the mathematical relations between dynamic programming and generating functions [ 5 , 17 , 27 , 28 ] for power index computation justify further research, both in the cases with and without precoalitions. We expect these two paradigms to be very fruitful for each other, and such investigations have the potential to lead to even faster algorithms. Another challenge is the parallel computation of power indices. To our knowledge, there are no publications on parallel computations of any of the power indices (without precoalitions) discussed in [ 32 ] or the dynamic programming algorithms presented therein. The new algorithms for power indices with precoalitions presented in the proofs of Theorems 3–5 appear to be particularly well suited for parallel processing, given that the internal games can be computed independently. In terms of practical calculations for cooperative games with a coalition structure, we regret a lack of software offering more than the computation of the Owen value [ 21 ], i.e., the most widely used solution concept. In our view, even a prototypical implementation of various solution concepts for games with a partition structure, e.g., similar to the freely available R package CoopGame [ 49 ] for cooperative games, might be helpful in popularizing these ideas for analyzing real-world problems. A very concrete real-world application we wish to study using our new algorithms is the problem of indirect control in complex shareholding structures [ 11 – 13 ]. These networks are usually large and, to our knowledge, precoalitions of companies and investors within corporate networks have yet to be investigated. Author Contributions: J.S. conceived the presented algorithms and performed the formal and theoretical analysis. F.W. and J.F. validated the algorithms and performed the numerical simulations. All authors discussed the results and contributed to the final manuscript. All authors have read and agreed to the published version of the manuscript. Funding: This research was partially funded by the Bavarian Ministry of Science and Arts. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Games 2022,13, 6 16 of 17 Acknowledgments: The authors would like to thank Sascha Kurz (University of Bayreuth) for having made the code he used for [ 8 ] publicly available via ResearchGate and having allowed them to use it as a sample for their software. Furthermore, the authors wish to thank two anonymous reviewers for their careful reading of the paper and their helpful comments. Conflicts of Interest: The authors declare no conflict of interest. References 1. Bertini, C.; Freixas, J.; Gambarelli, G.; Stach, I. Comparing power indices. Int. Game Theory Rev. 2013,15, 1340004. [CrossRef] 2. Penrose, L.S. The elementary statistics of majority voting. J. R. Stat. Soc. 1946,109, 53–57. [CrossRef] 3. Banzhaf, J.F., III. Weighted voting doesn’t work: A mathematical analysis. Rutgers L. Rev. 1964,19, 317. 4. Shapley, L.S.; Shubik, M. A method for evaluating the distribution of power in a committee system. Amer. Pol. Sci. Rev. 1954 ,48, 787–792. [CrossRef] 5. Algaba, E.; Bilbao, J.M.; Fernández-García, J.R. The distribution of power in the European Constitution. Eur. J. Oper. Res. 2007 , 176, 1752–1766. [CrossRef] 6. Kóczy, L.A. Beyond Lisbon. Demographic trends and voting power in the European Union Council of Ministers. Math. Soc. Sci. 2012,63, 152–158. [CrossRef] 7. Kóczy, L.A. Brexit and Power in the Council of the European Union. Games 2021,12, 51. [CrossRef] 8. Kurz, S. Computing the power distribution in the IMF. arXiv 2016, arXiv:1603.01443. 9. Lucchetti R.; Radrizzani P. Microarray Data Analysis via Weighted Indices and Weighted Majority Games. In Computational Intelligence Methods for Bioinformatics and Biostatistics. CIBB 2009. Lecture Notes in Computer Science; Masulli, F., Peterson, L.E., Tagliaferri, R., Eds.; Springer: Berlin/Heidelberg, Germany, 2009; Volume 6160, pp. 179–190. [CrossRef] 10. Bachrach, Y.; Rosenschein, J.S.; Porat, E. Power and stability in connectivity games. In Proceedings of the 7th International Joint Conference on Autonomous Agents and Multiagent Systems, Estoril, Portugal, 12–16 May 2008; Volume 2, pp. 999–1006. 11. Stach, I.; Mercik, J.; Bertini, C. Some propositions of approaches for measuring indirect control power of firms and mutual connections in corporate shareholding structures. In Transactions on Computational Collective Intelligence XXXV. Lecture Notes in Computer Science; Nguyen, N.T., Kowalczyk, R., Mercik, J., Motylska-Ku´zma, A., Eds.; Springer: Berlin/Heidelberg, Germany, 2020; Volume 12330, pp. 116–132. [CrossRef] 12. Stach, I.; Mercik, J. Measurement of control power in corporate networks. Oper. Res. Dec. 2021,31, 97–121. [CrossRef] 13. Staudacher, J.; Olsson, L.; Stach, I. Implicit power indices for measuring indirect control in corporate structures. In Transactions on Computational Collective Intelligence XXXVI. Lecture Notes in Computer Science; Nguyen, N., Kowalczyk, R., Mercik, J., Motylska-Ku´zma, A., Eds.; Springer: Berlin/Heidelberg, Germany, 2021; Volume 13010, pp. 73–93. [CrossRef] 14. Holler, M.J.; Rupp, F. Power in Networks: A PGI Analysis of Krackhardt’s Kite Network. In In Transactions on Computational Collective Intelligence XXXIV. Lecture Notes in Computer Science; Nguyen, N., Kowalczyk, R., Mercik, J., Motylska-Ku´zma, A., Eds.; Springer: Berlin/Heidelberg, Germany, 2019; Volume 11890, pp. 21–34. [CrossRef] 15. Holler, M.J.; Rupp, F. Power in Networks: The Medici. Homo Oecon. 2021,38, 1–17. [CrossRef] 16. Vázquez-Brage, M.; van den Nouweland, A.; Garcıa-Jurado, I. Owen’s coalitional value and aircraft landing fees. Math. Soc. Sci. 1997,34, 273–286. [CrossRef] 17. Alonso-Meijide, J.M.; Bowles, C. Generating Functions for Coalitional Power Indices: An Application to the IMF. Ann. Oper. Res. 2005,137, 21–44. [CrossRef] 18. Alonso-Meijide, J.M.; Carreras, F.; Fiestras-Janeiro, M.G. The multilinear extension and the symmetric coalition Banzhaf value. Theory Decis. 2005,59, 111–126. [CrossRef] 19. Mayer, A. Luxembourg in the Early Days of the EEC: Null Player or Not? Games 2018,9, 29. [CrossRef] 20. Owen, G. Game Theory, 3rd ed.; Academic Press: London, UK, 1995. 21. Owen, G. Values of Games with a Priori Unions. In Mathematical Economics and Game Theory. Lecture Notes in Economics and Mathematical Systems; Henn R., Moeschlin, O., Eds.; Springer: Berlin/Heidelberg, Germany, 1977; Volume 141, pp. 76–88. [CrossRef] 22. Malawski, M. “Counting” Power Indices for Games with a Priori Unions. In Essays in Cooperative Games. Theory and Decision Library; Gambarelli, G., Eds.; Springer: Boston, MA, USA, 2004; Volume 36, pp. 125–140. [CrossRef] 23. Alonso-Meijide, J.M.; Bowles, C.; Holler, M.J.; Napel, S. Monotonicity of power in games with a priori unions. Theory Decis. 2009 , 66, 17–37. [CrossRef] 24. Alonso-Meijide, J.M.; Fiestras-Janeiro, M.G. Modification of the Banzhaf value for games with a coalition structure. Ann. Oper. Res. 2002,109, 213–227. [CrossRef] 25. Owen, G. Modification of the Banzhaf-Coleman Index for Games with a Priori Unions. In Power, Voting, and Voting Power; Holler, M.J., Eds.; Physica: Heidelberg, Germany, 1981; pp. 232–238. [CrossRef] 26. Matsui, Y.; Matsui, T. NP-completeness for calculating power indices of weighted majority games. Theor. Comp. Sci. 2001 ,263, 305–310. [CrossRef] 27. Algaba, E.; Bilbao, J.M.; Fernández-García, J.F.; López, J.J. Computing power indices in weighted multiple majority games. Math. Soc. Sci. 2003,46, 63–80. [CrossRef] Games 2022,13, 6 17 of 17 28. Bilbao, J.M.; Fernández-García, J.F.; Jiménez Losada, A.; López, J.J. Generating functions for computing power indices efficiently. TOP 2000,8, 191–213. [CrossRef] 29. Tanenbaum, P. Power in weighted voting games. Math. J. 1997,7, 58–63. 30. Matsui, T.; Matsui, Y. A survey of algorithms for calculating power indices of weighted majority games. J. Oper. Res. Soc. Jpn. 2000,43, 71–86. [CrossRef] 31. Uno, T. Efficient Computation of Power Indices for Weighted Majority Games. In International Symposium on Algorithms and Computation. ISAAC 2012. Lecture Notes in Computer Science; Chao, K.M., Hsu, T., Lee, D.T., Eds.; Springer: Berlin/Heidelberg, Germany, 2020; Volume 7676, pp. 679–689. [CrossRef] 32. Staudacher, J.; Kóczy, L.Á.; Stach, I.;Filipp, J.; Kramer, M.; Noffke, T.; Olsson, L.; Pichler, J.; Singer, T. Computing power indices for weighted voting games via dynamic programming. Oper. Res. Dec. 2021,31, 123–145. [CrossRef] 33. Johnston, R.J. On the measurement of power. Some reactions to Laver. Environ. Plan. A 1978,10, 907–914. [CrossRef] 34. Deegan, J.; Packel, E.W. A new index of power for simple n-person games. Int. J. Game Theory 1978,7, 113–123. [CrossRef] 35. Holler, M.J. Forming coalitions and measuring voting power. Pol. Stud. 1982,30, 262–271. [CrossRef] 36. Felsenthal, D.S. A well-behaved index of a priori p-power for simple n-person games. Homo Oecon. 2016 ,33, 367–381. [CrossRef] 37. Molinero, X.; Blasco, J. Coalitional power indices applied to voting systems. In Proceedings of the 9th International Conference on Operations Research and Enterprise Systems, Valletta, Malta, 22–24 February 2020; pp. 372–376. [CrossRef] 38. Mercik, J.; Ramsey, D.M. The effect of Brexit on the balance of power in the European Union Council: An approach based on pre-coalitions. In Transactions on Computational Collective Intelligence XXVII. Lecture Notes in Computer Science; Nguyen, N., Kowalczyk, R., Mercik, J., Eds.; Springer: Cham, Switzerland, 2017; Volume 10480, pp. 87–107. [CrossRef] 39. Chakravarty, S.R.; Mitra, M.; Sarkar, P. A Course on Cooperative Game Theory; Cambridge University Press: Cambridge, UK, 2015. 40. Molinero, X.; Riquelme, F.; Serna, M. Forms of representation for simple games: Sizes, conversions and equivalences. Math. Soc. Sci. 2015,76, 87–102. [CrossRef] 41. Laruelle, A.; Valenciano, F. On the meaning of Owen–Banzhaf coalitional value in voting situations. Theory Decis. 2004 ,56, 113–123. [CrossRef] 42. The GNU Multiple Precision Arithmetic Library. Available online: https://gmplib.org/ (accessed on 17 November 2021). 43. Alonso-Meijide, J.M.; Casas-Méndez, B.; Fiestras-Janeiro, M.G.; Holler, M.J. Two variations of the Public Good Index for games with a priori unions. Control. Cybern. 2010,39, 839–855. 44. Alonso-Meijide, J.M.; Casas-Méndez, B.; Fiestras-Janeiro, M.G.; Holler, M. J. The Deegan-Packel index for simple games with a priori unions. Qual. Quant. 2011,45, 425–439. [CrossRef] 45. Berghammer, R.; Bolus, S.; Rusinowska, A.; De Swart, H. A relation-algebraic approach to simple games. Eur. J. Oper. Res. 2011 , 210, 68–80. [CrossRef] 46. Berghammer, R.; Bolus, S. On the use of binary decision diagrams for solving problems on simple games. Eur. J. Oper. Res. 2012 , 222, 529–541. [CrossRef] 47. Bolus, S. Power indices of simple games and vector-weighted majority games by means of binary decision diagrams. Eur. J. Oper. Res. 2011,210, 258–272. [CrossRef] 48. Bolus, S. A QOBDD-Based Approach to Simple Games. Ph.D. Thesis, Christian-Albrechts Universität Kiel, Kiel, Germany, 2012. 49. Staudacher, J.; Anwander J. Using the R Package CoopGame for the Analysis, Solution and Visualization of Cooperative Games with Transferable Utility. R Vignette for Package Version 0.2.2. 2021. Available online: https://cran.r-project.org/package= CoopGame (accessed on 17 November 2021).