Originally posted by: SystemAdmin
[alan_a said:]
I have a cplex allocation problem.
One of my constraints is that I'm allocating tuples of y to tuples of x.
Each y is unique, there can be up to n y values in each x.
There is a concept of grouping of y such that (and forgive the javascript):
{string} bx = ...;
tuple y{
string bx;
some other stuff}
-snip-
{y} bset[bx];
execute{
for (var b in bx){
for (var g in y){
if (g.bx == b) bset[b].add(g);
}
}
}
Now my allocation requires that for each x allocation, the members of {y} in bset be unique.
Or to put it another way:
bx = {"A", "B"}
bset[bx] = [{"AA", "BB", "CC"}, {"DD", "EE", "FF"}
now every y with y.bx == "A" that is allocated to a particular x, must be either AA or BB or CC.
they may not mix.
I'm struggling to represent this.
My first attempt was sort of like this
forall(gt in y, g in y : (g != gt) && (g.bx == gt.bx))){
forall (u in x){
sum(<g, u> in my_dexpr) used[<g, u>] == 0 || sum(<gt, u> in my_dexpr) used[<gt, u>] == 0;
}
}
where used[<y, x>] is obviously the target here.
it sent the number of constraints and variables stratospheric.
it's obviously wrong.
anyone have any hints as to how to do this better?
#DecisionOptimization#MathematicalProgramming-General