In this assignment, we will explore the ``shift-packing problem'', a classic bin-packing problem in a scheduling setting. The problem is this: given a collection of shifts of given duration, and a collection of jobs of given duration, find an assignment of jobs to shifts which maximizes the total amount of work accomplished.
Note that there are no ordering constraints in this problem: the assignment of ``times to tasks'' is underdetermined, since the jobs performed during a shift can be performed in any order.
I have provided you with three instances of job and shift data
(also available as a ZIP archive
or tar archive)
Inst. | Jobs | Shifts |
---|---|---|
(a) | jobs-10-10.dat | shifts-2-58.dat |
(b) | jobs-20-10.dat | shifts-8-106.dat |
(c) | jobs-100-100.dat | shifts-53-5300.dat |
For the job files, the name indicates the number of jobs, and the maximum job duration. For the shift files, the name indicates the number of shifts, and the total length of the shifts. Instance (a) requires packing 10 jobs perfectly into two equal shifts (number partitioning). Instance (b) requires packing a random selection of jobs into an arbitrary assortment of bins. Instance (c) requires doing as well as possible at packing 100 jobs into a set of 53 equal shifts.
Note that it is not immediately obvious whether any of these instances have ``perfect'' solutions, in the sense of completely filling the shifts. It depends on how well things pack.
Formally define the problem and instance in the style of Garey and Johnson. What is the right measure of the size of an instance?
Write a simple depth-first solver for this problem.
While completing (2), answer the following questions about your solver:
Solve instance (a) to completion. (Hint: it should have multiple optimal solutions.) This should be a good first test of your code.
Solve instances (b) and (c) as best you can.
Turn in answers to questions, source code, and output of runs. Plain old ASCII text strongly preferred. MIME packaging is OK, but not particularly desirable. E-mail everything to me at <bart@cs.pdx.edu> on or before Friday, February 4. Please include "CS510SS Homework 2" in the subject line of your e-mail.