Skip to content

Re-creation of the Tricount algorithm, whose goal is to reduce amount of transactions when a group of friends owes each other money

Notifications You must be signed in to change notification settings

gondyb/tricount-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Tricount algorithm

Python implementatio of the Tricount's algorithm.

The goal of this algorithm is to omptimize the amount of transactions in a group of friends where each other owes each other money.

In my implementation:

  • Benjamin owes 10 € to Gaston, 20 € to Valentin and 50 € to Theo
  • Valentin owes 30 € to Benjamin, 90 € to Gaston and 40 € to Theo
  • Gaston owes 70 € to Benjamin, 35 € to Valentin and 20 € to Theo
  • Theo owes 10 € to Benjamin, 30 € to Valentin and 20 € to Gaston

When we run the script, we can see that in the end, only three transactions are needed:

  • Valentin owes Theo 50 €
  • Valentin owes Benjamin 30 €
  • Valentin owes Gaston 5 €

About

Re-creation of the Tricount algorithm, whose goal is to reduce amount of transactions when a group of friends owes each other money

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages