Smart Debt Settler
Splitting bills after a night out with friends gets messy fast. When different people cover different expenses, and costs aren’t divided evenly, figuring out who owes what becomes exponentially harder as the group and number of bills grow. This frustrated me enough that I built an algorithm to automate the process entirely.
I built a tool that uses a max heap and min heap to outline the minimum payments needed for everyone to settle up within seconds (Method from this video), saving countless hours of my life in the future. This function is similar to Splitwise’s debt simplification feature, but Splitwise requires all users to have downloaded their app in order to use this. I can perform this debt simplification independently using my tool.
I initially considered using the Ford-Fulkerson algorithm to perform this (based on this article about Splitwise’s debt simplication method), but in the end I thought this was a little overkill and found it much easier to just use heaps to accomplish the same thing. I also used ChatGPT to handle the UI/data input code because I wanted to focus more on the data handling rather than how to parse the text inputs.
Check out the project on GitHub.
Enjoy Reading This Article?
Here are some more articles you might like to read next: