Similar documents
The EOQ Inventory Formula

Verifying Numerical Convergence Rates

Can a Lump-Sum Transfer Make Everyone Enjoy the Gains. from Free Trade?

How To Ensure That An Eac Edge Program Is Successful


M(0) = 1 M(1) = 2 M(h) = M(h 1) + M(h 2) + 1 (h > 1)

Geometric Stratification of Accounting Data

2.23 Gambling Rehabilitation Services. Introduction

2 Limits and Derivatives

Comparison between two approaches to overload control in a Real Server: local or hybrid solutions?

Derivatives Math 120 Calculus I D Joyce, Fall 2013

College Planning Using Cash Value Life Insurance

Schedulability Analysis under Graph Routing in WirelessHART Networks

An inquiry into the multiplier process in IS-LM model

Optimized Data Indexing Algorithms for OLAP Systems

Distances in random graphs with infinite mean degrees

What is Advanced Corporate Finance? What is finance? What is Corporate Finance? Deciding how to optimally manage a firm s assets and liabilities.

FINITE DIFFERENCE METHODS

SAMPLE DESIGN FOR THE TERRORISM RISK INSURANCE PROGRAM SURVEY

Lecture 10: What is a Function, definition, piecewise defined functions, difference quotient, domain of a function

Note nine: Linear programming CSE Linear constraints and objective functions. 1.1 Introductory example. Copyright c Sanjoy Dasgupta 1

Math 113 HW #5 Solutions

For Sale By Owner Program. We can help with our for sale by owner kit that includes:

SAT Subject Math Level 1 Facts & Formulas

- 1 - Handout #22 May 23, 2012 Huffman Encoding and Data Compression. CS106B Spring Handout by Julie Zelenski with minor edits by Keith Schwarz

Tangent Lines and Rates of Change

SWITCH T F T F SELECT. (b) local schedule of two branches. (a) if-then-else construct A & B MUX. one iteration cycle

Research on the Anti-perspective Correction Algorithm of QR Barcode

A system to monitor the quality of automated coding of textual answers to open questions

Catalogue no XIE. Survey Methodology. December 2004

Cyber Epidemic Models with Dependences

Strategic trading and welfare in a dynamic market. Dimitri Vayanos

Free Shipping and Repeat Buying on the Internet: Theory and Evidence

CHAPTER 7. Di erentiation

Section 3.3. Differentiation of Polynomials and Rational Functions. Difference Equations to Differential Equations

ACT Math Facts & Formulas

1.6. Analyse Optimum Volume and Surface Area. Maximum Volume for a Given Surface Area. Example 1. Solution

Chapter 11. Limits and an Introduction to Calculus. Selected Applications

Channel Allocation in Non-Cooperative Multi-Radio Multi-Channel Wireless Networks

Verification of Security Protocols with Lists: from Length One to Unbounded Length

Staffing and routing in a two-tier call centre. Sameer Hasija*, Edieal J. Pinker and Robert A. Shumsky

Training Robust Support Vector Regression via D. C. Program

To motivate the notion of a variogram for a covariance stationary process, { Ys ( ): s R}

Instantaneous Rate of Change:

Simultaneous Location of Trauma Centers and Helicopters for Emergency Medical Service Planning

Pre-trial Settlement with Imperfect Private Monitoring

Pretrial Settlement with Imperfect Private Monitoring

The modelling of business rules for dashboard reporting using mutual information

Determine the perimeter of a triangle using algebra Find the area of a triangle using the formula

OPTIMAL DISCONTINUOUS GALERKIN METHODS FOR THE ACOUSTIC WAVE EQUATION IN HIGHER DIMENSIONS

Multigrid computational methods are

OPTIMAL FLEET SELECTION FOR EARTHMOVING OPERATIONS

Dynamically Scalable Architectures for E-Commerce

Heterogeneous firms and trade costs: a reading of French access to European agrofood

Writing Mathematics Papers

Shell and Tube Heat Exchanger

MULTY BINARY TURBO CODED WOFDM PERFORMANCE IN FLAT RAYLEIGH FADING CHANNELS

2.12 Student Transportation. Introduction

Multivariate time series analysis: Some essential notions

DEPARTMENT OF ECONOMICS HOUSEHOLD DEBT AND FINANCIAL ASSETS: EVIDENCE FROM GREAT BRITAIN, GERMANY AND THE UNITED STATES

Chapter 10: Refrigeration Cycles

Orchestrating Bulk Data Transfers across Geo-Distributed Datacenters

Guide to Cover Letters & Thank You Letters

Tis Problem and Retail Inventory Management

Bonferroni-Based Size-Correction for Nonstandard Testing Problems

Keskustelualoitteita #65 Joensuun yliopisto, Taloustieteet. Market effiency in Finnish harness horse racing. Niko Suhonen

Operation go-live! Mastering the people side of operational readiness

A strong credit score can help you score a lower rate on a mortgage

1. Case description. Best practice description

Math Test Sections. The College Board: Expanding College Opportunity

Pioneer Fund Story. Searching for Value Today and Tomorrow. Pioneer Funds Equities

SHAPE: A NEW BUSINESS ANALYTICS WEB PLATFORM FOR GETTING INSIGHTS ON ELECTRICAL LOAD PATTERNS

TRADING AWAY WIDE BRANDS FOR CHEAP BRANDS. Swati Dhingra London School of Economics and CEP. Online Appendix

Predicting the behavior of interacting humans by fusing data from multiple sources

SAT Math Must-Know Facts & Formulas

Average and Instantaneous Rates of Change: The Derivative

Digital evolution Where next for the consumer facing business?

Theoretical calculation of the heat capacity

CHAPTER 8: DIFFERENTIAL CALCULUS

schema binary search tree schema binary search trees data structures and algorithms lecture 7 AVL-trees material

WORKING PAPER SERIES THE INFORMATIONAL CONTENT OF OVER-THE-COUNTER CURRENCY OPTIONS NO. 366 / JUNE by Peter Christoffersen and Stefano Mazzotta

The Trip Scheduling Problem

Large-scale Virtual Acoustics Simulation at Audio Rates Using Three Dimensional Finite Difference Time Domain and Multiple GPUs

Torchmark Corporation 2001 Third Avenue South Birmingham, Alabama Contact: Joyce Lane NYSE Symbol: TMK

Transcription:

Improved dynamic programs for some batcing problems involving te maximum lateness criterion A P M Wagelmans Econometric Institute Erasmus University Rotterdam PO Box 1738, 3000 DR Rotterdam Te Neterlands A E Gerodimos Centre for Quantitative Finance Imperial College Exibition Road London, SW7 2B United Kingdom April 27, 1999 Abstract We study four sceduling problems involving te maximum lateness criterion and an element of batcing. For all te problems tat we examine, algoritms appear in te literature tat consist of a sorting step to determine an optimal job sequence, followed by a dynamic programming step tat determines te optimal batces. In eac case, te dynamic program is based on a backward recursion of wic a straigtforward implementation requires O(n 2 ) time, were n is te number of jobs. We present improved implementations of tese dynamic programs tat are based on monotonicity properties of te objective expressed as a function of te total processing time of te rst batc. Tese properties and te use of ecient data structures enable optimal solutions to be found for eac of te four problems in O(n log n) time; in two cases, te batcing step is actually performed in linear time and te overall complexity is determined by te sorting step. 1

1 Introduction Te early 1990's saw te emergence of powerful tecniques tat reduced te time requirement of dynamic programming algoritms for te classic economic lot sizing (ELS) problem [8, 14, 1]. It was subsequently realized tat certain sceduling problems involving te sum of completion times objective and an element of batcing exibited structural properties tat made tem amenable to more ecient dynamic programming solutions. In some cases [7, 3], te improved scemes were problem-specic; in oter cases [6, 10], te dynamic programming recursion could be written in a form tat allowed te application of te geometric tecniques of Van Hoesel et al. [13], wic are a generalization of te tecnique used in [14]. Te typical complexity improvement was from O(n 2 )too(n log n), were n is te number of jobs. A question tat arises naturally is weter similar improvements can be acieved in solving te maximum lateness counterparts of tese batcing problems since, in a standard implementation, te respective dynamic programs ave also quadratic time requirements. Tis paper provides an armative answer to tis question. We study four suc batcing problems and provide implementations of dynamic programming wit a time requirement tat is eiter linear or O(n log n). Since te batcing problems are solved after an initial sorting step, our results imply O(n log n) algoritms for te four maximum lateness problems. Te remainder of tis paper is organized as follows. In Section 2 we sketc our approac wit particular focus on a subproblem tat we encounter frequently wen solving te four batcing problems. Subsequently, we list te problems in order of relative complexity, bot in terms of te improved running time and te diculty of obtaining tis improvement. Specically, Section 3 deals wit te problem of batcing jobs of a single type under batc availability. A problem in wic jobs are processed by a batcing macine is te subject of Section 4. In Section 5 we give an improved algoritm for batcing customized two-operation jobs on a single macine under batc availability and we indicate ow a similar approac can be adopted in te case of item availability. Finally, some concluding remarks are given in Section 6. 2 Preliminaries In general, solving sceduling problems wit a batcing element involves taking te appropriate batcing and sequencing decisions. For te problems 2

