Hello! Welcome back to our course.
In the previous two lessons, we explored single-machine scheduling problems that could be solved optimally with simple, efficient rules: Shortest Processing Time (SPT) for total completion time and Earliest Due Date (EDD) for maximum lateness. These greedy algorithms are powerful but are tailored to very specific problems.
Today, we pivot to a much more general and powerful technique that is central to solving the complex scheduling problems you'll encounter in your thesis research. This lesson addresses the learning outcome: Formulate a single machine scheduling problem as a mixed-integer linear program (MILP).
We will move from finding a clever algorithm to building a model of the problem. This model can then be solved by general-purpose optimization software. This modeling skill is foundational for tackling advanced problems like the Flexible Job Shop (FJSP), especially when adding real-world complexities like setup and transport constraints.
1. Why Use Mathematical Programming?
You might wonder why we need a complex tool like MILP when we have simple rules like SPT and EDD. The introduction of the paper "solving the single-machine sequencing problem" by Kenneth Baker provides an excellent rationale.
In academic research, specialized algorithms are often developed for specific, clean-cut problems. However, in practice—and particularly in thesis research that aims to model real-world systems—problems rarely fit these clean molds. You might need to consider:
- Sequence-dependent setup times
- Machine availability constraints (e.g., maintenance)
- Release dates and deadlines simultaneously
- Multiple, competing objectives
A major advantage of a mathematical programming approach is its flexibility. Instead of designing a new algorithm from scratch for every new constraint, you can often simply add new variables or constraints to an existing model. For problems of small to moderate size, this is an incredibly effective approach.
2. The Core of the Formulation: Modeling a Sequence
To build an MILP, we need three components:
- Decision Variables: Variables that represent the decisions we need to make. In scheduling, the primary decision is the sequence of jobs.
- Objective Function: A linear expression of our decision variables that quantifies the goal (e.g., minimizing total tardiness).
- Constraints: A set of linear inequalities or equations that define the rules of the problem (e.g., a machine can only process one job at a time).
The main challenge is representing the sequence using variables. There are several ways to do this, each leading to a different model formulation. The following reading introduces several key approaches.
solving the single-machine sequencing problem
The paper 'solving the single-machine sequencing problem' provides an excellent comparative review of different MILP formulations for the single-machine total tardiness problem (1 | | ΣTj). We will use it as our guide.
Please read the section 'FORMULATIONS OF THE TARDINESS PROBLEM'. You don't need to memorize every detail of all six formulations. Instead, focus on understanding the fundamental difference between these two main approaches: Formulation DJ (Disjunctive constraints): Understand the role of the precedence variables y_ij and the start time variables s_j. Pay close attention to the pair of constraints using the 'big M'. This is a critical technique. Formulation SP (Sequence position): Understand the role of the sequence-position variables x_ik. We will analyze the Disjunctive formulation in more detail next.
3. Deconstructing the Disjunctive Formulation
The Disjunctive (DJ) formulation, based on precedence variables, is one of the most important and extensible models in scheduling. Let's break it down for the 1 | | ΣT_j problem.
Variables:
- Binary precedence variables: if job precedes job at some point in the sequence, and otherwise. These are defined for all pairs of jobs .
- Continuous start time variables: is the time at which job begins processing.
- Continuous tardiness variables: is the tardiness of job .
Objective Function:
Our goal is to minimize the sum of tardiness for all jobs.
Constraints:
-
Tardiness Calculation: For each job , we link its start time, processing time (), and due date () to its tardiness . The completion time of job is .
Since we are minimizing and must be non-negative, the solver will ensure that takes the smallest possible value, which is . -
Disjunctive Sequencing Constraints: This is the heart of the model. For any two jobs, and , one must finish before the other one starts. This "either-or" relationship is called a disjunction.
- Either job comes before job :
- Or job comes before job :
We use the binary variable and a large constant (the "big M") to model this. For every pair of jobs with :
Let's see how this works:
- If the solver sets (meaning precedes ):
- The first constraint becomes , which correctly enforces that starts after finishes.
- The second constraint becomes . Since is a very large number, this constraint becomes redundant and non-restrictive.
- If the solver sets (meaning precedes ):
- The first constraint becomes , which is non-restrictive.
- The second constraint becomes , correctly enforcing that starts after finishes.
This "big M" technique is a standard method for converting logical conditions into linear constraints in MILP.
Test your understanding!
Consider a small problem with 3 jobs:
- Job 1:
- Job 2:
- Job 3:
Suppose we decide on the sequence 2-3-1.
- What are the values of the precedence variables for this sequence? (Remember ).
- Write out the two disjunctive constraints for the pair of jobs (1, 2).
- Show which of the two constraints is active and which is redundant for the sequence 2-3-1.
Show answer
-
Precedence Variables:
- Job 2 is before Job 3, so .
- Job 2 is before Job 1, so , which means .
- Job 3 is before Job 1, so , which means .
So, .
-
Disjunctive Constraints for (1, 2):
Substituting the processing times: -
Active/Redundant Constraints:
For the sequence 2-3-1, job 2 is before job 1, so .- The first constraint becomes . This is redundant.
- The second constraint becomes . This is the active constraint, correctly stating that job 1 must start at or after job 2 finishes.
4. Extending the Model: Handling Complexity
The true power of this MILP formulation is its extensibility. Let's see how we can adapt the basic disjunctive model to handle a more complex feature that is relevant to your thesis: sequence-dependent setup times.
A different paper provides a clear example of this. It models a problem that includes not only sequence-dependent setup times (, the setup time for job if it follows job ), but also a variable maintenance task.
MILP Models for Scheduling Dynamic Jobs with Sequence ...
The paper 'MILP Models for Scheduling Dynamic Jobs with Sequence ...' presents models for a more complex single-machine problem. This gives us a preview of how the basic formulation can be extended.
Please review Section 2, 'MILP MODELS'. You do not need to understand every detail about the maintenance constraints. Focus on Model 2. Notice that it uses the same type of precedence variables (Yij) we just learned about. Look closely at constraints (21) and (22). How do they incorporate the sequence-dependent setup time sij into the sequencing logic?
As you saw in the reading, modifying the core disjunctive constraint is straightforward. The original constraint for job i followed by j was:
To include a sequence-dependent setup time , we simply add it to the right-hand side of the completion time of job . In the notation of the second paper (where I_j is the start time and C_i is the completion time):
This is captured in constraint (21) of their model: . This is a slightly different but equivalent big-M formulation that enforces that if , the start time of must be after the completion of plus the required setup.
This simple modification demonstrates the modularity of MILP models. Adding this complexity to a rule-based algorithm like SPT or EDD would require a completely new theoretical development, but in an MILP, it's often just a matter of adjusting a few constraints.
Conclusion
This lesson marks a significant step from specific algorithms to general-purpose modeling. For the complex scheduling problems you'll face in your thesis, building and solving mathematical models is an indispensable skill.
Key Takeaways:
- MILP offers a flexible and general framework for solving scheduling problems, especially those with complex side constraints that defy simple rules.
- The core of a scheduling MILP is modeling the sequence. The disjunctive formulation using precedence variables () and "big M" constraints is a fundamental and widely used technique.
- The power of this approach lies in its extensibility. We saw how a basic model for total tardiness can be adapted to include features like sequence-dependent setup times by modifying the core constraints.
Preview of the Next Lesson:
We've now seen two very different ways to solve single-machine problems: efficient, optimal rules (for simple cases) and general, powerful MILP models (for complex cases). This distinction hints at a deep concept in computer science: the difference between "easy" and "hard" problems. In our next lesson, we will formally analyze the complexity of single machine problems with different objectives, introducing you to the concepts of P and NP-hardness, which explain why we need tools like MILP for most scheduling problems.