You can login if you already have an account or register by clicking the button below.
Registering is free and all you need is a username and password. We never ask you for your e-mail.
You can model it as a directed graph, your edges are compatible donations (donor -> patient) and family relations (patient -> family member). People who donate and don't want anything in return have incoming edges from all patients.
Then you can pick a patient A and use Dijkstra's algorithm to find the shortest path A -> A. That should give you a chain of trades.
view the rest of the comments →
[–] CaptainParanoia 0 points 2 points 2 points (+2|-0) ago (edited ago)
You can model it as a directed graph, your edges are compatible donations (donor -> patient) and family relations (patient -> family member). People who donate and don't want anything in return have incoming edges from all patients.
Then you can pick a patient A and use Dijkstra's algorithm to find the shortest path A -> A. That should give you a chain of trades.