You are on page 1of 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

Rannveig Guðmundsdóttir
Master of Science
Engineering Management
May 2012
School of Science and Engineering
Reykjavík University

M.Sc. RESEARCH THESIS


ISSN 1670-8539
Production scheduling in a campaign based flexible flow
shop
by

Rannveig Guðmundsdóttir

Research thesis submitted to the School of Science and Engineering


at Reykjavík University in partial fulfillment of
the requirements for the degree of
Master of Science in Engineering Management

May 2012

Research Thesis Committee:

Eyjólfur Ingi Ásgeirsson, Supervisor


Ph.D, Assistant Professor, School of Science and Engineering at
Reykjavík University

Hlynur Stefánsson, Supervisor


Ph.D, Assistant Professor, School of Science and Engineering at
Reykjavik University

Margrét Vilborg Bjarnadóttir, Examiner


Ph.D, Assistant Professor, University of Maryland
Copyright
Rannveig Guðmundsdóttir
May 2012
The undersigned hereby certify that they recommend to the School of Sci-
ence and Engineering at Reykjavík University for acceptance this research
thesis entitled Production scheduling in a campaign based flexible flow
shop submitted by Rannveig Guðmundsdóttir in partial fulfillment of the
requirements for the degree of Master of Science in Engineering Manage-
ment.

Date

Eyjólfur Ingi Ásgeirsson, Supervisor


Ph.D, Assistant Professor, School of Science and Engi-
neering at Reykjavík University

Hlynur Stefánsson, Supervisor


Ph.D, Assistant Professor, School of Science and Engi-
neering at Reykjavik University

Margrét Vilborg Bjarnadóttir, Examiner


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

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

Date

Rannveig Guðmundsdóttir
Master of Science
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 constantly
increasing, there is increased pressure to reduce the production cost and
therefore good scheduling approaches become more important. The aim of
this 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 by
the 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 schedule
is also created based on real orders. In this study an optimization model is
presented that arranges the orders in the campaign plan. To keep the structure
of 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 results
indicate that the model proposed in this study could be used as a decision
making tool when scheduling orders into a preplanned campaign plan. The
model 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 minimize
the delay, and to evaluate whether the change is worth it or not. Moreover it
can 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 til
að 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. I
would 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ún
Sjö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 1
1.1 Statement of the problem . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Aim and objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Structure of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Literature review 5
2.1 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Campaign planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Recent works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 The MIP Model 9


3.1 Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 Model assumptions and limitations . . . . . . . . . . . . . . . . . . . . . 17
3.5.1 Proposed improvement . . . . . . . . . . . . . . . . . . . . . . . 20
3.6 Model verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4 Dataset 25

5 Results 27
5.1 Number of unscheduled orders . . . . . . . . . . . . . . . . . . . . . . . 28
5.2 Tardiness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3 Number of delayed orders . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4 Sensitivity analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
viii

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

6 Conclusions and further work 33

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

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

List of Figures

1.1 Possible production routes for a single product through the production
process. 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 represent
the jobs. Different color represent different product family. . . . . . . . . 3

3.1 Campaign c cannot start earlier than the end time of a previous campaign
processed on the same machine in addition to the set-up time needed. . . 15
3.2 Representation of Ej and Sj . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Possible ways for jobs going to next stage . . . . . . . . . . . . . . . . . 15
3.4 The start-time of a job must be greater than the end-time of the precursor
job, defined by Constraint (3.7) . . . . . . . . . . . . . . . . . . . . . . . 16
3.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 represent
defined end time of jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Illustration of how the same type of jobs might go to different campaigns
on following stages. The red and green lines represent the actual end time
for 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 until
all precursors campaigns have end their operations. . . . . . . . . . . . . 19
3.8 Illustration of Constraint (3.35) . . . . . . . . . . . . . . . . . . . . . . . 21
3.9 The preplanned campaign plan where different colors represent different
product families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.10 The schedule for test case 1. . . . . . . . . . . . . . . . . . . . . . . . . 22
3.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 allowed
changes in the campaigns. . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.3 How the value of average tardiness varies with different values of allowed
changes in the campaigns. . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.4 How the number of delayed orders varies with different values of allowed
changes 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. . . . . . . 28


