I am working on a problem that involves distributing a set of N supplements across a predefined number of meals (M) in a way that maximizes the total number of positive interactions and minimizes negative interactions between the supplements. Each interaction between the supplements is known beforehand (positive, neutral or negative: see the image below).
I'm seeking advice on the mathematical formulation of this problem and potential algorithms or tools that could be used to solve it. Here's what I came up with:
- We can build a graph G from table of compatibility, with edges 1/0/-1 for positive, neutral and negative interactions correspondingly
- Then we can remove -1 edges completely
- Now we have modified graph G' with 0/1 edges only (see the image below)
- And we want to cover it with M cliques (bc clique in this graph will guarantee no 'bad' connections), finding a coverage with maximum number of +1 green edges
This method is not very good because:
- it doesn't consider using -1 red edges at all while building meals
- it has a very big time complexity (hours or days for 1 calculation on ~20 supplements)
I'm open for any suggestions. Maybe there are existing algorithms for solving this problem, or tools (like solvers)? Or is there a name for this problem I could search algorithms for?
If you don't mind, I will not close this topic for 2-3 days, maybe someone will suggest any known algorithms for solving this problem, because it is very similar to clique, set cover.
– essacult Feb 09 '24 at 17:58