Guides & How-Tosminimum settlementalgorithmexpense splitting

How the Minimum-Settlement Algorithm Works (With a Real Example)

Kona4 min read
Table of contents
Person writing calculation notes in a notebook with a smartphone showing the settlement screen

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

Receipt and smartphone flat lay on a wooden surface

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 byItemAmount
ALunch (everyone)$55
BTransportation (everyone)$20
CDinner (everyone)$80
DAccommodation (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:

PersonAmount frontedFair shareNet 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:

  1. B (−$55) → D (+$70): B sends $55 to D. B is done. D's remaining balance: +$15.
  2. A (−$20) → D (+$15): A sends $15 to D. D is done. A's remaining balance: −$5.
  3. 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.

Transfers needed, 4-person group
One-to-one settling6 transfersMinimum-settlement algorithm3 transfers

Why This Always Works

Close-up of a smartphone app screen showing a clean settlement list

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 sizeOne-to-one maxMinimum-settlement max
4 people6 transfers3 transfers
6 people15 transfers5 transfers
10 people45 transfers9 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.

Found this helpful? Share it!

Try WariSaku — Free & Instant

No sign-up. No install. Just open and go.

Create a Group →

Related articles