62
PRODUCTION SCHEDULING IN A CAMPAIGN BASED FLEXIBLE FLOW SHOP May 2012 Rannveig Guðmundsdóttir Master of Science in Engineering Management

PRODUCTION SCHEDULING IN A CAMPAIGN BASED FLEXIBLE FLOW SHOP · PRODUCTION SCHEDULING IN A CAMPAIGN BASED FLEXIBLE FLOW SHOP Rannveig Guðmundsdóttir Master of Science Engineering

  • Upload
    hadiep

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

PRODUCTION SCHEDULING IN ACAMPAIGN BASED FLEXIBLE

FLOW SHOP

May 2012Rannveig Guðmundsdóttir

Master of Science in Engineering Management

PRODUCTION SCHEDULING IN ACAMPAIGN BASED FLEXIBLE FLOW SHOP

Rannveig GuðmundsdóttirMaster of ScienceEngineering ManagementMay 2012School of Science and EngineeringReykjavík University

M.Sc. RESEARCH THESISISSN 1670-8539

Production scheduling in a campaign based flexible flowshop

by

Rannveig Guðmundsdóttir

Research thesis submitted to the School of Science and Engineeringat Reykjavík University in partial fulfillment of

the requirements for the degree ofMaster of Science in Engineering Management

May 2012

Research Thesis Committee:

Eyjólfur Ingi Ásgeirsson, SupervisorPh.D, Assistant Professor, School of Science and Engineering atReykjavík University

Hlynur Stefánsson, SupervisorPh.D, Assistant Professor, School of Science and Engineering atReykjavik University

Margrét Vilborg Bjarnadóttir, ExaminerPh.D, Assistant Professor, University of Maryland

CopyrightRannveig Guðmundsdóttir

May 2012

Date

Eyjólfur Ingi Ásgeirsson, SupervisorPh.D, Assistant Professor, School of Science and Engi-neering at Reykjavík University

Hlynur Stefánsson, SupervisorPh.D, Assistant Professor, School of Science and Engi-neering at Reykjavik University

Margrét Vilborg Bjarnadóttir, ExaminerPh.D, Assistant Professor, University of Maryland

The undersigned hereby certify that they recommend to the School of Sci-ence and Engineering at Reykjavík University for acceptance this researchthesis entitled Production scheduling in a campaign based flexible flowshop submitted by Rannveig Guðmundsdóttir in partial fulfillment of therequirements for the degree of Master of Science in Engineering Manage-ment.

Date

Rannveig GuðmundsdóttirMaster of Science

The undersigned hereby grants permission to the Reykjavík University Li-brary to reproduce single copies of this research thesis entitled Productionscheduling in a campaign based flexible flow shop and to lend or sell suchcopies for private, scholarly or scientific research purposes only.

The author reserves all other publication and other rights in association withthe copyright in the research thesis, and except as herein before provided, nei-ther the research thesis nor any substantial portion thereof may be printed orotherwise reproduced in any material form whatsoever without the author’sprior written permission.

Production scheduling in a campaign based flexible flow shop

Rannveig Guðmundsdóttir

May 2012

Abstract

In today’s manufacturing environment, where the competition is constantlyincreasing, there is increased pressure to reduce the production cost andtherefore good scheduling approaches become more important. The aim ofthis research is to improve the production scheduling process at a pharmaceu-tical company. The manufacturing plant operates in campaign mode. Prod-ucts that belong to the same product family are produced consecutively bythe same machine in order to minimize the set-up and cleaning times. Long-term campaign plan is created based on a sale forecast. Short-term scheduleis also created based on real orders. In this study an optimization model ispresented that arranges the orders in the campaign plan. To keep the structureof the long-term campaign plan, there is a limitation on how much the short-term schedule can deviate from the long-term campaign plan. The resultsindicate that the model proposed in this study could be used as a decisionmaking tool when scheduling orders into a preplanned campaign plan. Themodel could give the schedulers an idea of how they might change the pre-planned campaign plan in order to schedule more orders and/or to minimizethe delay, and to evaluate whether the change is worth it or not. Moreover itcan reduce the valuable time the schedulers spend in scheduling.

Notkun á bestunarmódeli við verkniðurröðun í framleiðslu

Rannveig Guðmundsdóttir

Maí 2012

Útdráttur

Þar sem samkeppnin í framleiðsluiðnaði er stöðugt að aukast þá er meiriáhersla lögð á lægri framleiðslukostnað. Því eru aðferðir sem bæta verkniður-röðun mikilvægari en áður. Markmiðið með þessu verkefni er að bæta verkniður-röðunarfelið hjá lyfjafyrirtæki. Eins og algengt er í lyfjaframleiðslu þá áframleiðslan sér stað í lotum. Þá eru vörur sem tilheyra sömu vörufjöl-skyldu framleiddar saman í lotu í því skyni að lágmarka uppsetningartímaá framleiðsluvélunum. Gerð er langtíma lotuáætlun sem er byggð á sölus-pám. Einnig er gerð skammtímaáætlun byggð á raunverulegum pöntunum.Í verkefninu er sett fram bestunarmódel sem raðar pöntunum niður á fram-leiðsluvélar. Módelið býr til skammtímaáætlun sem byggir á langtíma lo-tuáætluninni. Til að halda uppbyggingunni frá langtímaáætluninni þá er tak-mörkun á því hversu mikið skammtímaáætlunin getur vikið frá langtíma lo-tuáætluninni. Niðurstöðurnar gefa til kynna að hægt er að nota módel semþetta til þess að fá hugmyndir um hvernig hægt sé að aðlaga lotuáætlunina tilað koma fleiri pöntunum á áætlun sem og að lágmarka seinkun á afhendinguþeirra pantana sem komast á áætlun. Að auki gæti notkun á módelinu dregiðúr þeim tíma sem þarf að eyða í niðurröðun verka.

v

Acknowledgements

I would like to thank my supervisors, Dr. Eyjólfur Ingi Ásgeirsson and Dr. Hlynur Ste-fánsson, for their excellent guidance, advice and support during this research work. Iwould also like to thank Actavis, especially Sigrún Gunnhildardóttir and Sindri Friðriks-son for providing me with the data and their assistance regarding the data, and GuðrúnSjöfn Axelsdottir for her help with the data. Finally I would like to thank MPL for pro-viding me with a licence for their modelling system.

vi

vii

Contents

List of Figures ix

List of Tables xi

1 Introduction 11.1 Statement of the problem . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Aim and objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Structure of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Literature review 52.1 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Campaign planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 Recent works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 The MIP Model 93.1 Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.2 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.4 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.5 Model assumptions and limitations . . . . . . . . . . . . . . . . . . . . . 17

3.5.1 Proposed improvement . . . . . . . . . . . . . . . . . . . . . . . 203.6 Model verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4 Dataset 25

5 Results 275.1 Number of unscheduled orders . . . . . . . . . . . . . . . . . . . . . . . 285.2 Tardiness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.3 Number of delayed orders . . . . . . . . . . . . . . . . . . . . . . . . . 305.4 Sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

viii

5.5 Results summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

6 Conclusions and further work 33

A 37A.1 The code written in MPL . . . . . . . . . . . . . . . . . . . . . . . . . . 37

B 41B.1 The data for test case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 41B.2 The data for test case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

ix

List of Figures

1.1 Possible production routes for a single product through the productionprocess. The stages at the pharmaceutical company are granulation, com-pression, coating and packing. The figure is retried from reference . . . . 2

1.2 An illustration on how jobs are assigned to campaigns, where j representthe jobs. Different color represent different product family. . . . . . . . . 3

3.1 Campaign c cannot start earlier than the end time of a previous campaignprocessed on the same machine in addition to the set-up time needed. . . 15

3.2 Representation of Ej and Sj . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Possible ways for jobs going to next stage . . . . . . . . . . . . . . . . . 153.4 The start-time of a job must be greater than the end-time of the precursor

job, defined by Constraint (3.7) . . . . . . . . . . . . . . . . . . . . . . . 163.5 An example of how the model can provide infeasible solution. The blue

