0

My question is similar to this one:

Ford-Fulkerson algorithm with "weighted" edges

However, I incorporate minimum and maximum capacities for assignments. Not only do the edges have a weight ("training"), and that every student must be assigned, but that some assignments will have no students assigned to them and some assignments will be at their maximum capacity of students while all others will at least be at their minimum.

proc optmodel;
set Students = {'S1', 'S2', 'S3', 'S4', 'S5', 'S6'}; 
set Projects = {'P1', 'P2', 'P3'};   

number projMinCapacity{Projects} = [2, 2, 2];
number projMaxCapacity{Projects} = [3, 3, 3];

number ranking{Students, Projects} = [ 
1 2 0
2 1 0
0 1 2
2 1 0
1 0 2
2 0 1
];

var flow{Students, Projects} binary;

maximize z = sum{s in Students, p in Projects}(flow[s, p]*(ranking[s, p]));

con sumPerStudent{s in Students} : sum{ p in Projects}flow[s,p] = 1;
con maxFlow{p in Projects} : sum{s in Students}flow[s,p] <= projMaxCapacity[p];
con minFlow{p in Projects} : sum{s in Students}flow[s,p] >= projMinCapacity[p];

solve;
print z flow;
quit;

^I have included here my working implementation in SAS Studio as a PoC, but for my project I need something that can be incorporated into a web app.

So I tried messing with PuLP, but my Python is a bit rusty so I would really appreciate a Java implementation. Are there libraries that I can easily do this with? Otherwise a good reference implementation for a problem with identical requirements?

Thank you!

  • Questions asking us to recommend or find a software library are off-topic for Stack Overflow as they tend to attract opinionated answers and spam – Michael Nov 02 '18 at 10:54
  • Duplicate of https://stackoverflow.com/questions/260442/linear-programming-tool-libraries-for-java – Michael Nov 02 '18 at 10:56

0 Answers0