Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 18

Permutation Flow Shop MILP Model

Recommended resources

Hello! Welcome to our lesson on formulating the flow shop problem as a mathematical model.

In our previous lessons, we explored heuristics like NEH and local search. These are powerful methods for finding high-quality solutions quickly. However, they don't guarantee optimality. For your thesis work, having a method to find a provably optimal solution is crucial, as it provides a benchmark against which you can measure the performance of your own advanced algorithms.

Today, we pivot from heuristics to exact optimization methods. Our learning outcome is to formulate the permutation flow shop problem as a Mixed-Integer Linear Program (MILP). A MILP is a mathematical model that describes a problem using linear equations and integer variables. By solving this model with specialized software, we can find the globally optimal solution.

This lesson will cover:

  • The core components of a MILP model for scheduling.
  • A classic position-based MILP formulation for the permutation flow shop.
  • An alternative precedence-based formulation, which introduces a different way of thinking about the problem.

Understanding these formulations is a fundamental skill in scheduling research. It will not only deepen your understanding of the flow shop problem's structure but also provide the building blocks for modeling the more complex Flexible Job Shop Problems (FJSP) you'll tackle in your thesis.

From Shop Floor Rules to Mathematical Equations

The challenge of mathematical modeling is to translate the physical rules and objectives of a system into the language of mathematics. For the permutation flow shop problem (PFSP) with a makespan () objective, we have the following rules:

  • All jobs follow the same machine sequence: M1 → M2 → ... → Mm.
  • The job sequence is the same on all machines (this is the "permutation" aspect).
  • A machine can only process one job at a time.
  • A job cannot be processed on machine i+1 until it has finished on machine i.
  • The goal is to find the job sequence that minimizes the time the last job finishes on the last machine.

With jobs, there are possible sequences. For even a modest 10 jobs, this is over 3.6 million possibilities! A MILP allows us to represent all these possibilities within a single model and have a solver efficiently search for the best one.

Flow Shop vs. Job Shop Scheduling: Sequence and Complexity
This image contrasts the fixed routing of a flow shop with the variable routing of a job shop. The permutation flow shop, which we are modeling, has n! possible schedules, highlighting the combinatorial complexity that a MILP model must capture.

Formulation 1: The Position-Based Model

One of the most intuitive ways to model a permutation is to create decision variables that assign each job to a specific position in the sequence. Let's say we have positions . Our model will decide which job goes into which position.

We will study a well-known formulation by Stafford et al. It's clean, effective, and provides a great introduction to the topic.

To start, let's define our terms:

  • Indices:
    • for machines.
    • for jobs.
    • for positions in the sequence.
  • Parameter:
    • : Processing time of job on machine .

Now, let's look at the full formulation.

On Some Lower Bounds for the Permutation Flowshop ...

The paper 'On Some Lower Bounds for the Permutation Flowshop...' provides a concise MILP formulation for the problem. We will dissect this model piece by piece.

Please read section 2.2, 'The Stafford et al. formulation'. Focus on the definitions of the variables and the list of equations from (1) to (8). We will walk through the meaning of each one.

Let's break down this model.

Decision Variables

The model uses two types of variables:

  1. : A binary variable. It equals 1 if job is assigned to position in the sequence, and 0 otherwise. This is the core of our sequence decision.
  2. : A continuous variable representing the finish time of the job in position on machine .

Objective Function

This is simple and elegant. We want to minimize the finish time of the job in the last position () on the last machine (). By definition, this is the makespan ().

Constraints

  1. Assignment Constraints:


    These two sets of equations ensure a valid one-to-one assignment. The first says that every job must be assigned to exactly one position. The second says that every position must be filled by exactly one job.

  2. Finish Time Calculation:
    The magic of the model lies in how it calculates finish times. The term cleverly picks out the processing time of whichever job is assigned to position . Since only one will be 1 for a given , this sum equals exactly the processing time of the job in position on machine .

    • First job, first machine:

      The finish time of the first job in the sequence on the first machine is simply its processing time.

    • Machine precedence (Job in position k on machine i):

      This enforces the flow shop routing. The finish time of a job on machine must be greater than or equal to its finish time on machine plus its processing time on machine .

    • Sequence precedence (Machine i processing job in position k):

      This ensures that on any machine , the job in position cannot start until the job in position is finished.

The use of instead of is important. It allows for idle time on machines or waiting time for jobs, which is necessary to maintain feasibility. Since we are minimizing , the solver will naturally push all finish times to be as early as possible.

Test your understanding!

