Given a number of friends who have to give or take some amount of money from one another. Design an algorithm by which the total cash flow among all the friends is minimized.
-
In this application, you can find minimum cash flow between n people. Insert data in the table where cell represent the value person i has to pay to person j. On computing the result, you will get answer with minimum cash flow between persons.
-
This algo uses
#Graph
and#Greedy
method. Time complexity isO(n^2)
. Using min heap and max heap, the time complexity can be reduced toO(nlogn)
. -
The tech stack used to build this app is React Js.