Suppose we need to sequence n jobs where each job has a cost ai. In addition there is a changeover cost ci,j when job i immediately precedes job j (see this post).
First observe that the cost ∑iai form just a constant (we need to execute each job exactly once), so we can leave them out of the model.
For some the remaining problem may look like a TSP (Traveling Salesman Problem), except we don’t need to return to the city where we started from. We can also look at it differently.
The task of assigning jobs to periods is just like an assignment problem:
xi,t∈{0,1}∑txi,t=1∀i∑ixi,t=1∀t |
This was the easy part. To see if a job j immediately follows a job i, we can do something like:
yi,j∈{0,1}yi,j=∑txi,txj,t+1 |
The sum gives us either 0 or 1 for feasible integer solutions. A slightly different formulation turns out to be easier to handle:
yi,j∈{0,1}yi,j≥xi,txj,t+1∀t |
We let yi,j float unrestricted if j is never a successor to i. In that case, we leave it to the objective to choose yi,j=0 when needed.
We can linearize the last inequality by yi,j≥xi,t+xj,t+1–1. Once we have yi,j the objective is obvious: minimize ∑i,jci,jyi,j.
The complete model can look like:
In the model we paid some attention to excluding cases where i=j. Note that with ci,i=0 we just could leave out this exclusion, but I always prefer to model these things a bit more precise. The results for random ci,j are:
No comments:
Post a Comment