tat we examine in tis paper, tese two aspects can be decoupled. In fact, for tree of our problems tere is an optimal scedule in wic jobs complete according to te earliest due date (EDD) rule, wereas for te problem studied in Section 4 te sortest processing time (SPT) rule is optimal. In any case, te sorting step imposes a lower bound of O(n log n)on te overall complexity ofany algoritm. For two of te problems examined ere, improving te eciency of te dynamic programming step results in te sorting step being te overall bottleneck. Altoug it is dicult to provide a description of a procedure tat would be general enoug to be applied to all te problems tackled in tis paper, we now sketc some common elements of our approac; te implementation details and some special data structures deployed are covered in te subsequent sections. Our starting point is always a backward recursion dynamic program wit batc insertion [11]: te optimal scedule is built by inserting entire batces of jobs (or operations) at te start of previously obtained scedules. Te recursions are tus of te general form: G k = min f maxfp k;l + G l ;L k;l gg; (1) k<ln+1 were G k is te minimum lateness of scedules including jobs k; k+1;:::;n, wereas P k;l and L k;l denote te total processing time and overall lateness of te inserted batc, wic consists of te jobs k; k +1;:::;l, 1. In oter words, l is te index of te rst job in te second batc. Our rst step is to observe tat te index set fk +1;:::;n +1g can be divided into two mutually exclusive index sets I 1 and k I2 k so tat te maximum in (1) is given by eiter te rst or te second term, respectively. In view of tat, (1) can be re-written as G k = min f minfp k;l + G l g; min L k;l gg; (2) l2i k 1 l2i k 2 For reasons tat will become clearer in te subsequent sections, te solution to te second minimization problem in (2) is obtained by retrieving te minimal index l from I 2 k. Tis leaves us wit te following tasks: a) maintain/update te index sets I 1 k and I2 k eciently, b) solve te rst minimization problem and, were applicable, a second optimization problem tat arises wen calculating L k;l. Wit respect to te rst task, observe tat I 1 and k I2 k are not necessarily contiguous. In fact, as we sow in te subsequent sections, te satisfaction 3