Consider a 2-job, 2-machine problem. Let's say the solver decides on the sequence (J2, J1). What would be the values of the variables? How would the constraint be interpreted for this sequence?

Show answer

The sequence is (J2, J1). This means Job 2 is in position 1, and Job 1 is in position 2.

The variables would be:

  • (Job 1 is not in position 1)
  • (Job 1 is in position 2)
  • (Job 2 is in position 1)
  • (Job 2 is not in position 2)

The constraint is .
Let's expand the sum: .
Substituting the variable values, we get: .

So the constraint becomes: .
This means: "The finish time of the job in position 1 (Job 2) on machine 2 must be greater than or equal to its finish time on machine 1 plus its processing time on machine 2." This correctly models the rule that Job 2 cannot finish on M2 until it has been processed there, and it couldn't even start on M2 until it was finished on M1 (which is captured by ).


Formulation 2: The Precedence-Based Model

An alternative approach is to define variables based on the relative order of jobs, rather than their absolute position. This type of model is often based on the work of Manne.

The key decision variable is:

  • : Equals 1 if job precedes job (not necessarily immediately), and 0 if job precedes job . We only need to define this for to avoid redundancy.

The other main variable tracks completion times by job, not by position:

  • : A continuous variable representing the completion time of job on machine .

This paper on MILP models presents several formulations. We will focus on the one called MUB3, which is based on Manne's model. Note that the paper's objective is to minimize earliness and tardiness, but we can easily adapt its core constraints for our makespan objective.

Mixed-integer programming models for flowshop ...

This paper presents and compares several MILP models. We will examine the model MUB3, which uses precedence variables, as an alternative to the position-based model we just saw.

Please read section 2, focusing on the formulation named 'MUB3'. Pay close attention to the definition of the variables z_ij and C_ik, and the constraints (21) through (24).

Let's adapt the MUB3 model for a makespan objective.

Objective Function


subject to:

We introduce a new variable, , and add constraints that force it to be greater than or equal to the completion time of every job on the final machine. Minimizing achieves our goal.

Constraints

  1. Job Precedence (within a job):

    This is the same logic as before: a job's completion on machine depends on its completion on machine .

  2. Machine Precedence (between jobs): This is where the model is fundamentally different.


    These are called disjunctive constraints. They ensure that on any machine , only one job is processed at a time. Let's see how they work for any pair of jobs and :

    • Case 1: Job precedes job . Then .
      • The first constraint becomes . This is active and enforces that job cannot complete before job is complete plus its own processing time.
      • The second constraint becomes . Since M is a very large number, this constraint becomes , which is always true and thus inactive.
    • Case 2: Job precedes job . Then .
      • The first constraint becomes . This is inactive.
      • The second constraint becomes . This is active and enforces the correct sequence.

This "big-M" technique is a standard and powerful tool in MILP for modeling logical choices.


Comparing the Formulations

We have seen two ways to model the same problem:

  1. Position-based: Uses variables to assign jobs to positions. It is often more intuitive for permutation problems.
  2. Precedence-based: Uses variables to define the relative order of job pairs. It can be more generalizable to non-permutation problems like the job shop.

These models differ in size (number of variables and constraints), which affects how quickly a solver can find the optimal solution. For your thesis, being able to choose or design the right formulation for a specific problem variant is a key skill. The precedence-based formulation, for example, is a more natural starting point when modeling the general job shop problem, which you will encounter later.


Conclusion

Today we moved from the world of heuristics to the world of exact optimization by modeling the permutation flow shop as a Mixed-Integer Linear Program. You now have a powerful tool to find provably optimal solutions, providing a vital baseline for your research.

Key Takeaways:

  • MILP is a method for finding optimal solutions to problems by defining an objective, decision variables, and constraints mathematically.
  • Position-based formulations use binary variables to assign jobs to positions in a sequence (e.g., ).
  • Precedence-based formulations use binary variables to define the relative order between any pair of jobs (e.g., ).
  • The "big-M" method is a common technique in MILP to model disjunctive "either-or" constraints, which are essential for preventing two jobs from occupying the same machine at the same time.

Preview of the Next Lesson:
We have now explored two distinct approaches to the flow shop problem: fast heuristics that find good solutions (NEH, local search) and exact methods that find optimal solutions but can be slow (MILP). In our next lesson, we will step back to compare constructive vs. improvement heuristics. This will consolidate your understanding of heuristic design and set the stage for later modules where you'll learn about advanced metaheuristics that try to combine the speed of heuristics with the quality-seeking power of more exhaustive methods.