KatInterview

Two-Station Job Scheduling with Setups and a Downtime Window

Dynamic ProgrammingModel answer
HardModel answerDynamic Programmingschedulingcombinatorial-optimizationbranch-and-bound

Last updated

Assign and sequence three jobs across two parallel stations to minimize makespan, handling sequence-dependent changeovers, a precedence constraint, and a station blackout period.

Two-Station Job Scheduling with Setups and a Downtime Window

A small production facility has two workstations, W1 and W2, running in parallel. You need to schedule three jobs — A, B, and C — subject to the rules below. Your goal is to find the schedule that finishes all work as early as possible (minimum makespan).

Processing times (minutes)

JobW1W2
A2025
B3022
C1815

Changeover (setup) times

When a station switches from one job to the next, it needs a changeover. The first job on a station has no changeover. Times are the same on either station:

From → ToABC
A—53
B4—6
C21—

Constraints

  1. Precedence. Job B cannot begin processing until Job A has fully finished.
  2. Planned downtime. W1 is unavailable from t = 60 to t = 70 (exclusive). A job (including its changeover) may not start on W1 if doing so would overlap this window — it must wait until t = 70.
  3. Non-preemptive. Once a job starts on a station (after any changeover), it runs to completion without interruption.

Tasks

(a) Complexity. Argue informally why this class of problem is NP-hard. Identify the simpler well-known problems that reduce to it.

(b) Optimal schedule. Find the assignment of jobs to stations and their start/finish times that minimizes makespan. Show your reasoning — enumerate the candidates, apply the lower bound, and confirm the best schedule. You may use branch-and-bound or bitmask DP.

(c) General solver. For n jobs and m stations, describe a practical approach: either a mixed-integer program with disjunctive constraints, a constraint-programming model, or a construction heuristic with local search. Discuss complexity, how you would tighten the formulation or prune the search, and what quality guarantees (if any) exist.

Hints

Hint 1

Start with a lower bound. Job A must finish before Job B can start, so the earliest B can complete is (A's minimum processing time) + (B's minimum processing time). That number bounds the makespan from below — use it to prune candidates.

Hint 2

The downtime window on W1 falls in [60, 70). Check whether any candidate schedule actually reaches that range. If W1 goes idle after t = 20 in your best assignment, the blackout never comes into play and you can ignore it for that candidate.

Hint 3

For the general case, think about what makes this problem hard in even the simplest subcase: one station, no precedence, no downtime. Minimizing total changeover time along a fixed sequence of n jobs is equivalent to finding a minimum-cost Hamiltonian path — which is exactly the Asymmetric TSP.