lines represent the actual end time of jobs, the thick black line representdefined end time of jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.6 Illustration of how the same type of jobs might go to different campaignson following stages. The red and green lines represent the actual end timefor the products. Different color represent the different packages type. . . 19

3.7 An example of when a campaign is not allowed to start its operation untilall precursors campaigns have end their operations. . . . . . . . . . . . . 19

3.8 Illustration of Constraint (3.35) . . . . . . . . . . . . . . . . . . . . . . . 213.9 The preplanned campaign plan where different colors represent different

product families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.10 The schedule for test case 1. . . . . . . . . . . . . . . . . . . . . . . . . 223.11 The schedule for test case 2. . . . . . . . . . . . . . . . . . . . . . . . . 23

5.1 How the number of unscheduled jobs varies with different values of al-lowed changes in the campaigns. . . . . . . . . . . . . . . . . . . . . . . 29

x

5.2 How the value of total tardiness varies with different values of allowedchanges in the campaigns. . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.3 How the value of average tardiness varies with different values of allowedchanges in the campaigns. . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.4 How the number of delayed orders varies with different values of allowedchanges in the campaigns. . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.5 Sensitivity analysis on number of unscheduled orders . . . . . . . . . . . 32

xi

List of Tables

5.1 The values of the modelling parameters used in the executions. . . . . . . 285.2 Results when using different modelling parameters. . . . . . . . . . . . . 29

xii

1

Chapter 1

Introduction

In today’s manufacturing environment, where the competition is constantly increasing,there is increased pressure to reduce the production cost and therefore good schedulingapproaches become more important. Scheduling deals with the allocation of availableresources to tasks over a given time period. In manufacturing industry it refers to theallocation of operations to the available machines in addition to the decision on what toproduce, when to produce it and how to produce it. Good scheduling may result in betterutilization of the available equipment, reduced lead time of products and lower productioncost. Therefore it is advisable for manufacturing firms to consider how they can obtain anoptimal schedule.

1.1 Statement of the problem

This study is based on a real world problem where a pharmaceutical company needs toschedule its production process. The company produces a wide range of products in aflexible flow shop production environment. As stated in [1], a flow shop is a schedulingproblem with n products and m machines. All products have to be processed on each oneof the machines and all products have to follow the same route. A flow shop differs froma job shop where each product has its own predetermined route, and from a open shophaving no ordering constraints. A flexible flow shop is a generalization of the flow shopproblem. In a flexible flow shop production, each product has to go through a number ofstages in the production process, and all products have to follow the same route. The flowshop problem is NP-hard and therefore difficult to solve exactly [2]. Since a flexible flowshop is more complex than a flow shop, the problem is NP-hard as well. The complexityin this problem increases even more since on every production stage there is a number of

2 Production scheduling in a campaign based flexible flow shop

unrelated machines in parallel which means that the machines on each stage are not iden-tical and the processing times for jobs might be different among the machines. The set-uptimes on the machines that are needed between operations of two different products aresequence dependent. Figure 1.1 [3] shows the complexity of choosing a production routefor a single product through the production process.

Figure 1.1: Possible production routes for a single product through the production pro-cess. The stages at the pharmaceutical company are granulation, compression, coatingand packing. The figure is retried from reference

In order to reduce the complexity of the problem, arising from the sequence dependentset-up times, the company uses a campaign production. The products are categorizedinto product families where similar products belong to the same product family. Eachproduction stage is operated in a batch mode where a batch is the smallest quantity that isproduced of each product. In order to minimize the set-up and cleaning times that arisewhen switching between batches of different product families, several batches from thesame product family are produced consecutively by the same machine. This collection ofbatches are called a campaign. Illustration of how batches generate a campaign can beseen in Figure 1.2. In this study, the operation of processing a product will be split up intoseveral jobs, one job for the process on each stage. Jobs that are needed to process a singleorder generate a work package. In Figure 1.2 jobs 1-4 generate one work package.

Rannveig Guðmundsdóttir 3

Figure 1.2: An illustration on how jobs are assigned to campaigns, where j represent thejobs. Different color represent different product family.

The production process is mainly make-to-order, where the company produces to fulfillcustomer orders with specific due dates. The company creates a long-term campaign planwhich covers a one year time horizon. The long-term plan is based on sale forecasts sincethe actual orders have not yet been received. The long-term plan determines the timingof every campaign and the duration, and which machines and what materials are neededfor each campaign production. The purchase of raw materials from suppliers is based onthe campaign plan since the lead time of raw materials may be greater than the promisedlead time of the final products. The campaign plan is also necessary for other planningdecisions, for example maintenance, shifts and launches of new products. Every weekthe firm receives new orders from customers and they are given feedback with promiseddelivery dates. The sale forecast that was used to create the campaign plan is uncertainso it is necessary that the plan can be adjusted when the firm receives the actual orders.Therefore a short-term plan is created when the actual orders are scheduled. The short-term plan determines when to produce each order and in which campaign.

It is a challenging task to create a good schedule, and time consuming as well. Todaythe firm schedules its production process manually within a production software system.The employees that work on scheduling the orders are experienced in this field, so themanual schedule is already quite good. However, if it is possible to improve the scheduleit might lead to a great financial gain for the company, and increase customers satisfactionby delivering orders on time.

4 Production scheduling in a campaign based flexible flow shop

1.2 Aim and objective

The aim of this study is to improve the production scheduling process by building a math-ematical model that will strive for the optimal solution to the scheduling problem, as wellto automate the scheduling process. The short-term schedule will be based on the long-term campaign plan but adapted to the available information when the schedule is made.To hold the structure of the long-term campaign plan, there will be a limitation on howmuch the short-term schedule can deviate from the long-term plan.

There are two objectives in the model. The primary objective is to add as many ordersas possible to the schedule. The secondary objective is to deliver as many orders as pos-sible before the requested delivery dates. The theoretical expression of the secondaryobjective is to minimize the tardiness. If the completion time of a work package w isdenoted as Cw and the due date of order w is denoted as dw then tardiness is defined as:Tw = max(Cw − dw; 0). Tardiness is positive when product is delivered late and zerowhen product is delivered on time or early.

1.3 Structure of the thesis

The structure of the thesis is as follows: Chapter 2 is a literature review. In Chapter3 the optimization model is formulated, explained and verified. The dataset from thepharmaceutical company used in this study is described in Chapter 4. The results arepresented in Chapter 5 and the conclusions from the results in addition to ideas of futurework are discussed in Chapter 6.

5

Chapter 2

Literature review

2.1 Scheduling

Scheduling problems have been studied extensively in the literature. In this chapter themain literature related to this study is reviewed. Production scheduling is often identi-fied with Frederick Taylor and Henry L. Gantt. In 1911 Taylor published his work, ThePrinciples of Scientific Management [4], in which he emphasized the benefits of applyingscientific methods when managing a company. Gantt supported Taylor’s scientific meth-ods and to improve the decision making he developed the Gantt charts to compare theplanned and actual production [5]. As mentioned before production scheduling problemsare usually divided into three basic categories: open shop, job shop and flow shop. Asstated in [1] the open shop environment has no ordering constraints on the operationsso the products do not necessarily have to follow the same route through the productionprocess. In a job shop environment, each product has its own predetermined route, andin a flow shop environment all products follow the same route through the productionprocess. The problem under consideration in this study is a flexible flow shop. A flexi-ble flow shop has a number of stages and at every stage there are number of machines.Processing a product has to follow the same route through the stages, and be operated onone machine on each stage. Arthanari and Ramamurthy [6] and Salavdor [7] were amongthe first to define the flexible flow shop problem. As mentioned before flexible flow shopproblems are NP-hard. Therefore heuristic methods are often used to obtain a good so-lution. Jungwattanakit et al. [8] compared scheduling algorithms for a flexible flow shopwith unrelated parallel machine and sequence dependent setup times.

6 Production scheduling in a campaign based flexible flow shop