of tis additional condition by some problems leads to linear-time implementations; were tis is not te case, updating tese index sets is `costly' and te complexity of te dynamic program becomes O(n log n). As for te second task, bot te rst minimization problem and te non-trivial variants of te second optimization problem possess a key property tat enables a solution to be found in time wic is overall linear. Specically, te idea is to transform all suc problems into a problem of te following type: Problem (P) Determine te minima m k, k =1; 2;:::;n, dened as m k = min f l k<luk were u k 2fk; k +2;:::;ng for all k =1; 2;:::;n (m k = 1 if u k = k) and te following conditions old: a. u k u k+1 for all k =1; 2;:::;n, 1 b. u n = n c. u k is known once m k+1 is known, k =1; 2;:::;n, 1 d. f k is known once m k is known, k =1; 2;:::;n Conditions (c) and (d) suggest tat te values m k can only be calculated in order of decreasing index k. A straigtforward way to solve problem (P) requires O(n 2 ) time. We sow, owever, tat a linear time bound is possible. Consider, for an arbitrary k 2 f1; 2 :::;ng wit u k > k, te values f l ; l = k +1;k+2;:::;u k. Let t(1);t(2);:::;t(r) be te unique subsequence of k +1;k+2;:::;u k wic as te following properties: 1. t(1) = k +1, 2. t(i +1) is te smallest index in ft(i) +1;t(i) +2;:::;u k g suc tat f t(i+1) <f t(i), i =1;:::;r, 1. Clearly, tis subsequence as te properties t(1) < t(2) < ::: < t(r) and f t(1) > f t(2) > ::: > f t(r). Moreover, f t(r) = m k. Hence, given te subsequence, te desired minimum is immediately available. We keep track of te subsequence by storing its elements in decreasing order in a list (i.e, f k+1 is te element at te top). Tis particular data structure as te property tat elements at te bottom can only be deleted, wile elements at te top can be bot deleted and added. Hence, it could 4

be viewed as a combination of a stack and a queue, and it can easily be implemented so tat eac deletion and eac addition requires constant time (see [2]). To see wy tis data structure is convenient, rst observe te following: if for a given k 2, a value l 2 fk +1;k +2;:::;u k g is not selected in te subsequence, ten l will not be selected for k, 1. Tis follows from te fact tat tere exists some value in te subsequence, say t(i), suc tat k +1 t(i) < l and f t(i) < f l. Now if l 2 fk; k +1;:::;u k,1 g, ten also t(i) 2 fk; k +1;:::;u k,1 g and tis implies tat l sould still be excluded from te subsequence. Repetition of tis argument leads to an element never being considered for inclusion in te subsequence once it as been excluded. Tis means tat wen for a certain k 2 te elements t(1);t(2);:::;t(r) of te subsequence are given, ten once u k,1 is known te corresponding subsequence for k, 1 can be constructed as follows. Because u k,1 u k,we rst delete from te bottom of te list any element larger tan u k,1. Now, suppose u k,1 > k, 1. Ten, because k will be added at te top of te list, we delete from te top all remaining elements t(i) for wic f k f t(i). Finally, we add k at te top of te list. In case u k,1 = k, 1 te list is empty after te deletion operations and no element is added. Te above updating process is carried out n, 1 times in total. Eac time at most one element is added, wic requires constant time per addition. Furtermore, several elements may be deleted. Note tat, because te list elements are already ordered, eac deletion requires indeed constant time. Te number of deleted elements can not be bounded nicely for eac individual time te updating process is carried out. However, te overall number of deletions is not larger tan n. Te reason for tis is simple: in te updating process, eac of te elements 1; 2;:::;n is added at most once to te list and terefore it can be deleted at most once. To summarize te above discussion: we ave sown tat problem (P) can be solved in O(n) time. 3 Sceduling jobs of a single type under batc availability Te problem we are addressing in tis section may be stated formally as follows. Tere are n jobs to be sceduled on a single macine. Eac job j (j = 1;:::;n) as a processing time p j and a due date d j by wic it sould ideally complete. Jobs can be processed consecutively in batces. At te start of te scedule and prior to eac batc, a set-up time s is 5

incurred, wic motivates te formation of longer batces so as to reduce te completion time of later jobs. However, batc availability applies, wic means tat all te jobs tat belong to te same batc complete only wen te last job in te batc completes. As a consequence, extending a batc by including additional jobs increases te completion time of te jobs previously in te batc. Te above problem setting is introduced in [12]. For te sum of completion times objective, an ecient algoritm is given by Coman et al. [7]: te batcing step is performed in linear time to give an overall time requirement ofo(n log n). An extension of tis algoritm for a sligtly more general cost function is proposed by Albers and Brucker [3] (see also [5]). It is wort pointing out tat te approac in [7, 3], like ours, relies on te notion of a queue. However, in te problem examined ere, te presence of a maximum operation witin te dynamic programming recursion is an additional complication tat does not arise in te sum of completion times variant. (Tis is also true for te problems addressed in later sections.) It is sown in [15] tat tere is an optimal scedule in wic jobs complete according to te earliest due date (EDD) rule. Tus, te jobs can be re-indexed according to tis rule in O(n log n) time and te problem reduces to one of batcing tat can be solved using a backward dynamic program wit batc insertion. Let G k denote te minimum overall lateness of a scedule containing jobs k; k + 1;:::;n wen starting at time 0. Te initialization is G n+1 =,1 and te recursion for k = n; n, 1;:::;1is G k = min f maxf(s + a k, a l )+G l ; (s + a k, a l ), d k gg; (3) k<ln+1 P n were a k = p for k = 1;:::;n. Here l denotes te rst job in te second batc of te scedule. Since tis batc starts at time s + a k, a l, te minimum overall lateness from tis batc onward is given by te rst term between brackets, wile te lateness of te rst batc is given by te oter term (since job k as te smallest due date). As pointed out in [15], a straigtforward implementation of te above algoritm requires O(n 2 ) time. However, we now sow tat te dynamic programming part can be implemented in linear time. From (3), or common sense reasoning, it follows tat G l+1 G l for every l n, 1. Hence, if G l+1,d k for some k 2 f1;:::;ng, ten also G l,d k. We now dene q k as te largest job index l in fk +1;:::;ng suc tat G l,d k ; if no suc index exists, we dene q k = k. (Note tat, because of te EDD order, q k+1 q k olds for every k n, 1.) From te above observations, it follows tat for all indices l 2 I 1 = k 6

fk +1;:::;q k g te maximum in (3) is given by te rst term, wereas for l 2 I 2 k = fq k +1;:::;n+1g, te maximum is given by te second term. Now (3) can be rewritten as G k = minf min fs + a k, a l + G l g; k<lqk min fs + a k, a l, d k gg: qk<ln+1 Note tat, for tis problem, eac ofi 1 and k I2 k is contiguous. Furter, te second minimum is always attained for l = q k +1: owing to te batc availability assumption and te EDD indexing of te jobs, te overall lateness of a batc is always determined by te rst job in te batc. Consequently, te remaining task is to compute s + a k + min f,a l + G l g (4) k<lqk eciently. However, since tis as to be done for every value of k, we actually need to solve an instance of problem (P) wit u k = q k and f l =,a l + G l. Hence, it takes overall O(n) time to calculate te minima given by (4). Since te parameters a l, l =1; 2;:::;;n, and, because of monotonicity, te values q k ; k =1; 2;:::;n, can be computed in O(n) time, we ave now sown tat te time requirement of our algoritm to solve te batcing problem is linear. Hence, because of te sorting step, te overall time requirement is O(n log n). Tis constitutes an improvement over te algoritm in [15]. 4 Sceduling jobs on a batcing macine Te problem we are addressing in tis section may be stated formally as follows. Tere are n jobs to be processed on a single batcing macine. Tis macine is capable of processing up to b jobs simultaneously in batces. Eac job j (j =1;:::;n) as a processing time p j and a due date d j by wic it sould ideally complete. Wenever a batc is formed, its completion time is equal to te largest processing time of any job in te batc. Te model is analyzed extensively in a recent paper by Brucker et al. [6]. Tey distinguis between te unbounded case were b n and te bounded case wereby b<n. For te unbounded problem of minimizing te maximum lateness, it is sown in [6] tat tere is an SPT-batc optimal scedule. Tus, te jobs can be re-indexed according to tis rule in O(n log n) time and te problem reduces to one of batcing tat can be solved using te following backward dynamic program wit batc insertion of Brucker et al. [6]. Let G k denote te minimum overall lateness of a scedule containing 7

jobs k; k+1;:::;nwen starting at time 0. Te initialization is G n+1 =,1 and te recursion for k = n; n, 1;:::;1is G k = min k<ln+1 fmaxfp l,1 + G l ; p l,1 + max kjl,1 f,d j ggg; (5) were l sould again be interpreted as te rst job of te second batc, wic starts wen te rst batc completes. By denition, tis appens wen te longest job (l, 1) of te rst batc completes. A standard implementation of te above algoritm, as proposed in [6], requires O(n 2 ) time. We now sow tat te dynamic programming part can be implemented in linear time, tus yielding an overall time requirement of O(n log n). Our approac is somewat similar to te one in te previous section. Again it can easily be veried tat G l+1 G l for every l n, 1. Hence, if G l+1 > max k<jl f,d j g for some k 2f1;:::;ng, ten G l G l+1 > max f,d j g max f,d jg: k<jl k<jl,1 It follows tat, if I 1 and k I2 are dened as in Section 2 (tat is: k I1 = k fl 2 fk +1;:::;ngjG l max k<jl,1 f,d j gg and I 2 = k I1 k \fk +1;:::;n+1g), ten, I 1 = k fk +1;:::;q kg and I 2 = k fq k +1;:::;n+1g, were q k is te largest index wit te required property. For convenience we dene q k = k if te inequality is not satised by any job in fk +1;k+2;:::;ng. Note tat q k is non-decreasing in k. Recursion formula (5) can now be rewritten as G k = minf min fp l,1 + G l g; k<lqk min fp l,1 + max f,d jggg: qk<ln+1 kjl,1 Te rst minimization problem between brackets can again be viewed as an instance of problem (P) wit u k = q k and f l = p l,1 + G l. Wit respect to te second minimization problem, we observe tat, for a xed arbitrary k, te minimum is attained for l as small as possible, i.e. l = q k +1, since tis minimizes bot te term p l,1, because of te SPT order, as well as te range over wic te maximum is computed. Hence, we are left wit calculating p + max q k f,d j g = p + q k maxf,d k; kjqk Tis boils down to solving te problem min fd j g; k<jqk 8 max f,d j gg: k<jqk

wic is an instance of (P) wit u k = q k and f j = d j. From tese observations and te fact tat, because of monotonicity, te values q k ; k = 1; 2;:::;n, can be computed in O(n) time, it follows tat te time requirement of our algoritm to solve te batcing problem is linear. Hence, taking into account te SPT-sorting step, te overall time requirement is again O(n log n). Tis constitutes an improvement over te algoritm in [6]. Finally, we note tat Brucker et al. [6] use teir algoritm for minimizing te maximum lateness as a subroutine in a polynomial procedure for minimizing te maximum cost. Terefore, te O(log n) improvement obtained ere applies to tat procedure too. 5 Sceduling customized two-operation jobs Te problem we are addressing in tis section may be stated formally as follows. Tere are n jobs wic ave to be sceduled on a single macine. Eac job j (j = 1; 2;:::;n) as two operations, namely a standard operation followed { not necessarily immediately { by aspecic operation. Tese operations ave processing times p (1) j and j, respectively. A set-up time is required before te rst standard operation and wenever tere is a switc in production from specic to standard operations; two standard operations may be processed consecutively to form a batc witout a set-up in between. Wit respect to te way in wic standard operations are released (become available) after processing, two scemes are possible: batc availability, de- ned in Section 3, and te alternative item availability wereby an operation becomes available immediately after it as been processed. We only analyze te batc availability variant explicitly and give comments as to ow te result can be extended to te item availability case. Te model is introduced in [4] (for batc availability) and ten analyzed for due-date related criteria in [10]. We note tat te problem discussed in [4] for te sum of completion times objective was sown to be equivalent to te, seemingly simpler, problem studied in [7]. In particular, it was sown tat te specic (unique) operations can essentially be removed from te problem. If tis were also te case for te maximum lateness variants of tese problems, ten te results of Section 3 could be used directly to solve te problem discussed in tis section. Before we proceed wit our analysis, it is wortwile to sow tat tis is not te case. Consider te instance of te two-operation variant in wic te set up time is c (c > 0) and tere are tree jobs wit due dates and operation processing times as sown in Table 1. 9

Table 1: Job data 1 Job i 1 2 3 p (1) i 1 1 1 i 1 1 c +2 d j c +1 2c +3 2c +3 It can be easily veried tat te problem of Section 3 obtained by omitting te specic operations, as as te unique optimal solution job 1 in te rst batc and jobs 2 and 3 in te second batc. Te value of tis solution is L max = 0. However, inserting te specic operations into tis scedule (immediately after te corresponding batc) yields a scedule for te two-component problem wit lateness equal to c +4. It is easy to see tat sceduling all te standard operations in one batc, followed by all te specic operations in EDD order, yields a scedule wit lateness of 4. Tus, our example suggests tat tere is no obvious way to translate optimal solutions to te problem in Section 3 into optimal solutions for te problem in tis section. Tis observation and te analysis below seem to lead to te conclusion tat te problem in tis section is genuinely more complex. Returning to te two-operation problem, it is sown in [10] tat tere is an optimal scedule in wic jobs complete according to te EDD rule. Tus, te jobs can be re-indexed according to tis rule in O(n log n) time and te problem reduces to one of batcing tat can be solved using a backward dynamic program wit batc insertion [10]. Let G k denote te minimum overall lateness of a scedule containing jobs k; k + 1;:::;n. Te initialization is G n+1 =,1 and te recursion for k = n; n, 1;:::;1is 8 > < G k = min fmax k<ln+1 > : +P s l,1 p(1) +P l,1 p(2) + G l; P P l,1 s + p(1) + max j kjl,1f p(2), d jg 9>= >; g: (6) Again, G k+1 G k for k =1; 2;:::;n, 1 olds. A standard implementation of te above algoritm requires O(n 2 ) time, if some preprocessing is used. We now sow tat te dynamic programming part can be implemented in O(n log n) time tus yielding an overall time requirement of O(n log n). For te maximum in (6) to be given by te rst term, te following needs 10

to old or equivalently G l, G l n =l max k<jl,1 f, l,1 =j+1 max f, kjl,1 n =j+1, d jg;, d jg: (7) Consider an arbitrary index k 2 f2; 3;:::;ng. Let te subset I1 k fk +1;k+2;:::;ng contain te indices for wic (7) olds. We rst explain owwe determine I k,1 1. Since te left-and-side value of (7) does not depend on k and max f, kjl,1 n =j+1, d jg max k,1jl,1 f, n =j+1, d jg it olds tat (I k,1 1 \fk +1;k+2;:::;ng) I1 k. Moreover, te elements of I1 k k,1 wic are not in I1 are exactly tose l 2 I1 k for wic G l, n =l <, n, d k,1: (8) Note tat te rigt-and-side of (8) is a constant for xed k. Hence, if te inequality is satised for one or more indices in I1 k, ten tese correspond P n to te smallest elements of te set fg l, =l p(2) be used to eciently determine I k,1 j l 2 I 1 k g. Tis fact can 1. In our implementation, we make use of a eap, wic we denote by H 1 Recall tat tis data structure as te following properties [2]: (i) te minimum of all values stored in te eap can be retrieved in constant time, (ii) adding a value to te eap takes O(log m) time, were m is te number of stored values, (iii) deleting a value from te eap takes O(log m) time. P n Suppose tat eap H 1 contains te values G l, =l p(2) for all l 2 I k 1. After G k as been calculated (ow tis is done P eciently will be sown n below), wewould like H 1 to contain te values G l, =l p(2) k,1 for all l 2 I 1 g. To acieve tis, we rst ceck weter te minimum value is less tan te 11

rigt-and-side of (8). If tis is te case, ten we delete te minimum from H 1 and we repeat te comparison wit te new minimum value. We keep deleting te current minimum value from H 1 until tis value becomes at least te as large as te rigt-and-side of (8) or until H 1 is empty. Ten we ceck weter G k, P n p(2) is at least as large as te rigt-and-side of (8). Only if tis is te case, do we add G k, P n p(2) to H 1. At tis point, for all l 2 I k,1 1. In parallel to updating P n H 1 contains te values G l, =l p(2) H 1,we can keep track of te indices tat correspond to its elements. Let us now turn to te issue of te ecient calculation of G k. From te denition of I1 k it follows tat we would like to calculate and s + min l2i k 2 s + min l2i k 1 l,1 f l,1 max f kjl,1 p (1) + l,1 were I k 2 = fk +1;k+2;:::;n+1gnI k 1. First consider (10). Suppose l; i 2 I k 2 max kjl,1 l,1 f i,1 max f kjl,1 i,1 max f kji,1 p (1) + j p (1) + j j p (1) + j p (1) + + G lg (9), d jg; (10) and l<i, ten, d jg, d jg, d jg: It follows tat te minimum in (10) is attained for te smallest element of I2 k, wic we denote by q k; we dene q k = k if I 2 = ;. Hence, (10) is equivalent to or qk,1 s, p (1) k,1, =1 qk,1 s + max f kjqk,1 + maxf k =1 p (1) + j, d jg j + d k;, min f, k<jqk,1 12 =1 + d jgg:

From te discussion about te updating process of eap H 1, it follows tat te values q k are non-decreasing in k. (Also note tat keeping track of te values q k, k = 1; 2;:::;n, requires overall O(n) time.) P Hence, te j minimization is an instance of (P) wit u k = q k,1 and f j =, =1 p(2) +d j. It follows tat (10) can be calculated for all values of k = 1; 2;:::; ntogeter in linear time. For te ecient calculation of (9), we use a eap H 2 wic contains te values P l,1 =1 p(1) +P l,1 =1 p(2) + G l for all l 2 I k 1 and possibly for some l 2 I k 2. Note tat tese values are independent of k. To calculate (9), we simply retrieve te minimum from te eap. If te minimum corresponds to an element ofi2 k,we delete tis value from H 2 and retrieve te new minimum. Tis is repeated until te minimum corresponds to an element ofi1 k or until H 2 is empty. In te latter case te value of (9) is 1, wile in te former case we get te value of (9) by adding s and subtracting P k,1 =1 p(1) +P k,1 =1 p(2). Te time complexity of te above algoritm depends on te number of additions to and deletions from te eaps. For every l = 1; 2;:::;n, te P l,1 =1 p(2) value G l, P n =l p(2) is added at most once to H 1 and te value P l,1 =1 p(1) + + G l is added at most once to H 2. (Tese additions actually occur at te same point in time.) Furtermore, deletion from H 1 and H 2 also occurs at most once for every index. Since te eaps never contain more tan n elements, it follows tat te total computational eort involving eap operations is O(n log n). P n p(1) Finally, we note tat partial sums suc as P l,1,p n p(1) can be replaced by =l p(1). Partial sums of te latter type can be calculated in linear time in a preprocessing step. We ave now arrived at te required result: our algoritm solves te batcing problem in O(n log n) time tus yielding an overall time requirement ofo(n log n) time. Tis constitutes an improvement over te algoritm in [10]. Wit respect to te item availability case, we note tat te problem can be solved using a double recursion dynamic program wit block insertion; suc a sceme is proposed in [9] and enables us to deploy te approac developed in tis section `twice' (in parallel, even) to reduce te overall complexity too(n log n). 13

