How to model DummyJobs
Awaiting user inputHello :),
since I am new to Gurobi I have a question regarding how to model a Dummy Job in Gurobi for a distributed permutation flow shop scheduling problem. I tried to model the minimal sequence based model from Naderi & Ruiz (2010) (The distributed permutation flow shop scheduling problem).
There is a need to define dummy jobs that preceed the first job in order to calculate the makespan correctly. A valid solution would be the following sequence for a scheduling problem of 5 jobs and 2 factories.
[0, 3, 2, 0, 1, 5, 4]
Thereby the jobs 0 are the dummy jobs that separate the sequences in each factory. Jobs 3 and 2 are manufactured in factory 1 and jobs 1, 5 and 4 are manufactured in factory 2.
In theory thats crystal clear. I only face problems how the syntax has to be for generating a valid model with dummy jobs. One problem I face is conflicts regarding the indexing:
I defined a binary variable that starts at index to incorporate the dummy jobs.
The problem is when modelling the dummy jobs this way, i get into trouble with the processing times, since indexing in Python starts with zero. At index zero there are the processing times of job 1. The problem is, when i define the processing times of the dummy job as additional job
-
Hi Martin,
From your post I assume that you don't need help with the modeling part but rather with the choice of correct indexing of your variables, is this correct?
You don't have to use integer values for variable indices only. You could define your jobs + the dummy job as
import gurobipy as gpm = gp.Model()
NumberOfJobs=10
indices = ["dummy"]
for i in range(NumberOfJobs):
indices.append(i)
x = m.addVars(indices)
# access variables
print(x["dummy"])
print(x[0])More often it is best to introduce a separate individual variable for special values, such as the dummy job in your case. So introducing an individual variable \(x_{d}\) might make modeling of your problem easier.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment