Originally posted by: JorisK
Hey,
Answering your question without further details is rather complex. For example, which variables are you using in your model? Typically, for scheduling problems, either one of these three variables is chosen:
1. Time indexed. x_{gt}=
0,1 : product g is being processed at time t
Usually time indexed formulations perform very well, specially if your time horizon is small or can be partitioned into large intervals, e.g. partioning an horizon of 1 hour into 5 minute segments.
2. Assignment based formulation. x_{gi}=
0,1 if product g is the ith job being processed. If you are using multiple machines, you could use: x_{gij}: product g is the ith job being processed on machine j.
3. A flow based formulation: x_{gh}=
0,1: product g is processed directly before h. (equivalent: x_{ghj} product g is processed directly before product h on machine j).
Lets assume you chose the 3th option, and you know the width of each product. Lets denote the width of product g width w_g. Then your objective could be: minimize \sum_{g\in G}\sum{h\in {G-g}} (w_g-w_h)*x_{gh}
Here G is your set with products.
The above objective is not 100% correct. The one thing you cannot really do is to take the absolute value of a calculation (that is a non-linear operation which is not possible is linear optimization). So if w_g is smaller than w_h, you have a problem. Nevertheless, this is easily fixed in the above objective by ordering the set G. Since (w_g-w_h) only uses constants, you simply make sure they are in the correct order when you write down the objective.
Similar objectives can be created using the other two types of variables.
#ConstraintProgramming-General#DecisionOptimization