Sequencing constraint with a sliding window

58 views
Skip to first unread message

Scott Anderson

unread,
Mar 11, 2013, 12:55:43 PM3/11/13
to or-tools...@googlegroups.com
Given a set of tasks with categories and varying lengths:

id, category, length in seconds
1, "cat1", 180
2, "cat1", 210
3, "cat2", 205
4, "cat3", 300
5, "cat2", 250
etc.

How feasible is implementing the following constraint:

Create a sequence of the tasks such that there are no more than 4 tasks of a particular category within a sliding 3 hour window.

And are there particular constructs I should be looking at using?

Pardon the newbie questions, I'm just starting to get my head around constraint programming.

Regards,
-scott

Laurent Perron

unread,
Apr 15, 2013, 3:13:49 AM4/15/13
to or-tools-discuss
Hello,

The scheduling version to implement this, you need to create a set of interval variables, all of length 180 minutes,  whose start times are synchronized with your tasks. And add those in a cumulative of capacity 4.

There is a constructor of interval variables that takes integer variables as input. This can ease the model.

--Laurent
--
--Laurent

Reply all
Reply to author
Forward
0 new messages