Srikar and Gosh [9] studied n-job, M-stage flowshop with sequence dependent set-uptimes. They formulated a mixed integer linear program (MILP) without using the tradi-tional integer binary sequencing variable at that time. Instead of using a binary variablethat states if a job i is scheduled immediately precedes job j, they used a binary variablethat states if a job i is scheduled anytime before job j. By defining the integer binarysequencing variable in this way they were able to considerably reduce the number of in-teger binary variables. This definition of the binary sequencing variable will be used inour model.

2.2 Campaign planning

The main subject of this study is to create a production schedule based on a campaign plan.Campaign production is highly common in chemical industries. Mauderli and Rippin [10]were among the first to address the problem of planning in batch plants. Grunow et al.[11] introduced a hierarchical framework for campaign planning and resource schedulingbased on mixed-integer linear and constraint programming. The approach was especiallydesigned to co-ordinate the various plant operations within multi-plant supply networksin the chemical industry. Susarla and Karimi [12] used a basic model of Sunderamoorthyand Karimi [13] and modified it to develop a simple MILP model for simultaneous cam-paign planning and resource allocation in multi-stage batch plant. They present a generalframework to perform a scenario study based on the variation of productivity with dif-ferent resource allocation profiles. To deal with the uncertainty in future data the plan isreviewed and updated regularly. The aim of the work proposed in this paper is allocatingjobs into preplanned campaign plan, instead of creating a campaign plan and simultane-ously allocating the jobs into the campaigns.

2.3 Recent works

The inspiration of this study is a study by Stefanson et al. [3]. They used a dataset fromthe same pharmaceutical company as this study. They introduced a multi-scale modellingapproach with three hierarchical levels of decisions. At the top level they proposed amodel to optimise a campaign plan for long-term planning purposes based on a demandforecast. At the middle level they proposed a model to re-optimize the campaign plansimultaneously with allocating orders within the campaigns. At the lowest level they

Rannveig Guðmundsdóttir 7

proposed an optimization model for the detailed scheduling of all production tasks. Aniterative procedure was proposed to test the plans against a host of potential scenarios thatcover a large proportion of possible outcomes. The drawback of their study is that thecampaign structure from the long term plan did not hold well enough to the short termplan. The connection between the middle level and the lowest level of decision was there-fore insufficient.

Axelsdottir et al. also studied the same problem [14], [15]. In their work, the focus wason the short term planning, the jobs were scheduled to the preplanned campaigns using amixed integer model. They showed that it is possible to automate the scheduling process.The results from the model were better than the manual scheduling when the schedulerexperts did not change the campaigns. However, the schedulers can adjust the campaignplan manually within the production software system, so the campaigns fit the receivedorders better. The schedulers can increase and decrease the campaigns sizes, as well ascreate additional campaigns if needed. The mixed integer model did not include the op-tion to adjust the campaigns. When the schedulers adjusted the campaign plan, the resultfrom the manual method were better than with the automated method.

When the long term plan is made, the demand is uncertain so the plan is based on asale forecast. It is necessary that the short term plan can be adapted to the real demandand changed circumstances. In the work proposed in this paper we create a productionschedule with preplanned campaigns, but with the option of changing the campaigns. Thechanges can both be in terms of the size of campaigns, and also in terms of time, i.e. itis possible to move them. It is also possible to create additional campaigns as well asdeleting campaigns that are not needed. The model will determine the optimal campaignplan. It is possible to limit the number of changes that are made with respect to the pre-planned campaigns so the campaign structure from the long term plan will hold relativeto how many changes are permitted.

8

9

Chapter 3

The MIP Model

In this chapter the optimization model is presented. First all indexes, data and variablesare introduced. Then the optimization model is formulated and explained. Thereafter theassumptions and limitations of the model are discussed. The chapter finishes with modelverification.

The model is a mixed integer model and is designed to place jobs to campaigns. Asmentioned before, the campaigns are defined in the long-term plan, and the model usesthose predefined campaigns. To adapt the campaign plan to the actual demand, the modelhas the potential to increase and decrease the size of the campaigns, move them and toadd new ones. In order to keep the structure of the long-term plan there is a limit on howmany changes the model can make to the predefined campaigns. Two objectives are inthe optimization model. One is to schedule as many jobs as possible, and the other is tominimize the tardiness. The scheduler needs to assess the importance of both objectives.If any jobs are unscheduled they will be carried forward and hopefully scheduled in thenext schedule. In order to reduce the running time, the model will only assign the jobsto campaigns but not arrange the jobs within every campaign. The orders within thecampaigns are mostly predefined based on the characteristic of the product variations inthe campaigns so that part is not very time consuming, and the schedulers prefer havingthe freedom to arrange the jobs themselves.

10 Production scheduling in a campaign based flexible flow shop

3.1 Indexes

The model uses 7 sets of indexes to represent the campaigns, machines, jobs and workpackages. Following is the list of indexes:

A: set of machines, m ∈ AC: set of campaigns, c ∈ C, C = Cold ∪ Cnew, Cold ∩ Cnew = ∅Cold: subset of campaigns, set of predefined campaigns.Cnew: subset of campaigns, set of potential new campaigns.Cm: set of campaigns c that are processed on machine m.J : set of jobs, j ∈ JJlast: subset of jobs, the jobs on the last stage. Jlast ∈ J

3.2 Data

In the model following data are used as an input:

STOc: Start time of original campaign cETOc: End time of original campaign cθc: The occupied space in campaign c, the part of the campaign which has already beenassigned to a job.dj: Due date of job jPjc: Processing time of job j in campaign cstc′c: Set-up time between campaign c’ and ctj: Type (product family) of job jtc: Type of jobs allowed in campaign csj: Stage of job jsc: Stage of campaign cα: Penalty factor for unscheduled jobsβj: Weight for job jDiffLimit: The limit on total differences in preplanned campaignsNrChangesLimit: The limit on number of changes to preplanned campaignsSizeNCLimit: The limit on total size of new campaignsNrNCLimit: The limit on number of new campaigns used

Rannveig Guðmundsdóttir 11

To give the model an option to create additional campaigns, an additional campaign foreach product family and every stage was created with start time and end time equal tozero:STOc = 0 ∀c ∈ Cnew

ETOc = 0 ∀c ∈ Cnew

3.3 Variables

To formulate the problem, nine sets of continuous variables and five sets of binary vari-ables are used.

Tardiness is defined for all jobs, to measure how late an order is delivered if it is de-livered late.

Tj: Tardiness for job j

The model is able to change the campaigns, therefore it is needed to define a new start-time and new end-time for every campaign.

STNc : The start-time of campaign c in the final solutionETNc : The end-time of campaign c in the final solution

Since the model does not arrange the jobs within the campaigns, the exact completiontime of each job is unknown. Instead the pessimistic start time and optimistic end time ofjobs within a campaign is defined and will be used as an approximation:

Ej : The end time of the first job in campaign cSj : The start time of the last job in campaign c

To be able to limit the amount of changes that the model will make from the initial cam-paign plan, the next four sets of decision variables are defined:

DiffStc : The difference in start time for campaign cDiffETc : The difference in end time for campaign cDiffTotalc : The total difference, the sum of the difference between start- and the end-

12 Production scheduling in a campaign based flexible flow shop

time of campaign c.SizeNCc: The size of new campaign c

The first binary variable defines which jobs are scheduled to which campaign. Let

xjc =

{1, if a job j is scheduled in campaign c; ∀j ∈ J, c ∈ C0, otherwise

The model is allowed to move campaigns and change the order of them. Therefore avariable is needed that defines the order of the campaign. Let

Vc′c =

{1, if a campaign c’ is placed before campaign c; ∀c′, c ∈ C0, otherwise

The model attempts to schedule as many jobs as possible, but if there is no availablecampaign for a job then the job is put on a list of unscheduled jobs. Let

yj =

{1, if job j is not scheduled to a campaign; ∀j ∈ J0, otherwise

To give the scheduler a chance to restrict the number of changed campaigns to a cer-tain limit, a variable is defined that counts the number of changed campaigns. Let

zc =

{1, if there are any changes in campaign c; ∀c ∈ C0, otherwise

The scheduler will also have the option to limit how many new campaigns are created. Let

qc =

{1, if any job is assigned to the potential new campaign c ∀c ∈ Cnew

0, otherwise

3.4 Model

In this section the mixed integer model that was developed to imitate the real schedulingproblem is presented. Equation (3.1) defines the objective of the model, and Equations(3.2)-(3.30) define the constraints. An explanation of each equation follows the model.

Rannveig Guðmundsdóttir 13

min α∑

j∈Jlast

βjyj +∑

j∈Jlast

βjTj (3.1)

s.t. STNc ≥ ETNc′ + Stc′c −MVc,c′ ∀c, c′ ∈ Cm,m ∈ A (3.2)

ETNc ≥ STNc +∑j∈J

Pjcxjc + θc ∀c ∈ C (3.3)

ETNc ≤ maxETOc′ ∀c, c′ ∈ C (3.4)

Ej ≥ STNc + Pjc −M(1− xjc)

∀j ∈ J, c ∈ C : tj = tc, sj = sc (3.5)

Sj ≤ ETNc − Pjc +M(1− xjc)

∀j ∈ J, c ∈ C : tj = tc, sj = sc (3.6)

Sj ≥ Ej′ ∀j′, j ∈ J : j′ ≺ j (3.7)

Tj ≥ Ej − dj −Myj ∀j ∈ Jlast (3.8)

xjc = 0 ∀j ∈ J, c ∈ C : tj 6= tc, sj 6= sc (3.9)

Vc′c + Vcc′ = 1 ∀c′, c ∈ C (3.10)∑c∈C

xjc + yj = 1 ∀j ∈ J (3.11)

yj ≤ yj′ ∀j, j′ ∈ J : j′ ≺ j (3.12)

DiffSTc ≥ STNc − STOc ∀c ∈ Cold (3.13)

DiffSTc ≥ STOc − STNc ∀c ∈ Cold (3.14)

DiffETc ≥ ETNc − ETOc ∀c ∈ Cold (3.15)

DiffETc ≥ ETOc − ETNC ∀c ∈ Cold (3.16)

DiffTotalc ≥ DiffSTc +DiffETc ∀c ∈ Cold (3.17)∑c∈Cold

DiffTotalc ≤ DiffLimit (3.18)∑c∈Cold

zc ≤ NrChangesLimit (3.19)

DiffTotalc ≤Mzc ∀c ∈ Cold (3.20)

SizeNewCampc ≥ ETNc − STNc ∀c ∈ Cnew (3.21)∑c∈Cnew

SizeNewCampc ≤ SizeNewCLimit (3.22)∑c∈Cnew

qc ≤ NrNewCLimit ∀c ∈ Cnew (3.23)

SizeNewCampc ≤Mqc ∀c ∈ Cnew (3.24)

Tj ≥ 0 ∀j ∈ J (3.25)

14 Production scheduling in a campaign based flexible flow shop

xjc ∈ {0, 1} (3.26)

Vc′c ∈ {0, 1} (3.27)

yj ∈ {0, 1} (3.28)

zc ∈ {0, 1} (3.29)

qc ∈ {0, 1} (3.30)

The objective function (3.1) consists of two components. The first component minimizesthe number of jobs that are not scheduled to a campaign and the second component mini-mizes the sum of tardiness for all orders. To define the weight difference between the twocomponents a factor α is placed before the first one. In our model the primary objectiveis to schedule as many orders as possible, it is considered more important and therefore αis set > 1. The secondary objective is to minimize the tardiness for the scheduled orders.βj represents the weight for job j if j is on the last stage. More important orders havegreater βj than others. If data regarding βj is not available then all orders can be assumedto have βj =1.

Constraint (3.2) ensures that the campaigns that are processed on the same machine donot overlap. The constraint prevents campaign c from starting earlier than the end timeof a previous campaign processed on the same machine in addition to the set-up timeneeded, as can be seen in Figure 3.1. M represents a large number and by using M par-allel with a binary variable when formulating less-than or greater-than constraints theycan be activated or inactivated depending on the value of the binary variable. Constraint(3.3) ensures that a job is not assigned to a campaign unless the campaign has availablespace. The end time of a campaign must be later than the start time in addition to the totalprocessing time of the jobs assigned to that campaign (both the jobs that was already as-signed to that campaign and the jobs that are assigned to that campaign now). Constraint(3.4) ensures that the end time of a campaign is no later than the end time of the latestpreplanned campaign. With this constraint the model prevents the campaign plan fromextending.

As mentioned before, the model does not arrange the jobs within the campaigns, it onlydecides which jobs are assign to which campaign. Therefore the exact completion timeof process for each order is unknown. Instead of defining the exact completion time foreach job the end time of the first job in every campaign c is defined by Constraint (3.5),and will be used as an approximation of the actual end time. This value is the optimisticvalue of the end time for the jobs in that campaign, and is the first time possible for jobs

Rannveig Guðmundsdóttir 15

Figure 3.1: Campaign c cannot start earlier than the end time of a previous campaignprocessed on the same machine in addition to the set-up time needed.

to be finished in the campaign, and go to the next stage. Constraint (3.6) defines in thesame way the pessimistic value of start time of job j in campaign c, which is the starttime of the last job in the campaign. Constraint (3.7) ensures that the pessimistic starttime of a job is at least greater than the optimistic end time for the precursor job on theprevious stage. Figure 3.2 explains the definition of Ej and Sj further. An illustration ofthe possible ways for jobs going to the next stage can be seen in Figure 3.3, and Figure3.4 the boundaries that Constraint (3.7) defines are shown.

Figure 3.2: Representation of Ej and Sj

Figure 3.3: Possible ways for jobs going to next stage

The constraint in Equation (3.8) defines the tardiness for all orders, which is how late anorder is delivered if the order is delivered late. In this model the optimistic value will beused as an approximation of the completion time so the tardiness is defined as the differ-ence of the completion time of the first product in the campaign and the due date for thatorder. The constraint is only active if the order was put on the schedule. The pessimisticvalue of the completion time for product could also be used as a definition of tardiness,i.e. the completion time for processing the last product in the campaign. The tardiness

16 Production scheduling in a campaign based flexible flow shop

Figure 3.4: The start-time of a job must be greater than the end-time of the precursor job,defined by Constraint (3.7)

would then be the difference of the completion time for the last product and the due datefor that product, defined by Constraint (3.31)

Tj ≥ STNc +∑j′∈J

xj′cPj′c − dj −M(1− xjc) ∀j, j′ ∈ Jlast, c ∈ C (3.31)

where STNC is the start time of campaign c,∑j′∈J

xj′cPj′c is the total processing time for

all jobs operating in campaign c, and dj is the due date for the order under consideration.These two options for definition of tardiness were both considered suitable and the firstone was chosen.

Constraint (3.9) ensures that if a job is assigned to a campaign, it is of the same productfamily and same stage and the jobs include in that particular campaign. If campaigns cand c′ both operate on machine m, then campaign c must be scheduled before or aftercampaign c′, therefore Constraint (3.10) is used to ensure that the campaigns are sched-uled in some order. Constraint (3.11) assigns all jobs either to a campaign or to a listof unscheduled jobs. To make sure that a job is not scheduled to a campaign unless theprecursors jobs are scheduled as well, Constraint (3.12) is used.

Constraints (3.13)-(3.17) calculate the difference between the predefined campaign planand the campaign plan in the final solution. Constraints (3.13)-(3.14) define the absolutevalue of the difference in the start time, and Constraints (3.15)-(3.16) define the absolutevalue of the difference in the end time. The total difference for each campaign is definedby Constraint (3.17) by summing up the difference in start time and the difference in end

Rannveig Guðmundsdóttir 17

time. The drawback with this definition is when a campaign is moved by one unit andthe size remains the same it results in a greater difference than when size of a campaignis increased by one unit. When a campaign is moved by one unit both start time and endtime has a difference of one unit and the campaign difference becomes two units. Anothermethod to calculate the campaign difference was considered, to break the difference upinto two components, one that calculates the difference in campaign size and anotherthat calculates the displacement. The displacement would be based on the center of thecampaign (start time + 0.5(end time - start time). That method has two difference factors,and we do not have any criteria to put weight on these two components. The previousmethod was considered to be simpler and clearer and therefore chosen. Constraint (3.18)gives the scheduler a chance to limit the total differences in all predefined campaigns,and by using Constraint (3.19) it is possible to restrict the total number of changes in thepredefined campaigns. If there are no changes made in a preplanned campaign, the valueof DiffTotalc in the same campaign must be zero, as can be seen in Constraint (3.20).The Constraints (3.13)-(3.20) only apply to the preplanned campaigns. To begin with thenew campaigns have both start-time and end-time equal to zero. If the model creates anew campaign it will set a value to both the start time and the end time. The campaigndifference does not apply to the new campaigns since if a new campaign is created furtherahead it will count for a greater difference than a new campaign that is created earlierin time. Nevertheless, it must be possible to restrict the size of the new campaigns, soConstraint (3.21) is used to calculate the size of all new campaigns. Constraint (3.22) isused to restrict the sum of the size in all new campaigns, and Constraint (3.23) is usedto restrict the number of new campaigns. If a possible new campaign c is not used, thenthe value of the size in that campaign must be zero, which is enforced by Constraint(3.24).

3.5 Model assumptions and limitations

Since the model is only an imitation of the real scheduling problem at hand, it has lim-itations. The most relevant data was gathered but in order to formulate the model in ageneral way it was also necessary to make assumptions. The limitations and assumptionsare outlined here.

All customer orders were assumed to be equally important so βj was set to 1 for all jobs.In reality this is not the case. The orders differs in both size and importance, for examplesome products may provide a higher profit margin than others. The model will probably

18 Production scheduling in a campaign based flexible flow shop

prefer to schedule orders with shorter processing time to be able to put more orders in theschedule regardless of the profit margin that the products provide. Products providing ahigher profit margin and/or orders from important customers should have higher weightfactors. It might also be an option for customers to pay for faster delivery.

The function of tardiness is assumed to be linear. It is assumed to be equivalent delivering100 orders one day after their due date and to deliver one order 100 days after its due date.Moreover it is assumed to be equivalent when delivery of a product delays from being ontime to be delayed by one day, and when delivery of product delays from being delayedby 1000 days and to be delayed by 1001 days. In reality this is probably not equivalent.

As mentioned before the model does not arrange the jobs within each campaign and there-fore the completion time of each job is not known with certainty. There is a change ofan infeasible solution since the model only ensures that the pessimistic start time of a jobis later than the optimistic end time of the precursor job on the stage before, defined byConstraint (3.7). There is a chance for a job to be assigned to a campaign, even thoughits predecessor has not been processed. Figure 3.5 illustrate this better. To prevent this

Figure 3.5: An example of how the model can provide infeasible solution. The blue linesrepresent the actual end time of jobs, the thick black line represent defined end time ofjobs

infeasibility, pessimistic end time of a job could be used instead of optimistic end time.Pessimistic end time of a job is the end time of the latest job in the campaign. Thedrawback from this implementation is when the same type of product goes to differentcampaigns in the following stage. For example when the same type of product is packedin several types of packages, a drug can i.e. be packaged in both glasses and blisters.In such cases, it is impractical not allowing the following campaign to end earlier. This

Rannveig Guðmundsdóttir 19

Figure 3.6: Illustration of how the same type of jobs might go to different campaigns onfollowing stages. The red and green lines represent the actual end time for the products.Different color represent the different packages type.

is explained better in Figure 3.6. Another way to prevent the infeasibility would be notallowing a campaign to start earlier than the end time of all precursors campaigns, as canbe seen in Figure 3.7. This is also impractical since the first jobs in a campaign cannot goto the next stage until all jobs within the campaign have complete their operations.

Figure 3.7: An example of when a campaign is not allowed to start its operation until allprecursors campaigns have end their operations.

These options to prevent infeasibility issues were considered but in order to maintain thegenerality of the model, as well to be sure that the best solution is not blocked, the modelwas formulated in the proposed way. The schedulers can easily spot this infeasibility ifit occurs and adjust the solution. Since the model is using the optimistic value of the endtime of jobs, it is possible to create a buffer to use if the model provides an infeasiblesolution. The production capacity of the machines might be assumed to be lower than theactual capacity. By experience the company can set a suitable rate of the real capacity.The model provides only a plan, a scheduler is always needed to review the plan with theassumptions and limitations in mind and make changes if necessary.

20 Production scheduling in a campaign based flexible flow shop

3.5.1 Proposed improvement

To prevent infeasible solutions without above mentioned technical difficulties it would benecessary to arrange the jobs within the campaigns as well. The model would includethe campaign structure in addition to variables defining the completion time of each job.The model would be similar to the model proposed in Chapter 3.4. Constraints (3.5)-(3.8)which define the optimistic end time of jobs (Ej) and pessimistic start time of jobs (Sj)would be excluded, and constraints defining the completion times of jobs would be addedinstead. In addition the definition of tardiness will change.

Variables that define the exact completion time of each job is needed:ctj: the completion time of job j

Since the jobs are arranged within the campaigns, a variable defining the order of jobsis necessary. Let:

gj′j =

{1, if job j’ is scheduled before job j; ∀j′, j ∈ J0, otherwise

The Constraints that replace Constraints (3.5)-(3.8) are following:

Tj ≥ ctj − dj −Myj ∀j ∈ Jlast (3.32)

ctj ≥ Pjc −M(1− xjc) ∀j, j′ ∈ J, c ∈ C : sj = 1 (3.33)

ctj ≥ ctj′ + Pjc −M(1− gj′j)−M(1− xjc)−M(1− xj′c)

∀j, j′ ∈ J, c ∈ C : sj ≥ 2 (3.34)

ctj ≥ ctj′ + Pjc −M(1− xjc) ∀j, j′ ∈ J, c ∈ C, j ∈ c : j′ ≺ j (3.35)

The objective function in this model is the same as in the model proposed in Chapter3.4, to minimize the number of unscheduled jobs and to minimize the total tardiness.Tardiness of each order is defined by Constraint (3.32). This definition is more accuratethan the one proposed in the model, since the exact completion time of each order isknown. Constraint (3.33) ensures that the completion time of a job on stage 1 is at leastthe processing time needed in its campaign. To make sure that jobs processed in the samecampaign do not overlap, Constraints (3.34) is used. Completion time of a job is at leastthe processing time for that job in addition to the completion time of the previous job in

Rannveig Guðmundsdóttir 21

the same campaign. Constraint (3.35) ensures that a completion time of job j cannot beearlier than the completion time of precursor job on the stage before in addition to theprocessing time of job j, as can be seen on Figure 3.8.

Figure 3.8: Illustration of Constraint (3.35)

There was not enough time to run this model with data, but it could be interesting forfuture work. The drawback of this model will most likely be a great running time, but it isinteresting to see whether it works and how long the running time is if run on a powerfulcomputer. The model could be executed over night or over weekend.

3.6 Model verification

To give the reader better understanding on the function of the model as well as to makesure that the model is working properly the model was verified by creating a small testcase that is easy to understand. The test case consists of six campaigns that operate ontwo stages with one machine on each stage. Campaigns 1, 2 and 5 operate on stage 1 andcampaigns 3, 4 and 6 work on stage 2. Campaigns 1 and 3 can produce products of prod-uct family 1, campaigns 2 and 4 can produce products of product family 2 and campaigns5 and 6 can produce products of product family 3. Campaigns 5 and 6 are potential newcampaigns, and to begin with they have start- and end time equal to zero. The size ofthe other campaigns are 4 time units. The setup time is one time unit for all campaigns.The preplanned campaign plan can be seen in Figure 3.9. The test case data are listed inAppendix B.

Five orders (work packages) have been received and each work package needs to be pro-cessed on both stages and therefore the total number of jobs is ten. Jobs 1-4 are of productfamily 1, jobs 5-8 are of product family 2 and jobs 9-10 are of product family 3. The pro-cessing time of each job is 2 time units. The delivery time for jobs 2, 4, 6 and 8 is 8 time

22 Production scheduling in a campaign based flexible flow shop

Figure 3.9: The preplanned campaign plan where different colors represent different prod-uct families

units, and the delivery time for job 10 is 4 time units.

Test case 1

The model was solved using the MPL 4.2 modelling system and Gurobi 4.6.1 solver. Tobegin with no changes were allowed in the preplanned campaign plan. Figure 3.10 showshow the model assigns the jobs to the preplanned campaign plan. Each job has a process-ing time of 2 time units and the size of each campaign is 4 time units. Jobs 9-10 are notscheduled since there is no campaigns of the required type.

Figure 3.10: The schedule for test case 1.

Test case 2

In test case 2 changes in campaigns and use of potential new campaigns were allowed inthe model. Figure 3.11 shows how the model assigns the jobs to the campaigns. Sincethe model was allowed to increase the size of the campaigns and use the potential new

Rannveig Guðmundsdóttir 23

campaigns the model adapted the preplanned campaign plan in order to schedule all jobsto a campaign.

Figure 3.11: The schedule for test case 2.

Test case conclusions

More orders were received than the preplanned campaign plan anticipated. Jobs 9-10could therefore not be scheduled in test case 1 when no changes were allowed. In testcase 2 all jobs were scheduled since the model was able to adjust the campaign plan. Theextra order received was of product family 3 and with shorter due date than the otherorders and was therefore placed before the other campaigns.

24

25

Chapter 4

Dataset

The data used in this study was acquired through the pharmaceutical company’s pro-duction system. The production system returns the data as Excel files which contain threesheets: order lines, order line locations and campaigns. The order lines sheet contains dataregarding the status of every order, i.e. requested delivery date, confirmed delivery date,quantity, whether the production process for each order has begun and if so the presentstage of the processing. The order line location sheet contains data regarding the locationof every order, i.e. in what campaigns the products are processed and estimated start andend time of production of every order. The campaign sheet contains data regarding thecampaigns, i.e. which machines are used, start and end time of each campaign, numberof batches in each campaign, how much time is still available in each campaign, set-uptimes needed before each campaign starts and finally what product family is processedin each campaign. The same dataset is used in this study as was used in the study byAxelsdottir et al. [14], [15]. The dataset contains information regarding 84 unscheduledorders that belongs to 24 different product families. The dataset also contains informationabout 323 preplanned campaigns scheduled over the next 6 months, where the durationof each campaign range from one day up to four weeks.

The plant consists of 28 machines that operate on 4 stages. They produce 12.813 differentproducts (stock keeping units) that are divided into 191 product families. The stages thatthe production process is divided into are granulation, compression, coating and packing.All products need to go through the stages in the same order and therefore the problem isa flexible flow shop problem. All products need to go through granulation, compressionand packing but not all products need to be coated.

26 Production scheduling in a campaign based flexible flow shop

The model has the potential to add new campaigns to the campaign plan. Therefore thedata for the potential new campaigns had to be generated. For every product family, onepotential new campaign was created at every stage. The start time and end time of thenew campaigns is set equal to the date when the plan is made. The processing times foreach job on every possible campaign were generated, that took into account the produc-tion capacity for each product on every machine, and the quantities.

The plant operation is not continuous, therefore the data regarding the processing timeshad to be adjusted. Since the model is able to increase and decrease the size of preplannedcampaigns and add new campaigns as well, the results would not be realistic if the modelallows campaigns to run when the machine is in fact not in operation. The operation ofthe machines on stage 1 and 4 are six days a week and the operation of the machineson stage 2 and 3 are five days a week. To be able to assume continuous time scale, themachines that are in operation six days week were assumed to have 85.7% (6/7) of theactual production capacity, and the machines that are in operation five days a week wereassumed to have 71.4% (5/7) of the actual production capacity. It should level off if anorder is scheduled to a machine on a Sunday even though the machine is not in operation.

When the pharmaceutical company receives orders from customers it also receives a re-quested delivery date. After it has scheduled the order it replies with a confirmed deliverydate which is the due day the pharmaceutical company works with. In this study the re-quested delivery dates by the customers are used as the due date for comparison purposes.

27

Chapter 5

Results

In this chapter the results from the model are presented when using the dataset from thepharmaceutical company described in Chapter 4. The model was solved several timeswith various values of the modelling parameters each time, i.e. various values of howmany changes were allowed in the preplanned campaign plan, how many preplannedcampaigns were allowed to change, the total size of new campaigns and how many newcampaigns the model was allowed to create. The focus was on examining the number ofscheduled and unscheduled orders, how many of the scheduled orders were delivered lateand how many were delivered on time. The focus was also on the total tardiness and aver-age tardiness of the scheduled jobs. The model was solved using the MPL 4.2 modellingsystem and Gurobi 4.6.1 solver. The solution time when running the model on a 2.0 GHzAMD Phenom II N930 machine with 4 GB of memory running on a 64 bit Windows 7,ranged from few seconds up to 4 minutes.

The weight of the two objectives in the model had to be decided. The weight was decidedby running the model with different weight and comparing the solutions. The number ofunscheduled orders, how many orders were delivered late and the tardiness were com-pared. The balance between these competing objectives was found best when α = 500.A good way would be to create a pareto optimal curve and let the company evaluate theoptimal value of α.

The modelling parameters used in this study are listed in Table 5.1, where DiffLimit isthe limit on total difference in the preplanned campaign plan, NrChangesLimit is thelimit on number of changed preplanned campaigns, SizeNCLimit is the limit on totalsize of new campaigns and NrNCLimit is the limit on number of new campaigns cre-

28 Production scheduling in a campaign based flexible flow shop

DiffLimit NrChangesLimit SizeNCLimit NrNCLimitAllowed Changes Allowed Changes Allowed Changes Allowed Changeschanges made changes made changes made changes made

E.1 0 0 0 0 0 0 0 0E.2 5 5 1 1 5 5 1 1E.3 10 10 2 2 10 10 2 2E.4 15 15 3 3 15 15 3 3E.5 25 25 5 5 25 25 5 5E.6 50 50 10 4 50 50 10 9E.7 100 100 20 7 100 100 20 19E.8 150 150 30 9 150 150 30 22E.9 200 200 40 12 200 200 40 22

Table 5.1: The values of the modelling parameters used in the executions.

ated. The values of the modelling parameters increase relatively the same between the ex-ecutions. The modelling parameters for the total differences in the preplanned campaignplan and the total size of new campaigns were set equal, and those values represent the x-axis in the following figures in this chapter. The modelling parameters for the number ofchanges in the preplanned campaigns and number of new campaigns created was set equalas well. Table 5.1 shows both the values of allowed changes and the values of changesthat were used in the results for each modelling parameter. In these nine executions, themodel always fully utilized the allowed total difference in the preplanned campaign planand the allowed total size of new campaigns. The number of allowed changed preplannedcampaigns and the number of allowed new campaigns are fully utilized in the first fiveexecutions, thereafter it is only partly utilized.

The results when running the model with the above mentioned values of the limitationsare listed in Table 5.2 The chapter continues with a further examination of the results ofthe main variables.

5.1 Number of unscheduled orders

Minimizing the number of unscheduled orders was defined as the primary objective inthe proposed model. Figure 5.1 shows how the number of unscheduled orders varies withdifferent values of allowed changes in the campaigns. The number of unscheduled or-ders decreases significantly when a small change from the preplanned campaign plan isallowed. When no changes are allowed the number of unscheduled orders is 26. When

Rannveig Guðmundsdóttir 29

Unscheduled Scheduled Total Average Delayed Ordersorders orders tardiness (days) tardiness (days) orders on time

E.1 26 58 106 1.8 13 45E.2 24 60 95 1.6 13 47E.3 21 63 112 1.8 14 49E.4 19 65 112 1.7 14 51E.5 16 68 97 1.4 13 55E.6 13 71 49 0.7 8 63E.7 9 75 29 0.4 6 69E.8 7 77 7 0.1 2 75E.9 5 79 8 0.1 2 77

Table 5.2: Results when using different modelling parameters.

the difference in the preplanned campaigns and the size of new campaigns were allowedto reach 10 hours and when the model was allowed to change 2 preplanned campaignsand create 2 new campaigns, the number of unscheduled orders decreased to 21. Whenthe allowed changes in the campaigns increase, the slope of the curve flattens out.

0

5

10

15

20

25

30

0 50 100 150 200

# o

f u

nsc

he

du

led

ord

ers

Allowed changes in the campaigns

Unscheduled orders

Figure 5.1: How the number of unscheduled jobs varies with different values of allowedchanges in the campaigns.

5.2 Tardiness

The secondary objective of the model was to minimize the total tardiness. Figure 5.2shows how the total tardiness varies with different values of allowed changes in the cam-

30 Production scheduling in a campaign based flexible flow shop

paigns. Overall the total tardiness decreases when the limitation of allowed changes incampaigns increase. Since minimizing the total tardiness was not the primary objective,occasionally the value of tardiness increases when the allowed changes in the campaignsincrease, as can be seen in the beginning of the curve in Figure 5.2. In these instances themodel was able to reduce the number of unscheduled orders instead.

0

20

40

60

80

100

120

0 50 100 150 200

Tota

l tar

din

ess

(d

ays)

Allowed changes in the campaigns

Total tardiness

Figure 5.2: How the value of total tardiness varies with different values of allowedchanges in the campaigns.

The average tardiness for scheduled orders was examined as well. How the average tar-diness varies with different values of allowed changes in the campaigns can be seen inFigure 5.3. As expected, the average tardiness behaves very similarly to the total tardi-ness. Nevertheless the curve is smoother for the average tardiness, since if the value oftotal tardiness increases along with more allowed changes, the number of scheduled or-ders increases as well. It is good to keep in mind when reviewing the value of averagetardiness, that the tardiness was defined using the optimistic value of completion time forjobs. The real tardiness for the order is therefore somewhat higher.

5.3 Number of delayed orders

The objective function in the model did not include the number of delayed orders. How-ever, it is interesting to examine the results. As can be seen in Figure 5.4, the number ofdelayed orders decreases when the number of allowed changes increases, and as expectedthe curve for total tardiness and the number of delayed orders are very similar.

Rannveig Guðmundsdóttir 31

0.0

0.5

1.0

1.5

2.0

0 50 100 150 200

Ave

rage

tar

din

ess

(d

ays)

Allowed changes in the campaigns

Average tardiness

Figure 5.3: How the value of average tardiness varies with different values of allowedchanges in the campaigns.

0

2

4

6

8

10

12

14

16

0 50 100 150 200

# o

f d

ela

yed

ord

ers

Allowed changes in the campaigns

Delayed orders

Figure 5.4: How the number of delayed orders varies with different values of allowedchanges in the campaigns.

5.4 Sensitivity analysis

To examine the sensitivity of the modelling parameters a sensitivity analysis was made forthe number of unscheduled orders. To start with the model was executed withDiffLimit= 25, NrChangesLimit = 5, SizeNCLimit = 25 and NrNCLimit = 5 (as execution5 in above). Thereafter the model was executed several times and each time the value ofonly one modelling parameter was changed. In Figure 5.5 the sensitivity of the number of

32 Production scheduling in a campaign based flexible flow shop

unscheduled orders can be seen. The number of unscheduled orders is most sensitive forchanges in DiffLimit. When DiffLimit was increased by 100% (from 25 to 50) andall other modelling parameters remained unchanged the number of unscheduled ordersdecreased from 16 to 14. However the results for the other modelling parameters arequite similar.

13

15

17

19

21

23

25

-150% -100% -50% 0% 50% 100% 150%

# o

f u

nsc

he

du

led

ord

ers

Allowed changes in the campaigns

Sensitivity analysis

DiffLim

SizeNcLim

NrChLim

NrNewClim

Figure 5.5: Sensitivity analysis on number of unscheduled orders

5.5 Results summary

When allowing the preplanned campaign plan to change when scheduling orders in thecampaigns it is possible to achieve a better schedule. The objective function consist oftwo components, minimizing the number of unscheduled orders and minimizing the to-tal tardiness of scheduled orders. Since minimizing the number of unscheduled ordersis defined with a higher weight, the curve for number of unscheduled orders is alwaysdownward. Minimizing the total tardiness is defined with a lower weight which explainsthe upward slope early in the curve for total tardiness. In those cases the model was ableto reduce the number of unscheduled order instead. When the value of allowed changeshas reach 50, both total tardiness and number of unscheduled orders has decreased signifi-cantly. When examining the sensitivity analysis theDiffLimit (limit on total differencesin the preplanned campaigns) seems to be the most sensitive modelling parameter.

33

Chapter 6

Conclusions and further work

The results indicate that the model proposed in this study could be used when schedulingorders into a preplanned campaign plan. When allowing the preplanned campaign plan tochange, the model was able to include more orders in the schedule and decrease the tardi-ness of the scheduled orders as well. A mathematical model such as the one proposed inthis study could be useful as a decision making tool to give the schedulers an idea of howthey might change the preplanned campaign plan in order to schedule more orders and/orto minimize the delay, and to evaluate whether the change is worth it or not. Moreoverit can reduce the valuable time spent in scheduling. The next step would be to run themodel with a new dataset and get feedback from the pharmaceutical company whetherthe solution is useful.

If the model would be implemented, we would recommend the weight of the orders to beestimated, by considering the profit margin of each product and the quantity of each order.Thereby the profit is maximized. As mentioned before it will also be interesting for futurework to arrange the jobs within the campaigns. However the solution time will increasesignificantly, but it might be possible to run the model over night. The model proposed inthis study would be more suitable if the company seeks a decision making tool to providea fast response.

34

Rannveig Guðmundsdóttir 35

Bibliography[1] M. L. Pinedo, Scheduling: Theory, Algorithms, and Systems. 3rd ed. New York,

Springer, 2008.

[2] M. R. Garey, D. S. Johnson, Computers and Intractability: A Guide to the Theory

of NP-Completeness. New York, W. H. Freeman & Co., 1979.

[3] H. Stefansson, N. Shah, P. Jensson. Multiscale planning and scheduling in thesecondary pharmaceutical industry. AIChE Journal, vol. 52, pp. 4133-4149, Dec.2006.

[4] F. W. Taylor. The Principles of Scientific Management. New York, Harper, 1911.

[5] J. W. Herrmann, Ed. Handbook of Production Scheduling. (International Series inOperations Research & Management Science), 1st ed. New York, Springer, 2006.

[6] T. S. Arthanari, K. G. Ramamurthy. An extension of two machine sequencing prob-lem. Opsearch, vol. 8, pp. 10-22, 1971.

[7] M. S. Salvador, Symposium of the theory of scheduling and its applications. Berlin,Springer-Verlag, 1973, pp. 83-91.

[8] J. Jungwatanakit, P. Chaovalitwongse, M. Reodecha, F. Werner. A comparisonof scheduling algorithms for flexible flow shop problems with unrelated parallelmachines, setup times, and dual criteria. Computer & Operation Research, vol. 36,pp. 358-378, Feb. 2009.

[9] B. N. Strikar, S. Gosh. A MILP model for the n-job, m-stage flowshop with se-quence dependent set-up times. International Journal of Production Research, vol.24, pp. 1459-1474, Nov. 1986.

[10] A. Mauderli, D. Rippin. Production planning and scheduling for multi-purposebatch chemical plants. Computers and Chemical Engineering, vol. 3, pp. 199-206,Oct. 1979.

[11] M. Grunow, H. O. Gunther, M. Lehmann. Campaign planning for multi-stage batchprocesses in the chemical industry. OR Spectrum, vol. 24, pp. 281-314, 2002.

[12] N. Susarla, I. A. Karimi. Integrated campaign planning and resource allocation inbatch plants. Computers and Chemical Engineering, vol. 35, pp. 2990-3001, Dec.2011.

36 Production scheduling in a campaign based flexible flow shop

[13] A. Sundaramoorthy, I. Karimi. Planning in pharmaceutical supply chains with out-sourcing and new product introductions. Industrial & Engineering Chemical Re-

search, vol. 43, pp. 8293-8306, Nov. 2004.

[14] G. S. Axelsdóttir. Automating a manual process of scheduling jobs to productionmachines in a pharmaceutical company. M.S. thesis, Sch. of Sci. & Eng, ReykjavíkUniv., Reykjavík 2010.

[15] E. I. Asgeirsson, G. S. Axelsdottir, H. Stefansson. Automating a manual productionscheduling process at a pharmaceutical company, in IEE Symposium Series in Com-

putational Intelligence, Workshop on Computational Intelligence in Production and

Logistics System (CIPLS), 2011, pp. 1-8.

37

Appendix A

A.1 The code written in MPL

INDEXc := INDEXFILE("indexC.dat");c’:= c;Cnew[c] := INDEXFILE("Cnew.dat");Cold[c] := c - Cnew;m := INDEXFILE("indexM.dat");MachCamp[c,m] := INDEXFILE("MachCamp.dat");j := INDEXFILE("indexJ.dat");j’ := jJlast[j] := INDEXFILE("Jlast.dat");

DATASTO[c] := SPARSEFILE("Campaigns.dat",3);ETO[c] := SPARSEFILE("Campaigns.dat",4);OC[c] := SPARSEFILE("Campaigns.dat",5);d[j] := SPARSEFILE("OrderLines.dat",4);P[j,c] := SPARSEFILE ("processtime.dat",3);STm[m] := SPARSEFILE("SetupMachine.dat",2);Ps[c] := SPARSEFILE("Campaigns.dat",11);tj[j] := SPARSEFILE("OrderLines.dat",10);tc[c] := SPARSEFILE("Campaigns.dat",10);sj[j] := SPARSEFILE("OrderLines.dat",7);sc[c] := SPARSEFILE("Campaigns.dat",9);pre[j] := SPARSEFILE("OrderLines.dat",8);

38 Production scheduling in a campaign based flexible flow shop

DiffLimit := DATAFILE("DiffLimit.dat");NrChLimit := DATAFILE("NrChLimit.dat");SizeNCLimit := DATAFILE("SizeNCLimit.dat");NrNCLimit := DATAFILE("NrNcLimit.dat");alfa := DATAFILE("Alfa.dat");M := DATAFILE("M.dat");

BINARY VARIABLESx[j,c] EXPORT ALL TO Sparsefile("XjcSol.dat");V[c’,c];y[j] EXPORT ALL TO Sparsefile("YjSol.dat");z[Cold];q[c];L[j];

VARIABLEST[j];E[j];S[j];STN[c];ETN[c];DiffST[c];DiffET[c];DiffTot[c];SizeNC[c];

MACROSTotalTardiness = SUM(Jlast: T[j]);FjoldPantanaEkkiAPlani = SUM(Jlast: y[j]);FjoldiAPlani = 84-FjoldPantanaEkkiAPlani;FjoldiSein = SUM(Jlast: L[j]);FjoldiOnTime = FjoldiAPlani-FjoldiSein;

MODELMIN markfall = SUM(Jlast: T[j])+alfa*SUM(Jlast: y[j])

Rannveig Guðmundsdóttir 39

SUBJECT TOTard[Jlast]: T[j] >= E[j]−d[j]−M∗y[j];Late0[Jlast]: L[j] <= T[j]; Late1[Jlast]: M*L[j] >= T[j]; EmptyCamp0[c]: b[c] <=SUM(j: x[j,c]);EmptyCamp1[c]: SUM(j: x[j,c]) <= M*b[c];Overlap[m,c IN MachCamp[c,m], c’ IN MachCamp[c,m]] WHERE (c<>c’)

STN[c] >= ETN[c’]+STm[m]−M*V[c,c’];Space[c]: SUM(j: x[j,c]*P[j,c]) <= ETN[c]−STN[c]−OC[c];EndT[j,c] WHERE (tj[j]=tc[c]) AND (sj[j]=sc[c]):

E[j] >= STN[c]+P[j,c]−M+M∗x[j,c];StartT[j,c] WHERE (tj[j]=tc[c]) AND (sj[j]=sc[c]):

S[j] <= ETN[c]−P[j,c]+M−M∗x[j,c];StThenEt[j’,j] WHERE (j’=pre[j]): S[j] >= E[j’];EndEnd[j’,j,c] WHERE (j’ =pre[j]): E[j] >= E[j’]+P[j,c]−M+M∗x[j,c];SameType[j,c] WHERE (tj[j]<>tc[c]) OR (sj[j]<>sc[c]): x[j,c] = 0;Balance[c’,c] WHERE (c<>c’) AND (sc[c]=sc[c’]):

V[c,c’]+V[c’:=c,c:=c’] = 1;AllAssigned[j]: SUM(c: x[j,c])+y[j] = 1;RightOrder[j,j’] WHERE j’ = pre[j]: y[j’]<= y[j]; Diff1[Cold]: DiffST[c]>= STN[c]−STO[c];Diff2[Cold]: DiffST[c] >= STO[c]−STN[c];Diff3[Cold]: DiffET[c] >= ETN[c]−ETO[c];Diff4[Cold]: DiffET[c] >= ETO[c]−ETN[c];Diff5[Cold]: DiffTot[c] >= DiffST[c]+DiffET[c];Size[Cnew]: SizeNC[c] >= ETN[c]−STN[c];NoChanges[Cold]: DiffTot[c] <= M∗z[Cold];LimDiff: SUM(Cold: DiffTot[c]) <= DiffLimit;LimChanges: SUM(Cold: z[Cold]) <= NrChLimit;LimSize: SUM(Cnew: SizeNC[Cnew]) <= SizeNCLimit;limNC: SUM(Cnew: q[Cnew]) <= NrNCLimit;NoChNew[Cnew]: SizeNC[c] <= M∗q[Cnew];Check[j,c]: P[j,c]+F[j] >= 1−M+M∗x[j,c];

BOUNDSE[j] >= 0;S[j] >= 0;T[j] >= 0;ETN[c] >= 0;

40 Production scheduling in a campaign based flexible flow shop

ETN[c] ≤ 5150;STN[c] >= 0;DiffST[c] >= 0;DiffET[c] >= 0;DiffTot[c] >= 0;

END

41

Appendix B

B.1 The data for test case 1

STOc: [1, 6, 3, 8, 0, 0]ETOc: [5, 10, 7, 12, 0, 0]θc: [0, 0, 0, 0, 0]Dj: [8, 8, 8, 8, 8, 8, 8, 8, 4, 4]Pjc: 2 time units for every jobstc′c: 1 time unittj: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3]tc: [1, 2, 1, 2, 3, 3]sj: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]sc: [1, 1, 2, 2, 1, 2]α: 100DiffLimit: 0NrChangesLimit: 0SizeNCLimit: 0NrNCLimit: 0

42 Production scheduling in a campaign based flexible flow shop

B.2 The data for test case 2

STOc: [1, 6, 3, 8, 0, 0]ETOc: [5, 10, 7, 12, 0, 0]θc: [0, 0, 0, 0, 0]Dj: [8, 8, 8, 8, 8, 8, 8, 8, 4, 4]Pjc: 2 time units for every jobstc′c: 1 time unittj: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3]tc: [1, 2, 1, 2, 3, 3]sj: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]sc: [1, 1, 2, 2, 1, 2]α: 100DiffLimit: 20NrChangesLimit: 20SizeNCLimit: 8NrNCLimit: 2

School of Science and EngineeringReykjavík UniversityMenntavegur 1101 Reykjavík, IcelandTel. +354 599 6200Fax +354 599 6201www.reykjavikuniversity.isISSN 1670-8539