Forum » Support » Shuffle Debts

Is there a way to shuffle debts between contacts or a context group? If not, is that feature coming soon?
unfortunately it is currently not possible to shuffle debts. i'm also not sure about the best way to implement it.. there are two ways i could imagine .. 1.) shuffling within a context group - ie. all debts of those transactions in a shared context group are added up and evened out (as far as possible) 2.) even out debts between all contacts, no matter where those debts have been created.
the second is obviously the far easier way and is much easier to understand.. what would be your use case? shuffle debts to decrease the number of people who have debts with each other?
Herby,

I was imagining scenario 1 more than scenario 2. Currently billmonk lets you shuffle debts between any contacts (which can be annoying, to your point). It does not let you turn shuffling on or off for specific contacts; it only has an overall shuffling on/off switch.

Would it be possible to implement shuffling in a context group only? It may be more difficult but I think the code shouldn't be too hard. The reason is that this is the biggest holdup my group of friends (and others I've talked to) have with switching over from Billmonk. They like the debt shuffle feature so it would be great to get this on Tabsplit and start using it. And yes, the point would be to decrease the total debts outstanding.

Thanks,

Prashant

--- Last Edited by Prashant Shukla at 2012-07-27 20:35:15 ---
Hey,
sorry for the late answer, i have been busy on other projects (damn deadlines ;) ) - i wonder how you imagine shuffling within a context group.. because i think the way to implement it would be to eval out all transactions within that context group, which means you would have to assign all transactions to a given context group.. is that what you mean? i certainly have to add a mass-update for context group from the list of transactions anyway, but i wonder if that's really the most useful way to do shuffling.. (since it won't necessarily reduce the amount of people having debts with each other, just within a given context group.. (two people could still have debts with each other because of transactions in another group)

ad annoying: i have quite a few friends who hate the shuffling feature in billmonk, hehe - i guess a requirement for the implementation in tabsplit will be that all affected contacts have to confirm the shuffle before it is actually done. no matter if it'll be within a context group, or global
Hi Herby,

You're right, it may not decrease the # of debts or totals outside of a context group, but for the most part all our transactions involve people in our "context group" on something like Billmonk. Implicitly, everyone in the context group knows each other and is OK shuffling debts (to address the annoying point). And while the feature wouldn't work globally, it would help tremendously within a context group (to decrease # and total amount of debts).
okay, i guess i'll try to implement it for context groups first.. but all in all it shouldn't be much different than to implement it globally, so maybe i'll introduce that later..

but it will probably take a while for me to come up with a useful shuffle algorithm that makes sense ;)
Thanks Herby. You might try asking billmonk for their algorithm =).

But in all seriousness, thanks for the responses and the effort to add features. Let me know if there's any way I can help and I'm looking forward to the shuffle feature!

How many people are working on TabSplit with you?
well, most of the time i'm on my own - although i have a few helping hands once in a while :)

hmm.. if you happen to like a coding challenge.. i've broken shuffling down into a quite simple input.. a simple 2d array describing the relations between users. 'count' beeing the number of transactions they had (so it's possible to shuffle debts away from those with the least transactions) and 'amount' beeing the sum of the debts between two users. (so 200 is debt ie the user owes the other person, -200 the other user owes the current one.)

[
[{'count': 0, 'amount': 0}, {'count': 5, 'amount': 300}, {'count': 4, 'amount': -100}], 
[{'count': 5, 'amount': -300}, {'count': 0, 'amount': 0}, {'count': 3, 'amount': -200}], 
[{'count': 4, 'amount': 100}, {'count': 3, 'amount': 200}, {'count': 0, 'amount': 0}]
]


so in this example user 0 and user 2 have input[0][2] = 4 transactions and user 2 owes user 0: 100 cents

so i think the correct way for this example is taking the two users with the least transations (1 and 2) and shuffle away their debt.. (user 2 owes user 1) ie. the three transactions would be: 2 -> 1: 200 (eliminating the debt), 1 -> 0: 200 and 0 -> 2: 200.. so the debt has moved in a circle .. and 1 is getting it's 200 from 0 instead of 2..

before:
0->1: 300
0->2: -100
1->2: 200

after:
0->1: 500
0->2: -300
1->2: zero

i think this seems to be the most promising approach.. taking the connection with the least transactions and trying to shuffle the debt in a circle.. as long as enough people have debts with each other it should work.. :-)

Bitte loggen Sie sich ein um eine antwort zu verfassen.

Feedback