How debt simplification minimizes transfers
After you log your expenses, the calculator turns a tangled web of IOUs into the smallest possible set of payments. This technique is called debt simplification.
1. Compute each person’s net balance
For every person we subtract what they owe (their share of each expense) from what they paid. A positive balance means they are owed money; a negative balance means they owe money.
2. Pair the largest debtor with the largest creditor
The person who owes the most is matched with the person who is owed the most. A single transfer settles as much of both balances as possible.
3. Repeat until everyone is at zero
After each match, the smaller of the two balances is cancelled and removed, then we move to the next largest pair. This greedy approach guarantees the fewest transfers.