I was once asked to code a people-matching function where participants had long "don't match me with her" lists and coded a very naive brute force solver that absolutely pegged the CPU on my dev box until I wised up that it was an NP-Hard problem.
I was once asked to code a people-matching function where participants had long "don't match me with her" lists and coded a very naive brute force solver that absolutely pegged the CPU on my dev box until I wised up that it was an NP-Hard problem.
Yeah, that's a different and larger problem space. A reservation-maximizing algo doesn't need to come up with a solution for all-vs-all, it only needs to solve for the new reservations you're trying to book vs what's already there; essentially one-vs-all. As it is, searching the tree can take 1-2 seconds in-browser on reasonable hardware, and that's with a good deal of pruning. Trying to massively re-optimize the whole calendar after the fact would be undesirable anyway, considering there are a lot of human choices being made along the way.