5.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 scheduling
approaches become more important. Scheduling deals with the allocation of available
resources to tasks over a given time period. In manufacturing industry it refers to the
allocation of operations to the available machines in addition to the decision on what to
produce, when to produce it and how to produce it. Good scheduling may result in better
utilization of the available equipment, reduced lead time of products and lower production
cost. Therefore it is advisable for manufacturing firms to consider how they can obtain an
optimal schedule.

1.1 Statement of the problem

This study is based on a real world problem where a pharmaceutical company needs to
schedule its production process. The company produces a wide range of products in a
flexible flow shop production environment. As stated in [1], a flow shop is a scheduling
problem with n products and m machines. All products have to be processed on each one
of the machines and all products have to follow the same route. A flow shop differs from
a job shop where each product has its own predetermined route, and from a open shop
having no ordering constraints. A flexible flow shop is a generalization of the flow shop
problem. In a flexible flow shop production, each product has to go through a number of
stages in the production process, and all products have to follow the same route. The flow
shop problem is NP-hard and therefore difficult to solve exactly [2]. Since a flexible flow
shop is more complex than a flow shop, the problem is NP-hard as well. The complexity
in 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-up
times on the machines that are needed between operations of two different products are
sequence dependent. Figure 1.1 [3] shows the complexity of choosing a production route
for 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, coating
and packing. The figure is retried from reference

In order to reduce the complexity of the problem, arising from the sequence dependent
set-up times, the company uses a campaign production. The products are categorized
into product families where similar products belong to the same product family. Each
production stage is operated in a batch mode where a batch is the smallest quantity that is
produced of each product. In order to minimize the set-up and cleaning times that arise
when switching between batches of different product families, several batches from the
same product family are produced consecutively by the same machine. This collection of
batches are called a campaign. Illustration of how batches generate a campaign can be
seen in Figure 1.2. In this study, the operation of processing a product will be split up into
several jobs, one job for the process on each stage. Jobs that are needed to process a single
order 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 the
jobs. Different color represent different product family.

The production process is mainly make-to-order, where the company produces to fulfill
customer orders with specific due dates. The company creates a long-term campaign plan
which covers a one year time horizon. The long-term plan is based on sale forecasts since
the actual orders have not yet been received. The long-term plan determines the timing
of every campaign and the duration, and which machines and what materials are needed
for each campaign production. The purchase of raw materials from suppliers is based on
the campaign plan since the lead time of raw materials may be greater than the promised
lead time of the final products. The campaign plan is also necessary for other planning
decisions, for example maintenance, shifts and launches of new products. Every week
the firm receives new orders from customers and they are given feedback with promised
delivery dates. The sale forecast that was used to create the campaign plan is uncertain
so 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. Today
the 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 the
manual schedule is already quite good. However, if it is possible to improve the schedule
it might lead to a great financial gain for the company, and increase customers satisfaction
by 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 well
to 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 how
much 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 orders
as 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 secondary
objective is to minimize the tardiness. If the completion time of a work package w is
denoted 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 zero
when 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 Chapter


