coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
518 stars 92 forks source link

JSSP documentation and examples/jssp.py do not solve the same problem #147

Open pimpom36 opened 3 years ago

pimpom36 commented 3 years ago

Hi,

I think the Job Shop Scheduling Problem described in the documentation on

https://github.com/coin-or/python-mip/blob/master/docs/examples.rst https://docs.python-mip.com/en/latest/examples.html

and the provided code do not solve the same optimization problem.

If my interpretation is correct, the code uses matrix times as a map between [job][machine] → processing time. This matches the definition of the input variable p_ij in the documentation: "non-negative integer processing time of job j in machine i"

In the code, times has the following values:

times = [[2, 1, 2],
         [1, 2, 2],
         [1, 2, 1]]

The documentation defines the processing times as

The processing order for each job is as follows (the processing time of each job in each machine is between parenthesis):

where the pattern of values in parenthesis matches matrix times. However, this pattern is a map between [job][processing step] → processing time.

To match the documentation with its figures to the code, I think times should be

times = [[1, 2, 2],
         [2, 1, 2],
         [1, 2, 1]]

Can anybody confirm this? Coincidentally, the two problems have the same optimal makespan 7.