Job Shop Problem - Ranking Not Working Correctly

168 views
Skip to first unread message

Adam Stuckey

unread,
Mar 10, 2023, 9:13:52 AM3/10/23
to or-tools-discuss
Hi,

Here is some context:
I'm working through a job shop problem with alternatives and ranking. The main customization is that there are groups of jobs that must be done in succession. The order of the jobs within a group of jobs doesn't matter, but the fact that they go in succession is a requirement. My constraints can't seem to support this. 

Is there a standard way to set this up? You'll see in my code that I've set up rankings of jobs by machine and I require all the jobs within a group to fall within a certain ranking range to make sure they happen in succession. The ranking is working, but my enforcement of them going immediately after each other. Note, these requirements only come on machine 0 and 1. task 0s only are performed on machine 0 and 1 and all task 1s are performed on machines 2-6. Machine 4 and 6 can perform the same job, so there is an alternative setup. I've allowed a bit of a gap between task 0s and task 1s for the same job as that is acceptable.

Find attached a working example of how I have the problem set up. A visualization is attached as well. In the visual, you can see 40951 is happening in order, but not immediately after each other. The gaps in machine 0 are also unacceptable (exampled in 40958). Basically the only gaps that should exist in machine 0 and 1 are between job groups.
job-shop-example.png

Any pointers or gaps in my solving of the problem would be greatly appreciated.
job_shop_example.py

Laurent Perron

unread,
Mar 10, 2023, 11:15:11 AM3/10/23
to or-tools-discuss
I pushed a fix on the ranking sample on main. 

You can check it by looking at the GitHub history of the file. 

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/f8393e13-0a2c-43d4-98ab-2dbea76c4644n%40googlegroups.com.

Adam Stuckey

unread,
Mar 10, 2023, 11:58:31 AM3/10/23
to or-tools-discuss
I'm seeing an update to the cc file last week, here. if this isn't the change your referencing, could you point me in the right direction?

But no update to the python version. I see the change in the commit adjusting the index in the ranking process. I think my ranking process works correctly. But enforcing a time limitation if the rank difference between two tasks is == 1 is what is seemingly not working correctly.

I appreciate your help!

Adam Stuckey

unread,
Mar 11, 2023, 11:20:28 AM3/11/23
to or-tools-discuss
 Hi Laurent - Any thoughts on my previous comment?

PC See

unread,
Mar 11, 2023, 12:00:38 PM3/11/23
to or-tools-discuss
For getting jobs to run at 1 machine, for example machine 4 instead of 6, try setup a bool variable representing OR of jobs running at machine 4, another bool variable for 6. Minimize the sum of them 

Adam Stuckey

unread,
Mar 13, 2023, 3:45:03 PM3/13/23
to or-tools-discuss
I think I have the alternatives working correctly. The ranking on machine 0 and 1 work correctly. However, on machine 0 and 1, all the task within a given group must be done with no gaps. That is what I cannot develop correctly.

Are you suggesting that creating that logic may solve this issue?

Laurent Perron

unread,
Mar 13, 2023, 5:59:40 PM3/13/23
to or-tools-discuss
Look at baking_no_wait example. 

Feasibility van be very hard when no gap is required if durations are fixed. Think Tetris. 

Reply all
Reply to author
Forward
0 new messages