numerical-opt-models
numerical-opt-models
Antonio G. L. Esteves
March 29, 2025
Contents
1 Sequence Models 1
1.1 The Job-Shop Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Time-indexed Job-Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Disjunctive Job-Shop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.4 TSP-MZT Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Dispersion Models 6
3 Routing Models 6
4 Dispersion Models 6
4.1 Foundations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.1 Minimax Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.2 Max-Min Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Example (Resource Allocation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 Key Differences 7
6 Network Models 7
1 Sequence Models
1.1 The Job-Shop Scheduling Problem
The job-shop scheduling problem (JSSP) is a widely studied optimization problem with several industrial
applications. The goal is to define how to minimize the makespan required to allocate shared resources
(machines) over time to complete competing activities (jobs). As for other optimization problems, mixed-
integer programming can be an effective tool to provide good solutions, although for large instances one
should probably resort to heuristics.
1
The figure below illustrates an optimal sequence of operations for a simple instance with 5 machines and
4 jobs. Notice that each machine processes just one job at a time and each job is processed by only one
machine at a time.
As for other optimization problems, we must convert these rules into mathematical equations to obtain
smart allocations of resources. Therefore, in the following section, let us see two usual formulations for the
JSSP.
Following the study of Ku and Beck [2016], two formulations for the JSSP will be presented: the disjunc-
tive model Manne [1960] and the time-index model (Kondili and Sargent [1988], Bowman [1959]). Those
interested might refer to Wagner [1959] for a third formulation (rank-based).
In the Time Interval JSSP, the formulation includes explicit time interval constraints for each opera-
tion. This means that each operation may have permitted time windows for processing. These windows can
be either predefined or dynamic, depending on the model. This approach is useful for scenarios where ma-
chines have fixed operating hours or external constraints, such as work shifts or limited resource availability.
In the Disjunctive JSSP, the focus is on the order of operations on each machine. Since each machine
can only process one operation at a time, the modeling includes disjunctive edges in a graph, representing
precedence choices between competing operations. The goal is to find a feasible sequence that minimizes a
criterion, such as makespan (the total time required to complete all tasks).
In the Time Interval JSSP, the scheduling model explicitly incorporates time intervals, meaning that
each operation has specific allowable time windows for execution. These intervals can be either predefined or
dynamically adjusted based on the model’s constraints. This approach is particularly useful in environments
where machines have fixed operating hours or external limitations, such as work shifts or restricted resource
availability.
On the other hand, the Disjunctive JSSP focuses on sequencing operations on each machine, ensuring that
only one operation is processed at a time. Instead of predefined time windows, the model uses disjunctive
constraints to establish precedence relationships between competing operations. The objective is to determine
a feasible order of execution that optimizes a scheduling criterion, such as minimizing the makespan (the
total time required to complete all tasks).
Thus, If you are dealing with fixed time constraints, the Time Interval JSSP is more suitable. If
the problem is to sequence operations without fixed time constraints, the Disjunctive JSSP is more
appropriate.
1.2 Disclaimer
Note that despite their similarity, the Job Scheduling Problem should not be confused with the Schedule
Interval Problem. Although both the Job Scheduling Problem (JSSP) and the Schedule Interval Problem
(SIP) are related to the allocation of tasks over time, they have fundamental differences in their formulation
and objectives.
2
The Job Scheduling Problem refers to the allocation of a set of tasks (jobs) to a set of resources
(machines or workers) while respecting constraints such as processing time, task precedence, and resource
capacity.
The Schedule Interval Problem, on the other hand, deals with the allocation of time intervals for
events, where each event occupies a fixed interval and may have overlap restrictions.
Ensure that each machine processes just one job at a time. And this is the hard one in the time-indexed
approach. To do this, we state that at most one job j can start at machine m during the time span
between the current time t and pm,j previous times. For each machine and time instant.
The starting time of job j in machine m must be greater than the starting time of the previous operation
of job j plus its processing time.
The total makespan is greater than the starting time of every operation plus its processing time.
min C (1)
X
s.t. ym,j,t = 1 ∀j ∈ J; m ∈ M (2)
t∈T
X
xm,j,t ≤ 1 ∀m ∈ M ; t ∈ T (3)
j∈J
X X
t + pjh−1 yjh−1 ,j,t ≤ tyjh ,j,t ∀j ∈ J; h ∈ {1, 2, . . . , |M |} (4)
t∈T t∈T
ym,j,t ≤ xm,j,t ∀m ∈ M ; j ∈ J; t ∈ T (5)
ym,j,t ≤ 1 − xm,j,t−1 ∀m ∈ M ; j ∈ J; t ∈ T \ {0} (6)
xm,j,t − xm,j,t−1 ≤ ym,j,t ∀m ∈ M ; j ∈ J; t ∈ T \ {0} (7)
txm,j,t ≤ C ∀m ∈ M ; j ∈ J; t ∈ T (8)
ym,j,t , xm,j,t ∈ {0, 1} ∀j; m ∈ M ; t ∈ T (9)
3
min C (10)
s.t. xσh−1,j + pσh−1,j ≤ xσh,j ∀j ∈ J, h ∈ (2, . . . , |M |) (11)
xm,j + pm,j ≤ xm,k + V (1 − zm,j,k ) ∀j, k ∈ J, j ̸= k; m ∈ M (12)
zm,j,k + zm,k,j = 1 ∀j, k ∈ J, j ̸= k; m ∈ M (13)
xσ|M |,j + pσ|M |,j ≤ C ∀j ∈ J (14)
xm,j ≥ 0 ∀j ∈ J; m ∈ M (15)
zm,j,k ∈ {0, 1} ∀j, k ∈ J; m ∈ M (16)
1.2.3 Results
For larger instances, due to combinatorial aspects of this problem, even high-performance commercial solvers,
such as Gurobi or Cplex, might face difficulties to provide good quality solutions and prove optimality. In this
context, metaheuristics can be an interesting alternative. I would suggest the interested reader to look for the
papers ”Parallel GRASP with path-relinking for job shop scheduling” Aiex et al. [2003] and ”An extended
Akers graphical method with a biased random-key genetic algorithm for job-shop scheduling’ Gonçalves and
Resende [2014].
Without further constraints, the {xij }i,j will effectively range over all subsets of the set of edges, which
is very far from the sets of edges in a tour, and allows for a trivial minimum where all xij = 0. Therefore,
both formulations also have the constraints that, at each vertex, there is exactly one incoming edge and one
outgoing edge, which may be expressed as the 2n linear equations
n
X
xij = 1 for j = 1, . . . , n
i=1
i̸=j
n
X
xij = 1 for i = 1, . . . , n.
j=1
j̸=i
4
These ensure that the chosen set of edges locally looks like that of a tour, but still allow for solutions
violating the global requirement that there is one tour which visits all vertices, as the edges chosen could
make up several tours, each visiting only a subset of the vertices; arguably, it is this global requirement
that makes TSP a hard problem. The MTZ and DFJ formulations differ in how they express this final
requirement as linear constraints.
In addition to the xij variables as above, there is for each i = 1, . . . , n a dummy variable ui that keeps
track of the order in which the cities are visited, counting from city 1; the interpretation is that
ui < uj implies city i is visited before city j. For a given tour (as encoded into values of the xij variables),
one may find satisfying values for the ui variables by making ui equal to the number of edges along that
tour, when going from city 1 to city i.
Because linear programming favors non-strict inequalities (≥) over strict (>), we would like to impose
constraints to the effect that
uj ≥ ui + 1 if xij = 1.
Merely requiring uj ≥ ui + 1 would not achieve that, because this also requires uj ≥ ui when xij = 0,
which is not correct. Instead, MTZ uses the n(n − 1) linear constraints
ui − uj + 1 ≤ (N − 1)(1 − xij )
for all distinct i, j ∈ {2, . . . , n}, where the constant term n − 1 provides sufficient slack that xij = 0 does
not impose a relation between uj and ui .
The way that the ui variables then enforce that a single tour visits all cities is that they increase by at
least 1 for each step along a tour, with a decrease only allowed where the tour passes through city 1. That
constraint would be violated by every tour which does not pass through city 1, so the only way to satisfy it
is that the tour passing city 1 also passes through all other cities.
The MTZ formulation of TSP is thus the following integer linear programming problem:
n X
X n
min dij xij
i=1 j=1
j̸=i
subject to:
n
X
xij = 1, j = 1, . . . , n;
i=1
i̸=j
n
X
xij = 1, i = 1, . . . , n;
j=1
j̸=i
ui − uj + 1 ≤ (N − 1)(1 − xij ), 2 ≤ i ̸= j ≤ n;
2 ≤ ui ≤ n, 2 ≤ i ≤ n.
2 Dispersion Models
3 Routing Models
4 Dispersion Models
Facility location is a critical aspect of the strategic planning of private and public companies. Typical
examples in the public sector involve decisions on the location of health centers, schools, and fire stations,
5
while in the private sector, it includes the location of factories, warehouses, and distribution centers. In
various situations, such as in distribution systems, facility location decisions and the assignment of customers
to facilities are made simultaneously. Below, mathematical models for some important location problems
are presented. To this end, consider the following parameters:
Kuby [1987] proposed two distinct mixed-integer programming (MIP) formulations for these problems:
the p–dispersion problem and the maxisum problem.
4.1 Foundations
In optimization, the minimax and max-min formulations play a crucial role in decision-making under un-
certainty, game theory, and robust optimization. Despite their similar structure, they have distinct objectives
and interpretations.
where:
x is the decision variable controlled by the minimizer.
y is the adversarial variable controlled by the maximizer.
f (x, y) represents a loss or cost function.
The Interpretation is that in the inner maximization represents an adversary selecting the worst possible
outcome for a given x. The outer minimization then selects x to minimize the effect of this worst-case choice.
Thus, as possible use cases we can able to cite:
Game theory (zero-sum games, Nash equilibrium).
Robust optimization (handling uncertainty in constraints).
Machine learning (adversarial training, GANs).
Example (Game Theory): In a zero-sum game, a player minimizes the opponent’s best possible score:
min max Payoff(π, σ) (18)
π σ
where π is the strategy of the minimizer and σ is the strategy of the maximizer.
The interpretation is that the inner minimization models an adversary choosing the worst-case scenario
for a given x. The outer maximization then chooses x to make the worst-case outcome as favorable as
possible. Possible use cases are:
Fair division (ensuring a fair share in resource allocation).
Worst-case scenario planning (making sure the minimum profit is maximized).
Min-max regret models (in decision theory).
Example (Resource Allocation): A company allocating resources to production wants to ensure that the
worst-case revenue is maximized:
max min Profit(allocation, market) (20)
allocation market conditions
6
5 Key Differences
In zero-sum games, these two formulations are often equivalent due to saddle point theorems (e.g.,
von Neumann’s Minimax Theorem). However, in general optimization problems, they can yield different
solutions.
6 Network Models
Several important linear programming models have a special structure that allows for the development of
efficient and specialized algorithms for their solution. Within this family of problems, one of the most tradi-
tional is *the transportation problem*. In general, so-called network models enable the solution of significant
real-world problems and have extraordinary practical applications (see cases in Boorstyn and Frank [1977],
Biros and Boros [1984], Carraresi and Gallo [1984], Langevin et al. [1993], Phillips and Westbrook [1993]). In
terms of solution methods, these models allow for the refinement of well-known and traditional techniques,
achieving remarkable efficiency in the resolution process.
7
References
Renata M Aiex, Silvio Binato, and Mauricio GC Resende. Parallel grasp with path-relinking for job shop
scheduling. Parallel Computing, 29(4):393–430, 2003.
George Biros and Endre Boros. Network flow algorithms: Theory and applications. Mathematical Program-
ming Studies, 22:17–41, 1984. doi: 10.1007/BF01580646.
Robert R. Boorstyn and Harold Frank. Generalized optimal node assignments in computer networks. IEEE
Transactions on Communications, 25(1):48–56, 1977. doi: 10.1109/TCOM.1977.1093766.
Edward H Bowman. The schedule-sequencing problem. Operations research, 7(5):621–624, 1959.
Paolo Carraresi and Giorgio Gallo. Network models for vehicle and crew scheduling. European Journal of
Operational Research, 16(2):139–151, 1984. doi: 10.1016/0377-2217(84)90047-8.
José Fernando Gonçalves and Mauricio GC Resende. An extended akers graphical method with a biased
random-key genetic algorithm for job-shop scheduling. International Transactions in Operational Research,
21(2):215–246, 2014.
E Kondili and RWH Sargent. A general algorithm for scheduling batch operations (pp. 62–75). Department
of Chemical Engineering, Imperial College, 1988.
Wen-Yang Ku and J Christopher Beck. Mixed integer programming models for job shop scheduling: A
computational analysis. Computers & Operations Research, 73:165–173, 2016.
Michael J. Kuby. Programming models for facility dispersion: The p-dispersion and maxisum dispersion
problems. Geographical Analysis, 19(4):315–329, 1987. doi: 10.1111/j.1538-4632.1987.tb00168.x.
André Langevin, Placide Mbaraga, and James F. Campbell. Continuous approximation models in freight
distribution: An overview. Transportation Research Part B: Methodological, 27(6):439–451, 1993. doi:
10.1016/0191-2615(93)90002-4.
Alan S Manne. On the job-shop scheduling problem. Operations research, 8(2):219–223, 1960.
Cynthia A. Phillips and Jeffrey Westbrook. Facility location in graphs with submodular cost functions.
Proceedings of the 25th Annual ACM Symposium on Theory of Computing (STOC), pages 223–234, 1993.
doi: 10.1145/167088.167145.
Harvey M Wagner. An integer linear-programming model for machine scheduling. Naval research logistics
quarterly, 6(2):131–140, 1959.