HANOI PEDAGOGICAL UNIVERSITY 2DEPARTMENT OF MATHEMATICS ——————–o0o ——————— Nguyen Thanh Nga Scheduling a single machine with precedence constraints BACHELOR THESIS Major: Applied Mathema
Trang 1HANOI PEDAGOGICAL UNIVERSITY 2
DEPARTMENT OF MATHEMATICS
——————–o0o
———————
Nguyen Thanh Nga
Scheduling a single machine with precedence constraints
BACHELOR THESIS
Major: Applied Mathematics
Trang 2Hanoi, May 2019
HANOI PEDAGOGICAL UNIVERSITY 2
DEPARTMENT OF MATHEMATICS
——————–o0o
———————
Nguyen Thanh Nga
Scheduling a single machine with precedence constraints
BACHELOR THESIS Major:
Applied Mathematics
Advisor:
Dr Le Xuan Thanh
Trang 3I hereby confirm that this thesis is my original workcompleted under the guidance of Dr Le Xuan Thanh Thepresented results are accurate and correctly cited
Author
Trang 4Acknowledgements
I would like to express my gratitudes to the teachers ofHanoi Pedagogical University 2, especially the teachers in theDepartment of Mathematics The lecturers have imparted valuableknowledge and facilitated for me to complete the course and thethesis
In particular, I would like to express my deep respect andgratitude to Dr Le Xuan Thanh (Institute of Mathematics,Vietnam Academy of Science and Technology) who has directguidance and helps me to complete this thesis Professionalism,seriousness and his right orientations are important prerequisitesfor me to get the results in this thesis
Due to limited time, capacity, and conditions, my thesiscannot avoid errors I look forward to receiving valuablecomments from readers
Author
Trang 5Introduction 6
1
1 Th. . 61
2 Re . . 81
3 Re . . 81
3 Se . . 183
4 Th . . 203
5 Fo . . 21
Experiments
4
1 ZI .4
Trang 6Chapter 1
Introduction
1.1 Thesis topic
According to wikipedia, a schedule or a timetable, as a basic
time management tool, consists of a list of times at which possibletasks, events, or actions are intended to take place, or of a sequence
of events in chronological order in which such things are intended totake place The process of creating a schedule - deciding how toorder these tasks and how to commit resources between thevariety of possible tasks - is called scheduling.
Having good schedules makes our life more comfortable andwell- organized In social services, industrial manufacturing,transporta- tion, etc., a good schedule results in higher productiveand more com- petitive outcomes How to construct good schedulesfor real-life as well as industrial activities is the main goal ofscheduling problems Thus, one can say that scheduling problemsarise naturally from practice and play a vital role in operatingsystems In the past few decades, the practical importance andcomplexity of the general scheduling prob- lems have motivated asignificant volume of research in a wide variety of schedulingenvironments
In (project) scheduling problems, a set of jobs (so-calledactivities, tasks) has to be processed on a set of machines in agiven time hori- zon using limited resources (machines,
Trang 7processors, or staffs) Some constraints (on, for examples, releasedates or precedence constraints
Trang 8between the jobs) might be imposed in the problems Often thereare a finite (but usually very huge) set of possibilities for a feasiblesched- ule However, usually one has to optimize certain objectivefunction This means that we have to look for a best solutionamong a tremen- dous number of feasible solutions Furthermore,practical instances of scheduling problems might have very largesize (up to hundreds or even millions jobs and machines) That isthe motivation for aca- demic researchers to develop algorithmscapable of solving large-size scheduling problems in acceptabletime
The performance of the algorithms depends very much on thede- sign of the algorithms themselves and data structures For thesame problems, there might be many solution approaches withdifferent levels of efficiency Such a common approach is to usemixed integer programming (MIP) in modeling the problems.This approach has a two-fold advantage On one hand, it makesuse of available MIP solvers, since in the recent years the solversbecame much more effi- cient On the other hand, it is easy toimplement the models and then solve the problems on computers
In this thesis, we would like to highlight the fact that theremight have different MIP formulations for representing ascheduling prob- lem, and having a good formulation is crucial insolving numerical instances of such problem For that we focus onstudying the schedul- ing problem on a single machine withprecedence constraints between the jobs and minimizing the totalflow time More precisely, we con- sider the situation in which onehas to schedule a set of jobs on a single machine Each job has itsprocessing time and is processed without preemption Between thejobs there may be arbitrary precedence con- straints that imposewhich jobs have to be completed before starting another job Theobjective is to find a schedule that minimizes the total flow time,i.e the total value of completion times of all jobs
The scheduling problem studied in this thesis is one of themost basic scheduling problems For a comprehensive study onscheduling problems, we refer to [2] It is also shown in [2] that
Trang 9the problem under our consideration is NP-hard, therefore based approaches are of the most common solution methods Thefact that we would
Trang 10like to highlight “In integer programming, formulating a goodmodel is of crucial importance to solving the model” has alreadyquoted in [4]
1.2 Research methods
We use MIP-based approaches for solving our studiedscheduling problem due to the mentioned advantages of themethods That is, we formulate the problem as different mixedinteger programming formu- lations We will also test theobtained models on different instances that are randomlygenerated, with the help of some modeling language and integerprogramming solver
1.3 Results of the thesis
We describe the scheduling problem on a single machinewith precedence constraints between the jobs, no job preemption,and mini- mizing the total flow time We present four different MIPformulations for the problem Based on experimental results onsome tested in- stances, we find out the best performanceformulation for numerically solving the scheduling problem
1.4 Structure of the thesis
Apart from this chapter, the thesis consists of four more
chapters
• Chapter 2: Preliminaries In this chapter we present some
pre- liminaries on the scheduling problem of our considerationand a short introduction to mixed integer programming
• Chapter 3: Problem description and MIP formulations This chapter first describes the scheduling
Trang 11problem studied in this thesis, and then presents several MIPformulations for the prob- lem.
Trang 12• Chapter 4: Experiments This chapter describes how
do we generate tested instances for numerical experimentingthe for- mulations mentioned in Chapter 3 Then wepresent how to implement the formulations on computers.After that, we ana- lyze the performance of the formulationsbased on our obtained numerical results
• Chapter 5: Conclusions We close the thesis by some
conclu- sions
Trang 13Chapter 2
Preliminaries
In this chapter, we introduce some basic concepts related toour considered scheduling problem Then we present a shortintroduction to mixed integer programs
2.1 Some basic scheduling concepts
Resources for a scheduling problem include jobs andmachines Here jobs mean any activities, tasks, or works that
should be done and completed for some specific purposes
Machines can be persons who are responsible for doing the jobs,
tools for processing the jobs, or spaces in which the jobs are done.For example, a student needs to review some subjects before thefinal exam of a semester In this context, the student can beconsidered as a machine, and reviewing each subject can bethought as a job
In general scheduling problems, we are given n jobs j = 1,
, n which have to be processed on m machines M k (k = 1, , m).
Often we assume that each machine can process at most one job atany time, and each job cannot be processed on more than onemachine simul- taneously In some models a job can beinterrupted when processing on a machine and resumed latereither on the same machine or on another one In such contexts
Trang 14we say that the jobs can be preempted, or equivalently, jobpreemption is allowed However, in this thesis we
Trang 15consider a scheduling problem on a single machine (i.e m = 1)
with no job preemption (i.e., once a job is started, it must
continue until its completion on the machine)
Associated data for a job j may include:
• processing time p j which is the amount of time units needed
to complete the job,
• release date r j which is the point of time before that the job cannot start,
• deadline d˜ j which is the point of time before that the job must be finished,
• due date d j which is the point of time before that the job should be completed
Between jobs there may be precedence constraints imposingwhich jobs must be finished before doing certain jobs The
notation i → j means that the job i must be completed before the
job j can be started To visualize precedence constraints one often
use an acyclic directed graph in which the nodes represent the jobsand the arcs represent the precedence relations
Example 1 The graph in Figure 2.1 visualize an instance of prece- dence constraints on n = 5 jobs, in which the arc 1 →
3 means that job 1 must be completed before the starting time
of job 3, and similar to the arcs 1 → 5, 2 → 4, 4 → 5.
3 1
5
2 4
Figure 2.1: Graph of precedence constraints between jobs
Trang 161 2 4
16
A schedule on single machine without job preemption can be
com- pletely described by the starting times S j of all jobs j, or equivalently their completion times C j = S j + p j Such schedulesare often visual- ized by Gantt charts
Example 2 Figure 2.2 shows a feasible schedule for a problem in- stance with n = 4 jobs, precedence constraints
1 → 3, 2 → 4, and processing times p1 = 3, p2 = 2, p3 = 4, p4
= 2 In this schedule, the processing order of the jobs is 1, 3,
2, 4 , the completion times of the jobs are C1 = p1 = 3, C3 =
p1 + p3 = 7, C2 = p1 + p3 + p2 = 9, C4 = p1 + p3 + p2 + p4 =
11.
t
0 3 7 9 11Figure 2.2: Gantt chart of a schedule
Usually a schedule is made in order to achieve someoptimality criterion The most common objective is to minimizethe makespan C max = max{C j , j = 1, , n} The makespan let
us know the latest point of time that all jobs are finished Anothercommon objective is
to minimize the total flow time ∑n (C∑j −r j), or equivalently,
since the values of parameters r j are given constants The flow time
of a job j is the total time it spends in the system and equals C j −
r j, i.e the difference between its completion time and release time.Therefore
the total flow time let us know how long all the jobs spent inthe system In this thesis, we focus on studying the objective ofminimize the total flow time
2.2 Mixed integer linear programming
Trang 17Many scheduling problems can be formulated as integer linear pro- grams A linear program (abbreviated by LP) is a system of the form
Trang 18restriction x j ∈ Z (i.e., all variables are required to have integer
values) is called an integer linear program (abbreviated by ILP
or shortly IP) A mixed in- teger linear program
(abbreviated by MIP) contains both integer and continuousvariables
The sum in (2.1) is called objective function whose value is
needed to be optimized, while the system (2.2) and (2.3) are called
constraints.
Any value of decision vector x which satisfies the constraints is
called a feasible solution A feasible solution x ∗ which attains theminimum value of objective function (2.1) is called an optimal solution.
Having an instance of MIPs, we can implement it on computers
by using some mathematical modeling language Our choice ofmodeling tool is ZIMPL [3] To numerically solve the instance,one can use various available MIP solvers Our choice of solvers isSCIP [1] which is known as the best non-commercial solver forsolving MIPs
Trang 19Chapter 3
Problem description
and MIP formulations
In this chapter, we first formally describe the problem of ourcon- sideration, then present four different (M-)IP formulationsfor this problem
3.1 Problem description
We consider the scheduling problem with the following features
• We are given n jobs j = 1, , n that have to be processed
on a single machine
• For each job j its processing time p j ∈ Z+ is known exactly
(that means, job j needs p j > 0 time units to process on the
machine)
• Every job j has realease date r j = 0, i.e., all the jobs can
start from beginning of the time horizon t = 0.
• No due date or deadline is given for the jobs, i.e., each job can be completed whenever we want
Trang 20• Job preemption is not allowed, i.e., once each job starts, it must process until its completion.
Trang 21• Between the jobs there may be arbitrary precedenceconstraints that define which job must be completed beforethe start of another job.
• The objective is to minimize the total flow time of all jobs Following the 3-field notation proposed in [2], this problem can be
Example 3 Consider an instance of the scheduling problem with n =
5 jobs of processing times p1 = 5, p2 = 3, p3 = 7, p4 = 4, p5 = 5
Trang 22For schedule (b) its total flow time is 5 + 12 + 15 + 19 + 24
= 75.
Trang 23Since a schedule on a single machine without job preemption
can be completely described by the completion times C j of all
jobs j, in this formulation we use C j with j = 1, , n as
variables Using these
variables, it is easy to see that the total flow time is
Trang 24For each job precedence relation i → j, since job j starts after
the completion time C i of job i and processes in p j time units, wemust have the following constraint on its completion time:
C j − C i ≥ p j ∀i, j = 1, , n, i
→ j.
Since the jobs are processed in a single machine, for the other
pairs of jobs (i, j) without job precedence relation, either job i is
processed