Calculates each participant's net balance based on what they paid and what they owe. Afterwards, it matches debtors to creditors such that the total number of transactions is minimised.
Example: If Alice owes Bob $10 and Charlie owes Alice and Bob $10 each, instead of both Alice and Charlie making separate payments, Charlie can pay Bob $20 directly, simplifying the process.