|
| 1 | +# *Matlab* Toolbox *MatTuGames* Version 1.0.0 |
| 2 | + |
| 3 | +## 1. Introduction |
| 4 | + |
| 5 | +The game theoretical *Matlab* toolbox *MatTuGames* provides about 230 functions |
| 6 | +for modeling, and calculating some solutions as well as properties of cooperative |
| 7 | +games with transferable utilities. In contrast to existing Matlab toolboxes to |
| 8 | +investigate TU-games, which are written in a C/C++ programming style with the consequence |
| 9 | +that these functions are executed relatively slowly, we heavily relied on vectorized |
| 10 | +constructs in order to write more efficient Matlab functions. In particular, the toolbox |
| 11 | +provides functions to compute the (pre-)kernel, (pre-)nucleolus, and anti (pre-)kernel |
| 12 | +as well as game values like the Banzhaf, Myerson, Owen, position, Shapley, solidarity, |
| 13 | +and coalition solidarity value and much more. In addition, we will discuss how one can |
| 14 | +use *Matlab's Parallel Computing Toolbox* in connection with this toolbox to benefit |
| 15 | +from a gain in performance by launching supplementary Matlab workers. Some information |
| 16 | +are provided how to call our *Mathematica* package *TuGames* within a running Matlab session. |
| 17 | + |
| 18 | +## 2. Getting started: |
| 19 | +In order to get some insight how to analyze a cooperative game, |
| 20 | +a so-called transferable utility game with the Game Theory Toolbox |
| 21 | +*MatTuGames*, we discuss a small example to demonstrate how one can |
| 22 | +compute some game properties or solution concepts, like convexity, |
| 23 | +the Shapley value, the (pre-)nucleolus or a pre-kernel element. |
| 24 | + |
| 25 | +For this purpose, consider a situation where an estate is insufficient |
| 26 | +to meet simultaneously all of the debts/claims of a set of claimants, |
| 27 | +such a situation is known in game theory as a bankruptcy problem. |
| 28 | +The problem is now to find a fair/stable distribution in the sense that |
| 29 | +no claimant/creditor can find an argument to obstruct the proposed division |
| 30 | +to satisfy at least partly the mutual inconsistent claims of the creditors. |
| 31 | +In a first step, we define a bankruptcy situation while specifying |
| 32 | +the debts vector and the estate that can be distributed to the |
| 33 | +creditors. We restrict our example to a six-person bankruptcy problem |
| 34 | +with a debts vector given by |
| 35 | + |
| 36 | +``` |
| 37 | +>> d = [40.0000 32.0000 11.0000 73.3000 54.9500 81.1000]; |
| 38 | +``` |
| 39 | + |
| 40 | +and an estate value which is equal to |
| 41 | + |
| 42 | +``` |
| 43 | +>> E = 176; |
| 44 | +``` |
| 45 | + |
| 46 | +We observe immediately that the estate `E` is insufficient to meet all |
| 47 | +of the claims simultaneously. It should be obvious that with these values |
| 48 | +we do not have defined a cooperative game, however, these information |
| 49 | +are enough to compute a proposal how to divide the estate between the |
| 50 | +creditors. A fair division rule which is proposed by the Babylonian Talmud, |
| 51 | +is given by |
| 52 | + |
| 53 | +``` |
| 54 | +>> tlm_rl=Talmudic_Rule(E,d) |
| 55 | +>> |
| 56 | +tlm_rl = |
| 57 | +
|
| 58 | +20.0000 16.0000 5.5000 48.3500 30.0000 56.1500 |
| 59 | +``` |
| 60 | + |
| 61 | +However, this distribution rule does not incorporate the coalition formation |
| 62 | +process. Thus, we might get a different outcome when we consider the |
| 63 | +possibility that agents can form coalitions to better enforce their claims. |
| 64 | +This means, we have to study the corresponding cooperative game. This can |
| 65 | +be constructed while calling the following function |
| 66 | + |
| 67 | +``` |
| 68 | +>> bv=bankruptcy_game(E,d); |
| 69 | +``` |
| 70 | + |
| 71 | +Having generated a game, we can check some game properties like convexity |
| 72 | + |
| 73 | +``` |
| 74 | +>> cvQ=convex_gameQ(bv) |
| 75 | +>> |
| 76 | +cvQ = |
| 77 | +
|
| 78 | +1 |
| 79 | +``` |
| 80 | + |
| 81 | +The returned logical value indicates that this game is indeed convex. This must |
| 82 | +be the case for bankruptcy games. In addition, we can also verify if the |
| 83 | +core of the game is non-empty or empty. To see this one needs just to invoke |
| 84 | + |
| 85 | +``` |
| 86 | +>> crQ=coreQ(bv) |
| 87 | +>> Optimization terminated. |
| 88 | +
|
| 89 | +crQ = |
| 90 | +
|
| 91 | +1 |
| 92 | +``` |
| 93 | + |
| 94 | +which is answered by affirmation. This result confirms our expectation, since each |
| 95 | +convex game has a non-empty core. |
| 96 | + |
| 97 | +After this short introduction of game properties, we turn our attention now |
| 98 | +to some well known solution concepts from game theory. We start with the |
| 99 | +Shapley value, which can be computed by |
| 100 | + |
| 101 | +``` |
| 102 | +>> sh_v=ShapleyValue(bv) |
| 103 | +>> |
| 104 | +sh_v = |
| 105 | +
|
| 106 | +23.5175 18.7483 6.4950 44.3008 33.3317 49.6067 |
| 107 | +``` |
| 108 | + |
| 109 | +A pre-kernel element can be computed with the function |
| 110 | + |
| 111 | +``` |
| 112 | +>> prk_v=PreKernel(bv) |
| 113 | +>> |
| 114 | +prk_v = |
| 115 | +
|
| 116 | +20.0000 16.0000 5.5000 48.3500 30.0000 56.1500 |
| 117 | +``` |
| 118 | + |
| 119 | +which must be identical to the distributional law of justice proposed by the Talmudic |
| 120 | +rule. Moreover, it must also coincides with the nucleolus due to the convexity |
| 121 | +of the game. To see this, let us compute first the nucleolus and in the next |
| 122 | +step the pre-nucleolus |
| 123 | + |
| 124 | +``` |
| 125 | +>> nc_bv=nucl(bv) |
| 126 | +
|
| 127 | +nc_bv = |
| 128 | +
|
| 129 | +20.0000 16.0000 5.5000 48.3500 30.0000 56.1500 |
| 130 | +
|
| 131 | +>> pn_bv=PreNucl(bv) |
| 132 | +
|
| 133 | +pn_bv = |
| 134 | +
|
| 135 | +20.0000 16.0000 5.5000 48.3500 30.0000 56.1500 |
| 136 | +``` |
| 137 | + |
| 138 | +We observe that both solutions coincide, which must be the case for zero-monotonic games. |
| 139 | +To check that these solutions are indeed the pre-nucleolus can be verified by Kohlberg's |
| 140 | +criterion |
| 141 | + |
| 142 | +``` |
| 143 | +>> balancedCollectionQ(bv,pn_bv) |
| 144 | +
|
| 145 | +ans = |
| 146 | +
|
| 147 | +1 |
| 148 | +
|
| 149 | +>> balancedCollectionQ(bv,nc_bv) |
| 150 | +
|
| 151 | +ans = |
| 152 | +
|
| 153 | +1 |
| 154 | +``` |
| 155 | + |
| 156 | +Finally, to verify that the solution found is really a pre-kernel element can be done while typing |
| 157 | + |
| 158 | +``` |
| 159 | +>> prkQ=PrekernelQ(bv,prk_v) |
| 160 | +>> |
| 161 | +prkQ = |
| 162 | +
|
| 163 | +1 |
| 164 | +``` |
| 165 | +For a deeper discussion of the function set provided by the toolbox consult the Manual |
| 166 | +or type help mat_tug to get a short overview. |
| 167 | + |
| 168 | +## 4. Custom Installation |
| 169 | + |
| 170 | +To install the toolbox we recommend a custom installation while following the instructions that are given at the URL: |
| 171 | + |
| 172 | +[mltbx](https://mathworks.com/matlabcentral/answers/242430-how-do-i-install-a-mltbx-file-from-the-filesharing-site-into-r2015a) |
| 173 | + |
| 174 | +A mltbx file is provided in the Release section. |
| 175 | + |
| 176 | +## 5. Acknowledgment |
| 177 | + |
| 178 | + |
| 179 | +The author acknowledges support by the state of Baden-Württemberg through bwHPC. |
| 180 | + |
| 181 | +Of course, the usual disclaimer applies. |
| 182 | + |
| 183 | +## 6. License |
| 184 | + |
| 185 | +This project is licensed under the FreeBSD License - see the [LICENSE](LICENSE.md) file. |
| 186 | + |
| 187 | +## Author |
| 188 | + |
| 189 | +** Holger I. Meinhardt ** |
| 190 | +Institute of Operations Research |
| 191 | +University of Karlsruhe (KIT) |
| 192 | +E-mail: Holger.Meinhardt@wiwi.uni-karlsruhe.de |
| 193 | + holger.meinhardt@partner.kit.edu |
0 commit comments