3 the optimization model is formulated, explained and verified. The dataset from the
pharmaceutical company used in this study is described in Chapter 4. The results are
presented in Chapter 5 and the conclusions from the results in addition to ideas of future
work 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 the
main 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, The
Principles of Scientific Management [4], in which he emphasized the benefits of applying
scientific 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 the
planned and actual production [5]. As mentioned before production scheduling problems
are usually divided into three basic categories: open shop, job shop and flow shop. As
stated in [1] the open shop environment has no ordering constraints on the operations
so the products do not necessarily have to follow the same route through the production
process. In a job shop environment, each product has its own predetermined route, and
in a flow shop environment all products follow the same route through the production
process. 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 on
one machine on each stage. Arthanari and Ramamurthy [6] and Salavdor [7] were among
the first to define the flexible flow shop problem. As mentioned before flexible flow shop
problems 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 shop
with 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-up
times. 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 variable
that states if a job i is scheduled immediately precedes job j, they used a binary variable
that states if a job i is scheduled anytime before job j. By defining the integer binary
sequencing 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 in
our 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 scheduling
based on mixed-integer linear and constraint programming. The approach was especially
designed to co-ordinate the various plant operations within multi-plant supply networks
in the chemical industry. Susarla and Karimi [12] used a basic model of Sunderamoorthy
and 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 general
framework 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 is
reviewed and updated regularly. The aim of the work proposed in this paper is allocating
jobs 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 from
the same pharmaceutical company as this study. They introduced a multi-scale modelling
approach with three hierarchical levels of decisions. At the top level they proposed a
model to optimise a campaign plan for long-term planning purposes based on a demand
forecast. At the middle level they proposed a model to re-optimize the campaign plan
simultaneously 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. An
iterative procedure was proposed to test the plans against a host of potential scenarios that
cover a large proportion of possible outcomes. The drawback of their study is that the
campaign structure from the long term plan did not hold well enough to the short term
plan. 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 was
on the short term planning, the jobs were scheduled to the preplanned campaigns using a
mixed 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 scheduler
experts did not change the campaigns. However, the schedulers can adjust the campaign
plan manually within the production software system, so the campaigns fit the received
orders better. The schedulers can increase and decrease the campaigns sizes, as well as
create 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 result
from 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 a
sale forecast. It is necessary that the short term plan can be adapted to the real demand
and changed circumstances. In the work proposed in this paper we create a production
schedule with preplanned campaigns, but with the option of changing the campaigns. The
changes can both be in terms of the size of campaigns, and also in terms of time, i.e. it
is possible to move them. It is also possible to create additional campaigns as well as
deleting campaigns that are not needed. The model will determine the optimal campaign
plan. 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 relative
to 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 variables
are introduced. Then the optimization model is formulated and explained. Thereafter the
assumptions and limitations of the model are discussed. The chapter finishes with model
verification.

The model is a mixed integer model and is designed to place jobs to campaigns. As
mentioned before, the campaigns are defined in the long-term plan, and the model uses
those predefined campaigns. To adapt the campaign plan to the actual demand, the model
has the potential to increase and decrease the size of the campaigns, move them and to
add new ones. In order to keep the structure of the long-term plan there is a limit on how
many changes the model can make to the predefined campaigns. Two objectives are in
the optimization model. One is to schedule as many jobs as possible, and the other is to
minimize 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 the
next schedule. In order to reduce the running time, the model will only assign the jobs
to campaigns but not arrange the jobs within every campaign. The orders within the
campaigns are mostly predefined based on the characteristic of the product variations in
the campaigns so that part is not very time consuming, and the schedulers prefer having
the 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 work
packages. Following is the list of indexes:

A: set of machines, m ∈ A
C: 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 ∈ J
Jlast : subset of jobs, the jobs on the last stage. Jlast ∈ J

3.2 Data

In the model following data are used as an input:

ST Oc : Start time of original campaign c


ET Oc : End time of original campaign c
θc : The occupied space in campaign c, the part of the campaign which has already been
assigned to a job.
dj : Due date of job j
Pjc : Processing time of job j in campaign c
stc0 c : Set-up time between campaign c’ and c
tj : Type (product family) of job j
tc : Type of jobs allowed in campaign c
sj : Stage of job j
sc : Stage of campaign c
α: Penalty factor for unscheduled jobs
βj : Weight for job j
DiffLimit: The limit on total differences in preplanned campaigns
NrChangesLimit: The limit on number of changes to preplanned campaigns
SizeNCLimit: The limit on total size of new campaigns
NrNCLimit: 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 for
each product family and every stage was created with start time and end time equal to
zero:
ST Oc = 0 ∀c ∈ Cnew
ET Oc = 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.

ST Nc : The start-time of campaign c in the final solution


ET Nc : The end-time of campaign c in the final solution

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

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


Sj : 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:

Dif f Stc : The difference in start time for campaign c


Dif f ETc : The difference in end time for campaign c
Dif f T otalc : 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.
SizeN Cc : The size of new campaign c

