DFIELDSOLUTIONS

Free software

LabTessera: Settle up with the fewest moves

Net everyone to a single balance in integer cents, then greedily match creditors to debtors - at most n−1 transfers. 10 tested invariants keep the books exact.

Free software1 sections · 2 min readBy Dezső Mező.mdFree softwareTessera

Tessera settles shared expenses among a group with the fewest possible transfers. It nets everyone down to a single balance in integer cents, then greedily matches creditors to debtors, guaranteeing at most n-1 transfers. It is a from-scratch, dependency-light build whose books are kept exact by 10 tested invariants, and you can download and run it locally.

01About the app

A real algorithm over multi-person state

What to take away

  • Net everyone to a single balance in integer cents, then greedily match creditors to debtors - at most n−1 transfers. 10 tested invariants keep the books exact.
  • Download: Tessera (ZIP)
We build this for clientsFull-stack

Read the full write-up

More from the lab

Browse all entries

Want this looked at on your own system?Start a conversation

5.0
“New shop, more orders in the first week.”Müller Márk · GeekCornerManaging Director · Hungary