(Latest Revision:
Feb 22, 2019)
A Way to Make Interval Scheduling Problems
You can go here,
and generate a random list of integers with values between 8 and 18, which
can represent the times between 08:00 and 18:00. Here is part of such a
list:Here are your random numbers:
13 18
14 14
11 9
12 18
15 10
10 16
11 16
18 12
11 10
15 15
13 15
18 8
9 13
16 9
11 14
8 9
15 17
15 13
10 17
9 12
11 11
Next, you can take some pairs from the list where the first number is less
than the second. Here are ten pairs obtained that way:13 18
12 18
10 16
11 16
13 15
9 13
11 14
8 9
15 17
10 17
These can represent a set of intervals to schedule. You can use these as an input to either an "Interval Scheduling" problem, or an "Interval Partitioning" problem.
Another way to generate the numbers that you might try: Generate two lists,
the first a list of random start times for the intervals (say between 8 and 18, as above) and the second a list of durations, say, between 1 and 5. That way,
the lengths of all your intervals will be between 1 and 5, and so those
example problems will generally have solutions that pack more events into
rooms.
Below is an example of a solution of the Interval Scheduling problem, using the intervals given above, generated with the first method, as the input.
(Note: I worked the version of the problem where it is NOT considered a
conflict if the start time of one interval is the finish time
of another.)