How the Minimum-Settlement Algorithm Works (With a Real Example)
Table of contents
If you've ever settled up in a group by having each person pay back each person they owe, you've experienced the problem: the more people involved, the more individual transfers pile up. Four people can generate up to six separate transfers; ten people, up to forty-five. The minimum-settlement algorithm is the mathematical fix, and it's what WariSaku uses under the hood. The math is nothing more than addition and subtraction — walk through it once with real numbers and it clicks.
What the Algorithm Does
The minimum-settlement algorithm takes all the individual payments in a group, figures out each person's net position (how much they're owed or how much they owe), and then finds the fewest possible transfers to zero everyone out.
Instead of "each person pays back each person they borrowed from," it asks: "ignoring the history of who paid what, what's the smallest number of transfers that balances everyone?"
The answer turns out to always be at most N−1 transfers for a group of N people.
The Problem It Solves: A 4-Person Example
Say four people — A, B, C, and D — take a typical weekend group trip together. Here's what each person paid for:
| Paid by | Item | Amount |
|---|---|---|
| A | Lunch (everyone) | $55 |
| B | Transportation (everyone) | $20 |
| C | Dinner (everyone) | $80 |
| D | Accommodation (everyone) | $145 |
Total: $300. Split four ways: $75 each.
Traditional One-to-One Settlement
In the naive approach, each person pays back each person they owe directly. Even after canceling out what each pair owes one another, four people still leave up to six separate transfers — one per pair, or N×(N−1)÷2. Money also takes detours: A collects from B while simultaneously paying C and D. All those hops add up, especially when payment apps charge transaction fees.
With the Minimum-Settlement Algorithm
First, calculate each person's net position — how much they overpaid or underpaid relative to their fair share:
| Person | Amount fronted | Fair share | Net position |
|---|---|---|---|
| A | $55 | $75 | −$20 (owes) |
| B | $20 | $75 | −$55 (owes) |
| C | $80 | $75 | +$5 (owed to) |
| D | $145 | $75 | +$70 (owed to) |
Now, match the person who owes the most with the person who's owed the most, and so on:
- B (−$55) → D (+$70): B sends $55 to D. B is done. D's remaining balance: +$15.
- A (−$20) → D (+$15): A sends $15 to D. D is done. A's remaining balance: −$5.
- A (−$5) → C (+$5): A sends $5 to C. Everyone is at zero.
With the minimum-settlement algorithm, a four-person group needs at most 3 transfers instead of 6 — half the payments of one-to-one settling.
Why This Always Works
The algorithm works because of a simple mathematical guarantee: in any group where everyone splits a shared total, the sum of all "owed" amounts exactly equals the sum of all "owes" amounts. The books balance by definition.
Because the totals always match, you can always clear the largest outstanding debt in a single transfer — and each transfer eliminates at least one person from the equation. With minimum settlement, a group of N people never needs more than N−1 transfers.
In practice, the number is often even lower. If two people's net positions happen to cancel each other out exactly, they settle directly and both drop out immediately.
| Group size | One-to-one max | Minimum-settlement max |
|---|---|---|
| 4 people | 6 transfers | 3 transfers |
| 6 people | 15 transfers | 5 transfers |
| 10 people | 45 transfers | 9 transfers |
WariSaku's Settlement view runs this calculation automatically and displays the result — who sends what amount to whom. No manual math needed. The whole flow, from creating a group to reading the settlement, is covered in the WariSaku four-step guide.
Frequently Asked Questions
Q: What if the split isn't equal?
The algorithm works the same way. Weighted splits (where some members pay more or less than others) just change the "fair share" numbers used to compute each person's net position. After that, the same logic applies.
Q: What about rounding?
When amounts don't divide evenly, WariSaku applies your group's rounding setting (to the nearest cent, $1, $5, or $10) before calculating the settlement. This can adjust some net positions by a small amount, but the algorithm still minimizes transfers within those rounded amounts.
Q: Does the order of transfers matter?
No. The algorithm specifies who sends what to whom, but not the sequence. Everyone can transfer simultaneously, or in any order — the end result is the same.
Q: Does it work if someone pays for a subset of the group?
Yes. Each expense in WariSaku lets you specify which members it covers. The algorithm accounts for this — the net position for each member only reflects expenses they were part of.
Wrap-Up
The minimum-settlement algorithm turns a messy web of transfers into the smallest possible set of direct payments. The N−1 ceiling is the part worth remembering: unlike one-to-one settling, where transfers grow with the square of the group size, the count never grows faster than the group itself.
When you're picking a bill-splitting app, check whether it actually implements minimum settlement. The difference between punching a calculator after every trip and just opening a screen gets bigger with every person you add.
Related articles

Guides & How-Tos
WariSaku Complete Guide: Start Splitting Costs in Seconds — No Account Needed
May 28, 2026

Travel & Events
Group Travel Made Easy: 3 Real Scenarios Where WariSaku Handles the Splitting
May 28, 2026

Travel & Events
International Trip with Friends? Here's How to Handle the Currency Chaos
May 28, 2026