The first binary variable defines which jobs are scheduled to which campaign. Let
(
1, if a job j is scheduled in campaign c; ∀j ∈ J, c ∈ C
xjc =
0, otherwise

The model is allowed to move campaigns and change the order of them. Therefore a
variable is needed that defines the order of the campaign. Let
(
1, if a campaign c’ is placed before campaign c; ∀c0 , c ∈ C
Vc0 c =
0, otherwise

The model attempts to schedule as many jobs as possible, but if there is no available
campaign for a job then the job is put on a list of unscheduled jobs. Let
(
1, if job j is not scheduled to a campaign; ∀j ∈ J
yj =
0, 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
(
1, if there are any changes in campaign c; ∀c ∈ C
zc =
0, otherwise

The scheduler will also have the option to limit how many new campaigns are created. Let
(
1, if any job is assigned to the potential new campaign c ∀c ∈ Cnew
qc =
0, otherwise

3.4 Model

In this section the mixed integer model that was developed to imitate the real scheduling
problem 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

X X
min α βj yj + βj Tj (3.1)
j∈Jlast j∈Jlast

s.t. ST Nc ≥ ET Nc0 + Stc0 c − M Vc,c0 ∀c, c0 ∈ Cm , m ∈ A (3.2)


X
ET Nc ≥ ST Nc + Pjc xjc + θc ∀c ∈ C (3.3)
j∈J

ET Nc ≤ max ET Oc0 ∀c, c0 ∈ C (3.4)


Ej ≥ ST Nc + Pjc − M (1 − xjc )
∀j ∈ J, c ∈ C : tj = tc , sj = sc (3.5)
Sj ≤ ET Nc − Pjc + M (1 − xjc )
∀j ∈ J, c ∈ C : tj = tc , sj = sc (3.6)
Sj ≥ Ej 0 ∀j 0 , j ∈ J : j 0 ≺ j (3.7)
Tj ≥ Ej − dj − M yj ∀j ∈ Jlast (3.8)
xjc = 0 ∀j ∈ J, c ∈ C : tj 6= tc , sj 6= sc (3.9)
Vc0 c + Vcc0 = 1 ∀c0 , c ∈ C (3.10)
X
xjc + yj = 1 ∀j ∈ J (3.11)
c∈C
yj ≤ yj 0 ∀j, j 0 ∈ J : j 0 ≺ j (3.12)
Dif f STc ≥ ST Nc − ST Oc ∀c ∈ Cold (3.13)
Dif f STc ≥ ST Oc − ST Nc ∀c ∈ Cold (3.14)
Dif f ETc ≥ ET Nc − ET Oc ∀c ∈ Cold (3.15)
Dif f ETc ≥ ET Oc − ET NC ∀c ∈ Cold (3.16)
Dif f T otalc ≥ Dif f STc + Dif f ETc ∀c ∈ Cold (3.17)
X
Dif f T otalc ≤ DiffLimit (3.18)
c∈Cold
X
zc ≤ NrChangesLimit (3.19)
c∈Cold
Dif f T otalc ≤ M zc ∀c ∈ Cold (3.20)
SizeN ewCampc ≥ ET Nc − ST Nc ∀c ∈ Cnew (3.21)
X
SizeN ewCampc ≤ SizeNewCLimit (3.22)
c∈Cnew
X
qc ≤ NrNewCLimit ∀c ∈ Cnew (3.23)
c∈Cnew
SizeN ewCampc ≤ M qc ∀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)


Vc0 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 minimizes
the 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 two
components a factor α is placed before the first one. In our model the primary objective
is 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 have
greater βj than others. If data regarding βj is not available then all orders can be assumed
to have βj =1.

Constraint (3.2) ensures that the campaigns that are processed on the same machine do
not overlap. The constraint prevents campaign c from starting earlier than the end time
of a previous campaign processed on the same machine in addition to the set-up time
needed, 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 they
can 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 available
space. The end time of a campaign must be later than the start time in addition to the total
processing 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 latest
preplanned campaign. With this constraint the model prevents the campaign plan from
extending.

As mentioned before, the model does not arrange the jobs within the campaigns, it only
decides which jobs are assign to which campaign. Therefore the exact completion time
of process for each order is unknown. Instead of defining the exact completion time for
each 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 optimistic
value 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 campaign
processed 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 the
same way the pessimistic value of start time of job j in campaign c, which is the start
time of the last job in the campaign. Constraint (3.7) ensures that the pessimistic start
time of a job is at least greater than the optimistic end time for the precursor job on the
previous stage. Figure 3.2 explains the definition of Ej and Sj further. An illustration of
the possible ways for jobs going to the next stage can be seen in Figure 3.3, and Figure
3.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 an
order is delivered if the order is delivered late. In this model the optimistic value will be
used 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 that
order. The constraint is only active if the order was put on the schedule. The pessimistic
value 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 date
for that product, defined by Constraint (3.31)

X
Tj ≥ ST Nc + xj 0 c Pj 0 c − dj − M (1 − xjc ) ∀j, j 0 ∈ Jlast , c ∈ C (3.31)
j 0 ∈J

P
where ST NC is the start time of campaign c, xj 0 c Pj 0 c is the total processing time for
j 0 ∈J
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 first
one was chosen.

Constraint (3.9) ensures that if a job is assigned to a campaign, it is of the same product
family and same stage and the jobs include in that particular campaign. If campaigns c
and c0 both operate on machine m, then campaign c must be scheduled before or after
campaign c0 , 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 list
of unscheduled jobs. To make sure that a job is not scheduled to a campaign unless the
precursors jobs are scheduled as well, Constraint (3.12) is used.

Constraints (3.13)-(3.17) calculate the difference between the predefined campaign plan
and the campaign plan in the final solution. Constraints (3.13)-(3.14) define the absolute
value of the difference in the start time, and Constraints (3.15)-(3.16) define the absolute
value of the difference in the end time. The total difference for each campaign is defined
by 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 and
the size remains the same it results in a greater difference than when size of a campaign
is increased by one unit. When a campaign is moved by one unit both start time and end
time has a difference of one unit and the campaign difference becomes two units. Another
method to calculate the campaign difference was considered, to break the difference up
into two components, one that calculates the difference in campaign size and another
that calculates the displacement. The displacement would be based on the center of the
campaign (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 previous
method 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 the
predefined campaigns. If there are no changes made in a preplanned campaign, the value
of Dif f T otalc 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 the
new campaigns have both start-time and end-time equal to zero. If the model creates a
new campaign it will set a value to both the start time and the end time. The campaign
difference does not apply to the new campaigns since if a new campaign is created further
ahead it will count for a greater difference than a new campaign that is created earlier
in time. Nevertheless, it must be possible to restrict the size of the new campaigns, so
Constraint (3.21) is used to calculate the size of all new campaigns. Constraint (3.22) is
used to restrict the sum of the size in all new campaigns, and Constraint (3.23) is used
to restrict the number of new campaigns. If a possible new campaign c is not used, then
the 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 a
general way it was also necessary to make assumptions. The limitations and assumptions
are 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 example
some 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 the
schedule regardless of the profit margin that the products provide. Products providing a
higher profit margin and/or orders from important customers should have higher weight
factors. 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 delivering


100 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 on
time to be delayed by one day, and when delivery of product delays from being delayed
by 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 of
an infeasible solution since the model only ensures that the pessimistic start time of a job
is later than the optimistic end time of the precursor job on the stage before, defined by
Constraint (3.7). There is a chance for a job to be assigned to a campaign, even though
its 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 lines
represent the actual end time of jobs, the thick black line represent defined end time of
jobs

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. The
drawback from this implementation is when the same type of product goes to different
campaigns in the following stage. For example when the same type of product is packed
in 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 on
following 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 not
allowing a campaign to start earlier than the end time of all precursors campaigns, as can
be seen in Figure 3.7. This is also impractical since the first jobs in a campaign cannot go
to 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 all
precursors campaigns have end their operations.

These options to prevent infeasibility issues were considered but in order to maintain the
generality of the model, as well to be sure that the best solution is not blocked, the model
was formulated in the proposed way. The schedulers can easily spot this infeasibility if
it occurs and adjust the solution. Since the model is using the optimistic value of the end
time of jobs, it is possible to create a buffer to use if the model provides an infeasible
solution. The production capacity of the machines might be assumed to be lower than the
actual 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 the
assumptions 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 be


necessary to arrange the jobs within the campaigns as well. The model would include
the 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 added
instead. 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 jobs
is necessary. Let:
(
1, if job j’ is scheduled before job j; ∀j 0 , j ∈ J
gj 0 j =
0, otherwise

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

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


ctj ≥ Pjc − M (1 − xjc ) ∀j, j 0 ∈ J, c ∈ C : sj = 1 (3.33)
ctj ≥ ctj 0 + Pjc − M (1 − gj 0 j ) − M (1 − xjc ) − M (1 − xj 0 c )
∀j, j 0 ∈ J, c ∈ C : sj ≥ 2 (3.34)
ctj ≥ ctj 0 + Pjc − M (1 − xjc ) ∀j, j 0 ∈ J, c ∈ C, j ∈ c : j 0 ≺ j (3.35)

The objective function in this model is the same as in the model proposed in Chapter
3.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 accurate
than the one proposed in the model, since the exact completion time of each order is
known. Constraint (3.33) ensures that the completion time of a job on stage 1 is at least
the processing time needed in its campaign. To make sure that jobs processed in the same
campaign do not overlap, Constraints (3.34) is used. Completion time of a job is at least
the 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 be
earlier than the completion time of precursor job on the stage before in addition to the
processing 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 for
future work. The drawback of this model will most likely be a great running time, but it is
interesting to see whether it works and how long the running time is if run on a powerful
computer. 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 make
sure that the model is working properly the model was verified by creating a small test
case that is easy to understand. The test case consists of six campaigns that operate on
two stages with one machine on each stage. Campaigns 1, 2 and 5 operate on stage 1 and
campaigns 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 campaigns
5 and 6 can produce products of product family 3. Campaigns 5 and 6 are potential new
campaigns, and to begin with they have start- and end time equal to zero. The size of
the 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 in
Appendix 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 product
family 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. To
begin with no changes were allowed in the preplanned campaign plan. Figure 3.10 shows
how 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 not
scheduled 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 in
the model. Figure 3.11 shows how the model assigns the jobs to the campaigns. Since
the 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 jobs
to 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-10
could therefore not be scheduled in test case 1 when no changes were allowed. In test
case 2 all jobs were scheduled since the model was able to adjust the campaign plan. The
extra order received was of product family 3 and with shorter due date than the other
orders 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 three
sheets: order lines, order line locations and campaigns. The order lines sheet contains data
regarding 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 present
stage of the processing. The order line location sheet contains data regarding the location
of every order, i.e. in what campaigns the products are processed and estimated start and
end time of production of every order. The campaign sheet contains data regarding the
campaigns, i.e. which machines are used, start and end time of each campaign, number
of batches in each campaign, how much time is still available in each campaign, set-up
times needed before each campaign starts and finally what product family is processed
in each campaign. The same dataset is used in this study as was used in the study by
Axelsdottir et al. [14], [15]. The dataset contains information regarding 84 unscheduled
orders that belongs to 24 different product families. The dataset also contains information
about 323 preplanned campaigns scheduled over the next 6 months, where the duration
of 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 different
products (stock keeping units) that are divided into 191 product families. The stages that
the 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 is
a flexible flow shop problem. All products need to go through granulation, compression
and 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 the
data for the potential new campaigns had to be generated. For every product family, one
potential new campaign was created at every stage. The start time and end time of the
new campaigns is set equal to the date when the plan is made. The processing times for
each 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 times
had to be adjusted. Since the model is able to increase and decrease the size of preplanned
campaigns and add new campaigns as well, the results would not be realistic if the model
allows campaigns to run when the machine is in fact not in operation. The operation of
the machines on stage 1 and 4 are six days a week and the operation of the machines
on stage 2 and 3 are five days a week. To be able to assume continuous time scale, the
machines that are in operation six days week were assumed to have 85.7% (6/7) of the
actual production capacity, and the machines that are in operation five days a week were
assumed to have 71.4% (5/7) of the actual production capacity. It should level off if an
order 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 delivery
date 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 the
pharmaceutical company described in Chapter 4. The model was solved several times
with various values of the modelling parameters each time, i.e. various values of how
many changes were allowed in the preplanned campaign plan, how many preplanned
campaigns were allowed to change, the total size of new campaigns and how many new
campaigns the model was allowed to create. The focus was on examining the number of
scheduled and unscheduled orders, how many of the scheduled orders were delivered late
and 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 modelling
system and Gurobi 4.6.1 solver. The solution time when running the model on a 2.0 GHz
AMD 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 decided
by running the model with different weight and comparing the solutions. The number of
unscheduled 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 the
optimal value of α.

The modelling parameters used in this study are listed in Table 5.1, where Dif f Limit is
the limit on total difference in the preplanned campaign plan, N rChangesLimit is the
limit on number of changed preplanned campaigns, SizeN CLimit is the limit on total
size of new campaigns and N rN CLimit is the limit on number of new campaigns cre-
28 Production scheduling in a campaign based flexible flow shop

Dif f Limit N rChangesLimit SizeN CLimit N rN CLimit


Allowed Changes Allowed Changes Allowed Changes Allowed Changes
changes made changes made changes made changes made
E.1 0 0 0 0 0 0 0 0
E.2 5 5 1 1 5 5 1 1
E.3 10 10 2 2 10 10 2 2
E.4 15 15 3 3 15 15 3 3
E.5 25 25 5 5 25 25 5 5
E.6 50 50 10 4 50 50 10 9
E.7 100 100 20 7 100 100 20 19
E.8 150 150 30 9 150 150 30 22
E.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 campaign
plan 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 of
changes in the preplanned campaigns and number of new campaigns created was set equal
as well. Table 5.1 shows both the values of allowed changes and the values of changes
that were used in the results for each modelling parameter. In these nine executions, the
model always fully utilized the allowed total difference in the preplanned campaign plan
and the allowed total size of new campaigns. The number of allowed changed preplanned
campaigns and the number of allowed new campaigns are fully utilized in the first five
executions, thereafter it is only partly utilized.

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

5.1 Number of unscheduled orders

Minimizing the number of unscheduled orders was defined as the primary objective in
the proposed model. Figure 5.1 shows how the number of unscheduled orders varies with
different values of allowed changes in the campaigns. The number of unscheduled or-
ders decreases significantly when a small change from the preplanned campaign plan is
allowed. When no changes are allowed the number of unscheduled orders is 26. When
Rannveig Guðmundsdóttir 29

Unscheduled Scheduled Total Average Delayed Orders


orders orders tardiness (days) tardiness (days) orders on time
E.1 26 58 106 1.8 13 45
E.2 24 60 95 1.6 13 47
E.3 21 63 112 1.8 14 49
E.4 19 65 112 1.7 14 51
E.5 16 68 97 1.4 13 55
E.6 13 71 49 0.7 8 63
E.7 9 75 29 0.4 6 69
E.8 7 77 7 0.1 2 75
E.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 allowed
to reach 10 hours and when the model was allowed to change 2 preplanned campaigns
and create 2 new campaigns, the number of unscheduled orders decreased to 21. When
the allowed changes in the campaigns increase, the slope of the curve flattens out.

Unscheduled orders
30
# of unscheduled orders

25

20

15

10

0
0 50 100 150 200
Allowed changes in the campaigns

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

5.2 Tardiness

The secondary objective of the model was to minimize the total tardiness. Figure 5.2
shows 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 in
campaigns increase. Since minimizing the total tardiness was not the primary objective,
occasionally the value of tardiness increases when the allowed changes in the campaigns
increase, as can be seen in the beginning of the curve in Figure 5.2. In these instances the
model was able to reduce the number of unscheduled orders instead.

Total tardiness
120

100
Total tardiness (days)

80

60

40

20

0
0 50 100 150 200
Allowed changes in the campaigns

Figure 5.2: How the value of total tardiness varies with different values of allowed
changes 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 in
Figure 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 of
total 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 average
tardiness, that the tardiness was defined using the optimistic value of completion time for
jobs. 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 of
delayed orders decreases when the number of allowed changes increases, and as expected
the curve for total tardiness and the number of delayed orders are very similar.
Rannveig Guðmundsdóttir 31

Average tardiness
2.0
Average tardiness (days)

1.5

1.0

0.5

0.0
0 50 100 150 200
Allowed changes in the campaigns

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

Delayed orders
16
14
# of delayed orders

12
10
8
6
4
2
0
0 50 100 150 200
Allowed changes in the campaigns

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

5.4 Sensitivity analysis

To examine the sensitivity of the modelling parameters a sensitivity analysis was made for
the number of unscheduled orders. To start with the model was executed with Dif f Limit
= 25, N rChangesLimit = 5, SizeN CLimit = 25 and N rN CLimit = 5 (as execution
5 in above). Thereafter the model was executed several times and each time the value of
only 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 for
changes in Dif f Limit. When Dif f Limit was increased by 100% (from 25 to 50) and
all other modelling parameters remained unchanged the number of unscheduled orders
decreased from 16 to 14. However the results for the other modelling parameters are
quite similar.

Sensitivity analysis
25
# of unscheduled orders

23

21
DiffLim
19
SizeNcLim
17 NrChLim

15 NrNewClim

13
-150% -100% -50% 0% 50% 100% 150%
Allowed changes in the campaigns

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 the
campaigns it is possible to achieve a better schedule. The objective function consist of
two components, minimizing the number of unscheduled orders and minimizing the to-
tal tardiness of scheduled orders. Since minimizing the number of unscheduled orders
is defined with a higher weight, the curve for number of unscheduled orders is always
downward. Minimizing the total tardiness is defined with a lower weight which explains
the upward slope early in the curve for total tardiness. In those cases the model was able
to reduce the number of unscheduled order instead. When the value of allowed changes
has reach 50, both total tardiness and number of unscheduled orders has decreased signifi-
cantly. When examining the sensitivity analysis the Dif f Limit (limit on total differences
in 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 scheduling
orders into a preplanned campaign plan. When allowing the preplanned campaign plan to
change, 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 in
this study could be useful as a decision making tool to give the schedulers an idea of how
they might change the preplanned campaign plan in order to schedule more orders and/or
to minimize the delay, and to evaluate whether the change is worth it or not. Moreover
it can reduce the valuable time spent in scheduling. The next step would be to run the
model with a new dataset and get feedback from the pharmaceutical company whether
the solution is useful.

If the model would be implemented, we would recommend the weight of the orders to be
estimated, 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 future
work to arrange the jobs within the campaigns. However the solution time will increase
significantly, but it might be possible to run the model over night. The model proposed in
this study would be more suitable if the company seeks a decision making tool to provide
a 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 the


secondary 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 in


Operations 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 comparison


of scheduling algorithms for flexible flow shop problems with unrelated parallel
machines, 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-purpose


batch 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 batch


processes in the chemical industry. OR Spectrum, vol. 24, pp. 281-314, 2002.

[12] N. Susarla, I. A. Karimi. Integrated campaign planning and resource allocation in


batch 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 production


machines in a pharmaceutical company. M.S. thesis, Sch. of Sci. & Eng, Reykjavík
Univ., Reykjavík 2010.

[15] E. I. Asgeirsson, G. S. Axelsdottir, H. Stefansson. Automating a manual production


scheduling 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

INDEX
c := 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’ := j
Jlast[j] := INDEXFILE("Jlast.dat");

DATA
STO[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 VARIABLES
x[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];

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

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

MODEL
MIN markfall = SUM(Jlast: T[j])+alfa*SUM(Jlast: y[j])
Rannveig Guðmundsdóttir 39

SUBJECT TO
Tard[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];

BOUNDS
E[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

ST Oc : [1, 6, 3, 8, 0, 0]
ET Oc : [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 job
stc0 c : 1 time unit
tj : [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]
α: 100
DiffLimit: 0
NrChangesLimit: 0
SizeNCLimit: 0
NrNCLimit: 0
42 Production scheduling in a campaign based flexible flow shop

B.2 The data for test case 2

ST Oc : [1, 6, 3, 8, 0, 0]
ET Oc : [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 job
stc0 c : 1 time unit
tj : [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]
α: 100
DiffLimit: 20
NrChangesLimit: 20
SizeNCLimit: 8
NrNCLimit: 2
School of Science and Engineering
Reykjavík University
Menntavegur 1
101 Reykjavík, Iceland
Tel. +354 599 6200
Fax +354 599 6201
www.reykjavikuniversity.is
ISSN 1670-8539

You might also like