1. Trang chủ
  2. » Luận Văn - Báo Cáo

Scheduling a single machine with precedence constraints

49 21 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

HANOI PEDAGOGICAL UNIVERSITY DEPARTMENT OF MATHEMATICS ——————–o0o ——————— Nguyen Thanh Nga Scheduling a single machine with precedence constraints BACHELOR THESIS Major: Applied Mathematics Hanoi, May 2019 HANOI PEDAGOGICAL UNIVERSITY DEPARTMENT OF MATHEMATICS ——————–o0o ——————— Nguyen Thanh Nga Scheduling a single machine with precedence constraints BACHELOR THESIS Major: Applied Mathematics Advisor: Dr Le Xuan Thanh Hanoi, May 2019 Confirmation I hereby confirm that this thesis is my original work completed under the guidance of Dr Le Xuan Thanh The presented results are accurate and correctly cited Author Acknowledgements I would like to express my gratitudes to the teachers of Hanoi Pedagogical University 2, especially the teachers in the Department of Mathematics The lecturers have imparted valuable knowledge and facilitated for me to complete the course and the thesis In particular, I would like to express my deep respect and gratitude to Dr Le Xuan Thanh (Institute of Mathematics, Vietnam Academy of Science and Technology) who has direct guidance and helps me to complete this thesis Professionalism, seriousness and his right orientations are important prerequisites for me to get the results in this thesis Due to limited time, capacity, and conditions, my thesis cannot avoid errors I look forward to receiving valuable comments from readers Author Contents Introduction T R h R e eS tr Preliminaries S oM i Problem description and P F r S ir 3 T e hF o Experiments Z IN u Conclusions 01 01 MIP formulations 6 8 41 14 16 28 02 Chapter 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 possible tasks, events, or actions are intended to take place, or of a sequence of events in chronological order in which such things are intended to take place The process of creating a schedule - deciding how to order these tasks and how to commit resources between the variety of possible tasks - is called scheduling Having good schedules makes our life more comfortable and well- organized In social services, industrial manufacturing, transporta- tion, etc., a good schedule results in higher productive and more com- petitive outcomes How to construct good schedules for real-life as well as industrial activities is the main goal of scheduling problems Thus, one can say that scheduling problems arise naturally from practice and play a vital role in operating systems In the past few decades, the practical importance and complexity of the general scheduling prob- lems have motivated a significant volume of research in a wide variety of scheduling environments In (project) scheduling problems, a set of jobs (so-called activities, tasks) has to be processed on a set of machines in a given time hori- zon using limited resources (machines, processors, or staffs) Some constraints (on, for examples, release dates or precedence constraints between the jobs) might be imposed in the problems Often there are a finite (but usually very huge) set of possibilities for a feasible sched- ule However, usually one has to optimize certain objective function This means that we have to look for a best solution among a tremen- dous number of feasible solutions Furthermore, practical instances of scheduling problems might have very large size (up to hundreds or even millions jobs and machines) That is the motivation for aca- demic researchers to develop algorithms capable of solving large-size scheduling problems in acceptable time The performance of the algorithms depends very much on the de- sign of the algorithms themselves and data structures For the same problems, there might be many solution approaches with different levels of efficiency Such a common approach is to use mixed integer programming (MIP) in modeling the problems This approach has a two-fold advantage On one hand, it makes use of available MIP solvers, since in the recent years the solvers became much more effi- cient On the other hand, it is easy to implement the models and then solve the problems on computers In this thesis, we would like to highlight the fact that there might have different MIP formulations for representing a scheduling prob- lem, and having a good formulation is crucial in solving numerical instances of such problem For that we focus on studying the schedul- ing problem on a single machine with precedence constraints between the jobs and minimizing the total flow time More precisely, we con- sider the situation in which one has to schedule a set of jobs on a single machine Each job has its processing time and is processed without preemption Between the jobs there may be arbitrary precedence con- straints that impose which jobs have to be completed before starting another job The objective 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 the most basic scheduling problems For a comprehensive study on scheduling problems, we refer to [2] It is also shown in [2] that the problem under our consideration is NP-hard, therefore MIPbased approaches are of the most common solution methods The fact that we would like to highlight “In integer programming, formulating a good model is of crucial importance to solving the model” has already quoted in [4] 1.2 Research methods We use MIP-based approaches for solving our studied scheduling problem due to the mentioned advantages of the methods That is, we formulate the problem as different mixed integer programming formu- lations We will also test the obtained models on different instances that are randomly generated, with the help of some modeling language and integer programming solver 1.3 Results of the thesis We describe the scheduling problem on a single machine with precedence constraints between the jobs, no job preemption, and mini- mizing the total flow time We present four different MIP formulations for the problem Based on experimental results on some tested in- stances, we find out the best performance formulation 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 consideration and a short introduction to mixed integer programming • Chapter 3: Problem description and MIP formulations This chapter first describes the scheduling 10 Cj1 + Cj2 + + Cjn = pj1 + (pj1 + pj2 ) + + (pj1 + pj2 + + pj n ) = npj1 + (n − 1)pj2 + + (n − k + 1)pjk + + p jn n ∑ = (n − k + k (3.2) 1)pj k=1 Note that among jobs j = 1, , n there is exactly one job j scheduled at position k Therefore, by definition of variables zjk , we have n ∑ pjk = pj zjk (3.3) j=1 Replacing (3.3) into (3.2), we obtain the formula for the total flow time C1 + C2 + + Cn = Cj1 + Cj2 + + C jn = n n ∑ ∑ (n − k + 1)pj zjk j=1 k=1 This completes the proof of the lemma Using position variables zjk ’s, the job precedence relation i → j can be represented by the following constraint n ∑ l=1 n∑ lzjl − kzik ≥ k=1 Indeed, the former sum is the position of job j and the latter sum is the position of job i Since job i is scheduled before job j, its position must be strictly less than the position of job j Furthermore, each job must be scheduled at exactly one position, which can be represented by n ∑ k=1 zjk = ∀j = 1, , n Additionally, each position corresponds to exactly one job, which can be represented by n ∑ j=1 zjk = ∀k = 1, , n To summarize, the problem (P ) can be modeled as follows (P OSIT ION V AR) n ∑ s.t n∑ n ∑ (n − k + 1)pj zjk j=1 k=1 zjk = ∀k = 1, , n zjk = ∀j = 1, , n j=1 n ∑ n ∑ lzjl − k=1 n∑ kzik ≥ ∀i, j = 1, , n, i →j l=1 k=1 zjk ∈ {0, 1} j, k = 1, , n Chapter Experiments In this chapter, we first present how we implement and test the (M)IP formulations introduced in Chapter Then we present numerical results obtained by testing the formulations on some tested instances 4.1 ZIMPL codes We use mathematical modeling language ZIMPL [3] to implement the introduced (M)IP formulations The data of each tested instance are saved in a separated file In Code we give an example of such the data file Code 1: An example of data file # number jobs 10 10 11 12 # processing times 10 13 14 10 15 16 17 18 19 20 21 # precedence constraints 7 10 10 The data file given in Code describes an instance of the schedul- ing problem with 10 jobs The comment lines start with notation # From line to line 14 of the file, each line starts with the index of a job, then the processing time of the corresponding job For instance, line of the file shows that the job of index processes in 10 time units From line 17 to line 21 of the file, each line consists of two index numbers, in which the job of the former index must process before the job of the latter index For example, line 20 shows that the job of index must be completed before the start of job 10 In the following we respectively give the ZIMPL codes for the for- mulations introduced in Chapter Code 2: ZIMPL code for MIP formulation (C OM P L) # Get list of jobs param n := read file as "1 n" skip use 1; s e t Jobs := {1 to n }; # Get data of job processing times param p[ Jobs ] := read file as " 2 n" skip use n; # Get data of precedence constraints s e t Prec := { read file as " " skip n +4}; 10 11 12 # Define value of big M param M := sum in Jobs : p[i ]; 13 14 15 16 17 ## VARIABLES # C[j] = completion time of job j var C[ in Jobs ] >= p[j ]; # y[i ,j] =1 if job i is scheduled before job j 18 var y[ in Jobs * Jobs with i != j] binary ; 19 20 21 22 ## OBJECTIVE minimize totalFlo w : sum in Jobs : C[j ]; 23 24 25 26 27 ## CONSTRAINTS subto precedence : f o r a l l in Prec : C[j] - C[i] >= p[j ]; 28 29 30 31 subto atMostOneJob : f o r a l l in Jobs * Jobs with i != j: C[j] - C[i] >= p[j] - M * (1 - y[i ,j ]) ; 32 33 34 35 subto atMostOneJob2 : f o r a l l in Jobs * Jobs with i != j: C[i] - C[j] >= p[i] - M * y[i ,j ]; Code 3: ZIMPL code for IP formulation (T IM EIN DEX) # Get list of jobs param n := read file as "1 n" skip use 1; s e t Jobs := {1 to n }; # Get data of job processing times param p[ Jobs ] := read file as " 2 n" skip use n; # Get data of precedence constraints s e t Prec := { read file as " " skip n +4}; 10 11 12 13 # time horizon param T := sum in Jobs : p[i ]; s e t TimePeriods := {1 to T }; 14 15 16 17 ## VARIABLES # x[j ,t] = if job j completes at time t var x[ in Jobs * TimePeriods ] binary ; 18 19 ## OBJECTIVE 20 21 ]; minimize totalFlo w : sum in Jobs : sum in TimePeriods : t*x[j ,t 22 23 24 25 26 ## CONSTRAINTS subto eachJobHasCompletio n : f o r a l l in Jobs : sum in {p[j] to T }: x[j ,t] == 1; 27 subto atMostOneJob : f o r a l l in {0 T -1}: sum in Jobs : sum in {( t +1) to 30 (t + p[j], T) }: x[j , tau ] = p[j ]; Code 4: ZIMPL code for IP formulation (ORDERV AR) # Get list of jobs param n := read file as "1 n" skip use 1; s e t Jobs := {1 to n }; # Get data of job processing times param p[ Jobs ] := read file as " 2 n" skip use n; # Get data of precedence constraints s e t Prec := { read file as " " skip n +4}; 10 11 12 13 ## VARIABLES # y[i ,j] = iff job i is scheduled before job j var y[ in Jobs * Jobs with i != j] binary ; 14 ## OBJECTIVE minimize totalFlo w : sum in Jobs : sum in Jobs - {j }: p[i ]* y[i 17 ,j] 18 + sum in Jobs : p[j ]; 15 16 19 20 ## CONSTRAINTS 21 22 23 24 25 26 27 28 29 30 31 32 su ei bt f o y , su no bt Cy f o wi thy , su pr bt ec f o y , Code 5: ZIMPL code for IP formulation (P OSIT ION V AR) # Get list of jobs param n := read file as "1 n" skip use 1; s e t Jobs := {1 to n }; # Get data of job processing times param p[ Jobs ] := read file as " 2 n" skip use n; # Get data of precedence constraints s e t Prec := { read file as " " skip n +4}; 10 11 12 13 ## VARIABLES # z[j ,k] = if job j is scheduled at position k var z[ in Jobs * Jobs ] binary ; 14 ## OBJECTIVE minimize totalFlo w : sum in Jobs : sum in Jobs : (n -k +1) *p[j ]* 17 z[j ,k ]; 15 16 18 19 20 21 22 ## CONSTRAINTS subto oneJobPerPositio n : f o r a l l in Jobs : sum in Jobs : z[j ,k] == 1; 23 24 subto onePositionPerJo b : 25 26 27 28 29 30 f o suz[

Ngày đăng: 23/08/2019, 17:14

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w