Originally posted by: Sultan_Niz7755
Hi, Daniel,
Thank you so much for your reply. I'm actually new to Cplex, I'm not really that pure. I understood Column Generation to mean that I first have to create compact model, then master and subproblem. And then to connect all the models together, I need the Main function, right? The column-oriented formulation of the model confuses me all the time. In the Cutting Stock example, only a dual variable pi was inserted, but in my case I have to define that the above 4 variables are optimal dual variables for my restricted master problem. These optimal dual variables I need to apply to my pricing problem to have the solution to the subproblem. Hier ist my OPL Code for Master Problem:
int N = ...;// Number of Patients
int j = ...; // Number of tasks
range Patient = 1..N;
range Task = 1..j;
int P = ...; // Number of Porters
range Porter = 1..P;
int R = ...; // Number of Operating rooms
range Room = 1..R;
int B = ...; // Number of recovery beds
range Bed = 1..B;
int Period = ...;
range H = 0..Period-1; // discrete Time horizon of H Periods, The discrete Time unit is set equal to 10 Minutes
int A = ...;
range K = 1..A;
int p[Patient, Task] = ...;
dvar float+ c[K];
dvar boolean x[Patient, K];//1,if column k is related to patient i
dvar int+ s[K,Task];//starting time of the task j according to column k
dvar int+ y[K];//let y(k) for k€K be a binary decision variable that takes 1 if the feasible column k is selected and 0 otherwise
dvar boolean u[H,K];
dvar boolean v[H,K];
dvar boolean w[H,K];
minimize sum (k in K)c[k]*y[k];
subject to {
forall (k in K) c[k] == s[k,4] + (sum (i in Patient) x[i,k]*p[i,4]);
forall (i in Patient, k in K, t in H) u[t,k] == (((s[k, 1] <= t) && (s[k, 1] + p[i, 1] - 1) >= t) + ((s[k, 4] <= t) && (s[k, 4] + p[i, 4] - 1) >= t));
forall (i in Patient, k in K, t in H) v[t,k] == ((s[k, 2] <= t) && (s[k, 2] + p[i, 2] + p[i,5] - 1) >= t);
forall (i in Patient, k in K, t in H) u[t,k] == ((s[k, 4] <= t) && (s[k, 4] + p[i, 4] - 1) >= t);
forall (i in Patient) sum (k in K) (x[i,k]*y[k]) == 1;
forall (t in H, pi in Porter) sum (k in K) u[t,k]*y[k] <= pi;
forall (t in H, r in Room) sum (k in K) v[t,k]*y[k] <= r;
forall (t in H, b in Bed) sum (k in K) w[t,k]*y[k] <= b;
}
and here pricing problem
thank you again,
regards Sherzod
#CPLEXOptimizers#DecisionOptimization