After celebrating the new year, me and my pals wanted to split the costs of our mischief. I started wondering about the best way to toss money around, i.e. a way to systematically minimise the amount of transactions. So the problem is that everyone should pay equally, even though one or few have already payed for the bills.
The obvious worst case scenario is that for $p$ people out of $n$ that have payed for something, the other $n-1$ pay for their share, $p$ times. If a single person pays for everything, the solution is easy enough: everyone pays for their share. For 2 out of $n$ people my best guess is this. First we total the money spent. Then one of the two pays the other such that they only pay for their share. The others pay the first guy as previously. This can be generalised. For $p$ out of $n$ that do the spending, let's choose 1 that is the hub of all transactions. Again, let's combine the total costs of everything, and let the chosen hub equalise the loss or win of those that payed something. Finally $n-p$ people simply pay for their share.
Is this the optimal strategy?
In a special case, where for example the non-hub spender spent 16 € and the share is 8 €, one of the people can pay their share to the non-hub, eliminating a transaction with the hub. But any amount that doesn't exactly get the spending of a non-hub equal to the share doesn't help.
I know this is neither the trickiest of questions nor one of utmost importance, but I thought someone might enjoy giving it a go. Happy New Year!