Crap, I wish I had paid more attention in my CS classes. No recollection of max flow whatsoever. Google is extremely unhelpful. So what's the range for X and how does it depend on merit? Can it be negative? How big is N - that's only users who have custom trust lists, right? I feel like I'm missing something obvious here.
https://en.wikipedia.org/wiki/Max_flowhttps://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithmNote that you can require a "minimum flow" per edge and still be the same problem, but that refers to
requiring that much flow, where 0 is not allowed.
My intuition is that with my "0 or 10" requirement, it becomes the (NP-hard) knapsack problem. There are good approximations for that, though.
I was thinking that X = earned_merit intdiv (10 or 250), but I'm not sure.
N = all users who match the current truster criteria, either 10 or 250 earned merit. The "excluding merit sent by the trustee" thing couldn't be added here AFAICT, and would have to just limit users allowed into this step. M = the number of distinct users trusted by the users on the left side.