6 Concluding Remarks We ave presented improved dynamic programming algoritms for a class of sceduling problems involving te maximum lateness criterion and an element of batcing. A question tat arises is weter insigts gained from tis study can elp to reduce te time requirement of algoritms for oter, more complicated, models involving te batcing of jobs tat belong to dierent families. Since, in tat context, te tasks of sequencing and batcing can only be separated witin eac family but not at te overall level, it is not obvious weter or ow our approac could be applied to tose problems. An interesting researc direction is tat of ascertaining weter tere exist maximization problems outside te domain of production sceduling tat are amenable to our approac. Acknowledgements Te autors wis to tank Cris Potts wo suggested tis researc topic. Financial support by te Tinbergen Institute is gratefully acknowledged. References [1] A Aggarwal and J K Park. Improved algoritms for economic lot size problems. Operations Researc, 41(3):549{571, 1993. [2] A V Ao, J E Hopcroft, and J D Ullman. Data Structures and Algoritms. Addison-Wesley, Reading, MA, 1987. [3] S Albers and P Brucker. Te complexity of one-macine batcing problems. Discrete Applied Matematics, 47:87{107, 1993. [4] K R Baker. Sceduling te production of components at a common facility. IIE Transactions, 20(1):32{35, 1988. [5] P Brucker. Sceduling Algoritms. Springer Verlag, Berlin, 1995. [6] P Brucker, A Gladky, H Hoogeveen, M Y Kovalyov, C N Potts, T Tautenan, and S van de Velde. Sceduling a batcing macine. Journal of Sceduling, 1:31{54, 1998. [7] E G Coman, M Yannakakis, M J Magazine, and C Santos. Batc sizing and job sequencing on a single macine. Annals of Operations Researc, 26:135{147, 1990. 14

[8] A Federgruen and M Tzur. A simple forward algoritm to solve general dynamic lot sizing models wit n periods in O(n log n) or O(n) time. Management Science, 37:909{925, 1991. [9] A E Gerodimos, C A Glass, and C N Potts. Sceduling customised jobs on a single macine under item availability. submitted to IIE Transactions in Operations Researc, 1998. [10] A E Gerodimos, C A Glass, and C N Potts. Sceduling te production of two-operation jobs on a single macine. to appear in a Feature Issue of European Journal of Operational Researc dedicated to te 15t EURO Summer Institute, ESI V, on Production Sceduling, St Vincent, Aosta Valley, Italy, September 12-26, 1997, 1998. [11] M Y Kovalyov and C N Potts. Sceduling wit batcing: A review. to appear in a Feature Issue of European Journal of Operational Researc dedicated to te 15t EURO Summer Institute, ESI V, on Production Sceduling, St Vincent, Aosta Valley, Italy, September 12-26, 1997, 1998. [12] C A Santos and M J Magazine. Batcing in single operation manufacturing systems. Operations Researc Letters, 4(3):99{103, 1985. [13] S van Hoesel, A Wagelmans, and B Moerman. Using geometric tecniques to improve dynamic programming algoritms for te economic lot-sizing problem and extensions. European Journal of Operational Researc, 75:312{331, 1994. [14] A Wagelmans, S van Hoesel, and A Kolen. Economic lot sizing: An O(n log n) algoritm tat runs in linear time in te Wagner-Witin case. Operations Researc, 40(Supp. 1):145{156, 1992. [15] S Webster and K R Baker. Sceduling groups of jobs on a single macine. Operations Researc, 43:692{703, 1995. 15