Hereafter, let $L_i$ be the time to complete the $i$-th job.
Prepare a binary variable table $q$ of $N\times M$ to represent which machine to run each job on.
When machine $j$ deals with the $i$-th job, the $i$ row $j$ column of $q$ should be $1$.
For example, suppose we have the following job schedule.
Job |
Machine |
Job 0 |
Machine 0 |
Job 1 |
Machine 2 |
Job 2 |
Machine 2 |
Job 3 |
Machine 1 |
Job 4 |
Machine 1 |
Job 5 |
Machine 1 |
Job 6 |
Machine 1 |
The above job schedule can be represented by the variable table $q$ below.
$q$ |
Machine 0 |
Machine 1 |
Machine 2 |
Job 0 |
1 |
0 |
0 |
Job 1 |
0 |
0 |
1 |
Job 2 |
0 |
0 |
1 |
Job 3 |
0 |
1 |
0 |
Job 4 |
0 |
1 |
0 |
Job 5 |
0 |
1 |
0 |
Job 6 |
0 |
1 |
0 |
Also, to make it easier to understand what the maximum execution time to minimize is, we will assign
jobs
so that machine $0$ always has the longest execution time.
Objective function¶
Since we assign jobs so that the runtime of machine $0$ is longer than the runtimes of the other
machines,
the time it takes to complete all jobs is equal to the execution time of machine $0$. Therefore, the
objective function should be the execution time of machine $0$, i.e., the sum of the time taken by the
jobs assigned to machine $0$. This can be done using the time $L_i$ taken for the job $i$:
$$
\sum_{i = 0}^{N - 1} q_{i, 0} L_i.
$$
Constraints¶
$q$ must satisfy the following.
- Condition 1: Each job is assigned to one machine. That is, each row of $q$ has precisely $1$.
- Condition 2: For each machine, its execution time is less than machine $0$.
We can express condition 1 as:
$$
\sum_{j = 0}^{M-1} q_{i, j} = 1 \quad \text{for} \quad i \in \{0, 1, \ldots, N-1\}.
$$
Also, since the runtime of machine $j$ can be expressed as $\sum_{i = 0}^{N - 1} q_{i, j} L_i$, the
condition 2 is
$$
\sum_{i = 0}^{N - 1} L_i q_{i, j} \leq \sum_{i = 0}^{N - 1} q_{i, 0} L_i \quad \text{for} \quad j \in
\{1,
2, \ldots, M - 1\}.
$$
Conversely, when conditions 1 and 2 are satisfied, $q$ represents the job assignment, and the
objective
function is equal to the time until all jobs are completed.