Tech. Rpt. # UMIACS-TR-99-31, Institute for Advanced Computer Studies, University of Maryland, College Park, MD 20742, June 3, 1999.

Similar documents
Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

The Regulated and Riemann Integrals

p-adic Egyptian Fractions

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

20 MATHEMATICS POLYNOMIALS

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Chapter 0. What is the Lebesgue integral about?

Best Approximation. Chapter The General Case

Bases for Vector Spaces

Riemann is the Mann! (But Lebesgue may besgue to differ.)

4. GREEDY ALGORITHMS I

Math 61CM - Solutions to homework 9

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

Theoretical foundations of Gaussian quadrature

Recitation 3: More Applications of the Derivative

Math 1B, lecture 4: Error bounds for numerical methods

Riemann Sums and Riemann Integrals

We will see what is meant by standard form very shortly

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Riemann Sums and Riemann Integrals

Euler, Ioachimescu and the trapezium rule. G.J.O. Jameson (Math. Gazette 96 (2012), )

2.4 Linear Inequalities and Interval Notation

Lecture 14: Quadrature

Review of Calculus, cont d

19 Optimal behavior: Game theory

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

Improper Integrals, and Differential Equations

7.2 The Definite Integral

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

MORE FUNCTION GRAPHING; OPTIMIZATION. (Last edited October 28, 2013 at 11:09pm.)

The steps of the hypothesis test

Chapter 3 Polynomials

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

Numerical Analysis: Trapezoidal and Simpson s Rule

Lecture 1. Functional series. Pointwise and uniform convergence.

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

MAA 4212 Improper Integrals

Numerical integration

New Expansion and Infinite Series

Online Supplements to Performance-Based Contracts for Outpatient Medical Services

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Chapter 5 : Continuous Random Variables

The Henstock-Kurzweil integral

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

5.7 Improper Integrals

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

Math 360: A primitive integral and elementary functions

Infinite Geometric Series

Lecture 2: Fields, Formally

Lecture 19: Continuous Least Squares Approximation

4.4 Areas, Integrals and Antiderivatives

Polynomial Approximations for the Natural Logarithm and Arctangent Functions. Math 230

Review of Gaussian Quadrature method

Best Approximation in the 2-norm

Numerical Integration

NUMERICAL INTEGRATION

AQA Further Pure 1. Complex Numbers. Section 1: Introduction to Complex Numbers. The number system

Continuous Random Variables

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Week 10: Line Integrals

Generalized Fano and non-fano networks

Acceptance Sampling by Attributes

List all of the possible rational roots of each equation. Then find all solutions (both real and imaginary) of the equation. 1.

Math 4310 Solutions to homework 1 Due 9/1/16

Convergence of Fourier Series and Fejer s Theorem. Lee Ricketson

Convert the NFA into DFA

Green s functions. f(t) =

Line and Surface Integrals: An Intuitive Understanding

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Reversals of Signal-Posterior Monotonicity for Any Bounded Prior

Section 6.1 Definite Integral

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Frobenius numbers of generalized Fibonacci semigroups

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

Abstract inner product spaces

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

Orthogonal Polynomials

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

Section 4: Integration ECO4112F 2011

1 The Lagrange interpolation formula

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

Bernoulli Numbers Jeff Morton

1 The Riemann Integral

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

1 Linear Least Squares

Convex Sets and Functions

Review of basic calculus

Recitation 3: Applications of the Derivative. 1 Higher-Order Derivatives and their Applications

1 Probability Density Functions

Lecture 1: Introduction to integration theory and bounded variation

ODE: Existence and Uniqueness of a Solution

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Transcription:

Tech. Rpt. # UMIACS-TR-99-3, Institute for Advnced Computer Studies, University of Mrylnd, College Prk, MD 20742, June 3, 999. Approximtion Algorithms nd Heuristics for the Dynmic Storge Alloction Problem Prveen K. Murthy Angeles Design Systems pmurthy@ngeles.com Shuvr S. Bhttchryy ECE Dept., nd Institute for Advnced Computer Studies, University of Mrylnd, College Prk ssb@eng.umd.edu Abstrct In this report, we look t the problem of pcking number of rrys in memory efficiently. This is known s the dynmic storge lloction problem (DSA) nd it is known to be P-complete. We develop some simple, polynomil-time pproximtion lgorithms with the best of them chieving bound of 4 for subclss of DSA instnces. We report on n extensive experimentl study on the FirstFit heuristic nd show tht the verge-cse performnce on rndom instnces is within 7% of the optiml vlue. Introduction Formlly, the DSA problem is the following: Definition : Let B be the set of intervls (corresponding to the rrys). Let = B, the number of elements in B. For ech b B, sb ( ) is the time t which it becomes live, eb ( ) is the time t which it dies, nd wb ( ) is the width of intervl b ; the width represents, for exmple, the size of n rry tht needs lloction. ote tht the durtion of n intervl is eb ( ) sb ( ). Given the s, e, w vlues for ech b B, nd n integer K, is there n lloction of these intervls tht requires totl storge of K units or less? By n lloction, we men function A:B { 0,, K } such tht 0 Ab ( ) K w( b) for ech b B, nd if two intervls b nd b 2 intersect; i.e, if sb ( ) sb ( 2 ) eb ( ) or sb ( 2 ) sb ( ) eb ( 2 ), then Ab ( ) + wb ( ) Ab ( 2 ) or Ab ( 2 ) + wb ( 2 ) Ab ( ). The lloction function is lso clled coloring sometimes. The dynmic in DSA refers to the fct tht mny times, the problem is online in nture: the lloction hs to be performed s the intervls come nd go. Our interest in this problem stems from scheduling dtflow grphs [7]. The subset of dtflow tht we re interested in [7][], clled synchronous dtflow (SDF) [5], cn be scheduled stticlly t compile time. Hence, the problem is not relly dynmic since the lifetimes nd size of ll the rrys tht need to be llocted re known t compile time; thus, the problem should perhps be clled sttic storge lloction. But we will use the term DSA since this is consistent with the literture. of 5

Some nottion Theorem : [2] DSA is P-complete, even if ll the widths re nd 2. 2 Some nottion An instnce is set of lifetimes. An enumerted instnce is n instnce with some ordering of the intervls. For n instnce, we hve ssocited with it weighted intervl grph (WIG) G B = ( VE, ) where V is the set of intervls, nd E is the set of edges. There is n edge between two intervls iff they overlp in time. The grph is node-weighted by the widths of the intervls. For ny subset of nodes U V, we define the weight of U, w( U) to be the sum of the widths wv ( ) for ll u U. The mximum clique weight (MCW) in the WIG is the clique with the lrgest weight, nd is denoted ω ( G B ). We lso denote the clique of the lrgest size (MCS) (i.e, number of nodes) by ω( G B ). The MCW corresponds to the mximum number of vlues tht re live t ny point. The MCS corresponds to the mximum number of rrys tht re live t ny point. The chromtic number (C), denoted χ( G B ), for G is the minimum K such tht there is fesible lloction in definition. 5 χ( G Theorem 2: [4] -- B ) sup, 4 B ---------------- 6 ω ( G B ) where the supremum is tken over ll instnces B of the DSA problem. Wht this mens is tht there exist instnces where the chromtic number is t lest 5/4 times the MCW, but for ny instnce, the chromtic number is less thn 6 times the MCW. The upper bound in theorem 2 is not tight. Theorem 3: If ll of the widths re the sme, then ω ( G B ) = χ( G B ). 2 of 5 First fit (FF) is the lgorithm tht performs lloction for n enumerted instnce by ssigning the smllest fesible loction to ech intervl in order. It does not rellocte intervls, nd it does not consider intervls not yet ssigned. The pseudocode for this lgorithm is shown in figure. As cn be seen, building the intervl grph tkes O ( 2 ) time in the worst cse (ll intervls overlp with ech other), nd the first- Fit procedure tkes time O ( 2 log( ) ) in the worst cse if every intervl overlps with every other intervl. Theorem 4: FF on n enumerted instnce where ll the widths re the sme, ordered by strt times, is optiml. Proof: Theorem 3 nd 4 re clssic [3] nd follow esily from the observtion tht FF will ssign the i th intervl I loction M if nd only if there is some intervl live t every loction in { 0,, M }. But this mens tht the MCW must be t lest M + w() I.

Some nottion When ll the intervls hve the sme size, FF by strt times cn be mde to run in time O ( log( ) ), where is the number of intervls. The time is dominted by the sorting step; without the sorting, the running time is ctully O ( ). The pseudocode is shown in figure 2; notice tht we do not Procedure FirstFit(enumerted instnce I) G = buildintervlgrph(i) Vector llocte //llocte is n rry to contin the lloctions forech intervl i in I do llocte() i 0 //initil lloction t 0 neighborsalloctions {} forech neighbor j of i from G if (j ppers before i in I) neighborsalloctions neighborsalloctions { llocte() j } fi end for sort( neighborsalloctions) forech lloction neighborsalloctions if llocte() i conflicts with //width() = width of intervl with lloction llocte() i + width( ) fi end for end for Procedure buildintervlgrph(enumerted instnce I) sort I by strt times number of intervls in I // G is n djcency list representtion contining rows // nd list pointer t ech G(i) Grph G forech i in {,...,} j i + while (strt time of I(j) < end time of I(i)) Gi () Gi () {} j Gj () Gj () {} i j j + end while end for Fig. Pseudocode definition of the FirstFit heuristic. 3 of 5

need to crete the intervl grph, nd it does not mtter whether we ssign the smllest possible spce to n intervl (so the lgorithm is not techniclly first fit, but the ide is the sme). 3 Approximtion lgorithms Since the generl problem is P-complete, we hve to resort to heuristics. The best known pproximtion gurntee for DSA is 6 [8][4]. In this section, we will develop number of very simple pproximtion results tht do not necessrily improve on the bound of 6 for ll cses, but do so for certin, dtdependent cses. Procedure FirstFitStrt(instnce I) L rry of strt nd stop times from I // in the sorting below, if two elements of L hve the sme vlue, nd // one is stop time nd one is strt time, then the stop time comes // first in the sorted order L sort( L) vilbleloctions {} mxloc // for n element e of L, intervl( e) is the intervl in I with // strt time or stop time given by e forech element e of L if (e is strt time) if ( vilbleloctions ) loc pop n element from vilbleloctions else loc mxloc mxloc mxloc + fi ssign loc to intervl(e) fi if (e is stop time) dd loction ssigned to intervl( e) to vilbleloctions fi end for Fig 2. First fit by strt times on instnces where ll widths re the sme. 4 of 5

3. Seprte color (SC) The simplest pproximtion lgorithm is to sort the intervls by width into M sets, where M is the number of distinct widths in the instnce. We then pply FF by strt times on ech of these M instnces. Denote this lgorithm s seprte color (SC). Theorem 5: SC hs performnce gurntee of M. Proof: Let the M instnces be denoted B,, B M. Clerly, we hve ω ( G Bi ) ω ( G B ) for ech i. The totl mount of memory used by SC is ω ( G B ) + + ω ( G BM ). Hence, we get the gurntee of M. If there re fewer thn 6 distinct widths, then this bound bets the generl bound! 3.2 Seprte color with rounding (SC-R) Since SC would hve bound of 2 if there re only 2 distinct widths, we cn sk wht hppens if we round n instnce with M distinct widths to 2 widths. Clerly, the rounded instnce with 2 widths will hve n MCW bigger thn the originl instnce. Denoting the MCW of the originl, nd the MCW of the rounded instnce s c, c 2 respectively, the rounding will py off if 2c 2 < Mc. Suppose the instnce is sorted by widths S S S. Define R 2 MI Si MAX S i S ---- =, -----------,,, S S i + (EQ ) Theorem 6: SC-R hs performnce gurntee given by 2R 2. Proof: Let the distinct widths S i be in sorted order: S > S > > S. Let S be the S i tht minimizes the mximum in the expression for R 2 bove. The lgorithm SC-R then rounds the widths to S nd S ; these re then llocted using seprte coloring (SC). Let the MCW for the instnce be OPT = C mx = p S + + p S, for some 0 p i n i, where n i is the number of intervls hving width S i. After the rounding, we hve OPT' C' mx = ( p + + p )S + ( p + + + p )S m. This m my not be the mximum clique weight nymore in the rounded instnce; there could exist some other clique of greter weight. Let this clique hve vlue given s r i S + i = + r i S > p i S + i = + p i S. 5 of 5

otice tht we hve represented the weights tht multiply S nd S hs prtitions into nd nonnegtive integers respectively. However, these integers r i must stisfy weight. (ote tht the rounding does not chnge the topology of the intervl grph; clique in the rounded grph is lso clique in the originl grph nd vice vers. Hence the prtition r i rise nturlly when trnslted bck to the corresponding clique in the originl grph.) So the question is, how much bigger cn these be? Specificlly, we wnt to solve r i S i since the sum on the right is the mximum clique weight, nd the sum on the left represents clique r i p i S i r i S r + i S i = + subject to (EQ 2) Lemm : There is solution r' i to the bove with r j ' = 0 j {, + }. Proof: Suppose tht r i is ny solution. Let r j > 0 for some j, j +. Suppose j { 2,, }. Consider the new solution mx r i S i p i S i First we prove lemm; this will be used to prove the theorem. r r' r j S = j + --------, r' j = 0, r' k = r k k, k j S It stisfies the constrint: r r' i S i r S j S = + -------- j S + r k S k S k, k j r S + r j S j + r k S k k, k j = r i S i p i S i nd stisfies 6 of 5

r r' i r j S = + -------- j + r k S k, k j r i since S j S >. Since the solution r i mximized the objective function, the new solution r' i cnnot give bigger objective function; hence, there is equlity in the eqution bove: However, s shown, r' j = 0 r' i in the new solution. = r i. We cn continue in this mnner, ech time picking non-zero component nd constructing new solution tht zeros tht component out. The process ends when r' j = 0 for ll < j< +. Similrly, to zero out the rest of the r i, we cn pick n r j > 0 for some j { + 2,, }, nd construct the new solution: r r' + r j S = + + ------------ j, r' j = 0, r' k = r k k +, k j. S + Identicl rguments show tht this new solution stisfies the constrint nd lso mximizes the objective function. QED. becomes: Hence, we cn ssume tht the mximl solution hs r j = 0 for ll j, j +. Eqution 2 subject to (EQ 3) Let us consider the liner relxtion of the bove integer progrm. It s cler tht the mximl solution will meet the constrint through equlity since we could increse both the objective function nd the function in the constrint were it not the cse. Let mx{ r S + r + S m } r S + r + S + p i S i K = p i S i. 7 of 5

The solution to the liner relxtion of eqution 3 is the pir K r S r, --------------------. S + The objective function becomes Letting S f( r ) r S S m ------------ K S m = + ------------. S + S + S P S S = ------------ m, S + we see tht if P > 0, then the function f( r ) will be mximized when r is mximized. r is mximized if r + = 0, mking r = K S. Hence the mximum vlue of f( r ) is K S ----. S If P = 0, then f( r ) K S m = ------------ is the mximum vlue. S + Finlly, if P < 0, then the mximum vlue of f( r ) occurs t r = 0, nd the vlue is f( r ) K S m = ------------. In S + summry, we cn stte tht f( r ) K mx S S ---- m, ------------ S S + (EQ 4) It is cler tht introducing the integer constrint will only mke the integer solution pir less thn or equl to since ll fesible points hve to lie inside the polytope formed by the line r S + r + S + K, nd the xes, in the first qudrnt of R 2. Hence, the mximum vlue of the objective function will be less thn or equl to f( r ). K r S r, -------------------- S + The theorem is proven now by observing tht OPT' r S + r + S m fr ( ------------ ------------------------------------ ) ----------- mx S S ---- m =. OPT K K, ------------ S S + QED. In fct, we could even round to one width, S, nd llocte tht optimlly. Define S R = -----. (EQ 5) S 8 of 5

Theorem 7: Rounding to one width, nd llocting tht instnce optimlly gives performnce gurntee of R. Proof: The integer progrm tht we need to solve becomes: mx r i S Hence, the solution is simply subject to (EQ 6) r i S i By lemm, we cn gin ssume tht there is mximl solution to eqution 6 with r j = 0 for ll j >. p i S i p i S i r = i------------------- =, r j = 0, j >. S So QED. OPT' ------------ OPT = p i S i i------------------- = S S S p i S i ----- S. If we redefine SC-R to be the lgorithm tht tries both types of rounding, nd lso the seprte color, nd tkes the best, our pproximtion gurntee becomes MI( M, R, 2R 2 ). Exmple : Suppose we hve n instnce with 4 distinct widths: 2,3,6,9. This exmple comes from nonuniform filterbnk implementtion in SDF [6]. For this exmple, clerly becomes MI( 4, 4.5, 3) = 3. R 2 = 3 2, nd the gurntee ote tht this gurntee holds for ll instnces tht hve these widths, regrdless of strting nd ending times. 9 of 5

0 of 5 3.3 Sorted width coloring (SWC) In this lgorithm, following [4], we first round ech width to the nerest power of two, nd then sort in order of decresing width. This is done to mke the sorted width sequence divisible; i.e, ech width will be divisible by widths smller thn it. If the width sequence is divisible to begin with, the rounding will not be needed. ote tht the rounding procedure will increse the size of the MCW by two times t most. Denote the distinct widths by S S S. The lgorithm is to simply pply FF on this enumerted instnce. The dvntge of the rounding is the following observtion: Observtion : If n intervl of width S i, with strt nd end times b, e, is llocted by FF t loction L, it must be the cse tht for every loction { 0,, L }, there is some intervl I', with strt nd end times b', e', occupying tht loction with [ b, e] [ b', e' ]. Bsiclly, this mens tht there cnnot be ny loction intervl [ l, l 2 ] [ 0, L ] tht is free in the time intervl [ b, e]. Proof: (sketch) For contrdiction, suppose there is such loction intervl [ l, l 2 ] [ 0, L ]. When widths of type S re llocted, ny frgmenttion tht results must hve loction widths tht re multiples of S. When n intervl of width S i is llocted, intervls tht hve lredy been llocted re either of width S i, or of width S j, j > i. Since S i S j, j> i, ny frgmenttion tht hd occurred would hve loction width tht would be multiple of S i, mening S i could hve been llocted there. Since FF chooses the smllest fesible loction, this contrdicts the fct tht loction L ws chosen insted. For ech width S i, let IS ( i ) be the set of intervls hving width S i. Also, for n intervl I, let si ()ei, denote the strt nd end times respectively. ow suppose tht this enumerted sequence lso stisfies the following condition: for ny intervl I I( S i ), nd ny intervl J I( S j ), j i, either si () I J or ei () I J. In other words, J cnnot be proper subset of I. An enumerted instnce tht stisfies this condition is clled subset-free. Theorem 8: For subset-free enumerted instnces, FF hs performnce gurntee of 4 (2 if the sorted width sequence ws divisible to begin with i.e, did not require rounding to powers of 2). Proof: Consider n intervl I tht ws llocted t loction A() I. By observtion, we hve tht there is some intervl tht is live in [ bi ()ei, ] t every loction in [ 0, AI () ]. Since the enumerted instnce is subset-free, these intervls in [ 0, AI () ] overlp with I either t b() I, or overlp t ei (). The sum of the widths of the intervls tht overlp with I t b() I or ei () hs to be less thn the MCW. Hence, we must hve

AI () + wi () 2ω ( G B ). Since this is true for every intervl I, the overll gurntee is 2. If the rounding to powers of 2 ws done to mke the sequence divisible, then the gurntee becomes 4. 3.4 The cse where widths re nd X. Finlly, we consider instnces where the widths hve vlue or these, FF hs the following gurntee: X, ordered by strting times. For Theorem 9: For instnces with widths of or X, ordered by strting times, FF hs gurntee of 2 -- X Proof: (Sketch) Consider the instnce shown in figure 3. After little thought, it is evident tht this is the sort of instnce tht will cuse FF to behve in the worst possible wy. The long instnces of originte from the OPT region; OPT is not one big single intervl; it is simply the point t which the mximum clique weight is. The ide is tht in the worst possible cse, we could pick point where the lloction is frgmented, nd keep going up until we rech point where there is no frgmenttion. In the worst cse, the point of no frgmenttion could be s wide s the mximum clique weight. ow suppose tht there re n blocks of width X tht re plced s shown by FF. They re plced tht wy presumbly becuse ) the memory under the OPT region gets frgmented, nd the worst possible wy for this to occur would be for there to be ( OPT) X blocks of width, spced X prt, forcing ny block of X tht rrives lter to be plced outside the OPT region, nd b) becuse the region fter OPT till the point of plcement is lso filled. At the point where the lst block of X begins, there must be blocks filling up the nx region completely s otherwise the lst block would not hve been plced where it is. The spce outside of OPT cn- OPT x x x x x x x OPT/x Fig 3. A worst cse instnce for FF with only two sizes, nd X. of 5

not contin ny blocks of width since these cn be plced under the region; it cn only contin blocks of width X. Hence, we hve the following inequlity t the point where the lst block of width X begins: since OPT is the mximum clique weight, nd the clique weight nywhere else cnnot be greter. Since OPT + nx QED. So if is the lloction chieved by FF, it follows tht the pproximtion bound is ------------------------ OPT + nx 2 --. OPT X (recll tht even the cse where the widths re or 2 is P-complete), then the gurntee is.5, nd this bound is tight. It is interesting to note tht the two-size cse comes up frequently in mny DSP implementtions of imge processing systems where there might be bsic vector or mtrix dt type, nd bsic number dt type. X = 2 OPT ----------- + nx OPT X OPT 3.5 Worst cse behvior The interesting question of gurntee, if ny, of FF on enumerted instnces ordered by strting times is not known. We cn give the following exmple to show tht the gurntee cnnot be better thn 2.5; i.e, lower bound on the gurntee. It would lso be interesting if this lower bound could be improved OPT P 20 20 20 20 20 s= 60 80+65 65 > 2 3 3 60 60 60 Fig 4. Exmple to illustrte tht FF cn hve performnce tht is more thn twice s bd s the optimum vlue. 2 of 5

(presumbly by constructing n exmple tht cuses FF to chieve n lloction of worse rtio, sy 3, thn the one in this exmple). ote tht the exmple below cn be scled to chieve rtio of t most 2.5. By scling, we men replcing the width of size 20 by 20x, or giving different vlue for s (in this exmple, it hs vlue of 60) nd so on. This is becuse the inequlity, we hve the ine- tht the width indicted s OPT is the point of mximum overlp. Since P + s + 3s 5 qulity. So P s, nd the performnce rtio is given by ----------------------- --. P + s 2 3.6 Relted work hs to hold, since we re ssuming As lredy mentioned, the best known pproximtion results for DSA in generl hve gurntees of 6 [8][4]. There ppers to be close reltionship between the DSA problem, nd the problem of devising online coloring lgorithms for enumerted intervl grphs where ll intervls hve the sme width. The ltter problem cn be solved optimlly, s shown in section 2, if the intervls re ordered (enumerted) by strt times. However, n interesting question is how well n online lgorithm like FF cn do if the intervls re ordered rbitrrily. Defining AB ( ) to be the number of colors used by n lgorithm A to color the (non-weighted) instnce B, it hs been shown by Kiersted nd Slusrek tht 4.45 R FF 32, where R FF = sup B { FF( B) ω( G B )}. In [4], Kiersted gives nother online lgorithm clled OIC tht hs performnce gurntee of 3ω( G B ) 2. Slusrek lso develops nother online lgorithm clled SCC in [8] tht gives the sme performnce gurntee of 3ω( G B ) 2. Agin, these bounds re for coloring intervl grphs in n online mnner, where the intervls ll hve the sme width, nd re ordered rbitrrily. The pproximtion lgorithm of [4] for DSA is bsed on simultneous recursive formultion tht ctully colors n exponentilly bigger grph F thn the weighted intervl grph (enumerted by decresing width); the intervl grph F is obtined simply by considering n intervl v of width w( v) s wv ( ) intervls of width. Kiersted uses OIC to color F nd obtins n pproximtion gurntee of 6. While this formultion does not give polynomil time lgorithm, Kiersted sttes tht it cn be mde to run in polynomil time with creful implementtion. Slusrek uses similr pproch, bsing his lgorithm on SCC. P + s 2s The question of how bd FF is for DSA if prticulr orderings re considered, like ordering by widths, or rrivl times seems to be open. Another interesting open issue is whether non-online lgorithms cn do better thn online lgorithms like FF, OIC, nd SCC. As our experimentl results below show, FF performs very well on verge, so it would be difficult to bet it in prctice. OPT = P + s 3 of 5

Experimentl results 4 Experimentl results We tested FF on rndom instnces, ordered by rrivl times, durtions, nd widths. Rndom instnces were creted using three prmeters: number of intervls ( ), mximum stop time of ny intervl ( K), nd mximum width of ny intervl ( W). Given these prmeters, for ech intervl I, the stop time ei () is drwn uniformly from [, K], the integer strt time bi () is drwn uniformly from [, ei () ], nd the width wi () is drwn uniformly from [, W]. Three types of orderings were tested: sorting by strting times (FFA), sorting by durtions (FFD), nd sorting by widths (FFW). The mount of memory required ws compred to the MCW in ech cse. We denote prticulr combintion of prmeters by the tuple (, K, W). For ech combintion, the sttistics were collected for 500 rndom instnces with those prmeters. The tble below shows verge nd mximum rtios to the MCW, nd lso with ech other, for severl combintions of prmeters. As cn be seen, FF performs very well in prctice, nd it is never off by more thn 70% from the optimum. Sorting by durtions gives the best results, compred Tble. FirstFit behvior on rndom intervl instnces. (20,20, 20) (40,40, 40) (60,60, 60) (20,40, 60) (40,80, 20) (20,00,500) (80,500,000) (50,25, 00) FFA/MCW: MAX FFA/MCW: AVG FFD/MCW: MAX FFD/MCW: AVG FFW/MCW: MAX FFW/MCW: AVG FFA/FFD: MAX FFA/FFD: MI FFA/FFD: AVG.49.37.32.43.37.49.34.34.0..2..2.2.2..3.30.2.3.37.39.22.25.05.06.07.06.07.06.07.06.50.45.68.79.5.8.5.5.34.29.23.32.3.34.7.23 0.85 0.90 0.9 0.84 0.89 0.80 0.9 0.9.05.05.05.05.05.05.05.05 to sorting by strting times, nd widths. Sorting by widths gives the worst results. From these results, it is 4 of 5

Conclusion cler tht first fit on instnces sorted by durtion times gives lloctions tht re within 7% of the optimum vlue. In fct, this is pessimistic estimte since the C cn be greter thn the MCW, nd the (unknown) C is the optimum vlue. 5 Conclusion We hve presented number of simple pproximtion lgorithms for the P-complete problem of dynmic storge lloction. The best of these results chieves bound of 4 for subclss of DSA instnces clled subset-free instnces. We hve shown tht in prctice, the firstfit heuristic gives lloctions tht re within 7% of the optimum on verge. 6 References [] S. S. Bhttchryy, P. K. Murthy, E. A. Lee, Softwre Synthesis from Dtflow Grphs, Kluwer Acdemic Publishers, 996. [2] M. R. Grey, D. S. Johnson, Computers nd Intrctbility-A guide to the theory of P-completeness, Freemn, 979. [3] M. C. Golumbic, Algorithmic Grph Theory nd Perfect Grphs, Acdemic Press, 980. [4] H. A. Kiersted, Polynomil Time Approximtion Algorithm for Dynmic Storge Alloction, Discrete Mthemtics, Vol. 88, pp23-237, 99. [5] E. A. Lee, D. G. Messerschmitt, Sttic Scheduling of Synchronous Dtflow Progrms for Digitl Signl Processing, IEEE Trns. on Computers, Feb., 987. [6] P. K. Murthy, S. S. Bhttchryy, E. A. Lee, Joint Code nd Dt Minimiztion for Synchronous Dtflow Grphs, Journl on Forml methods in System Design, Vol., o., pp. 4-70, July 997. [7] P. K. Murthy, nd S. S. Bhttchryy, Shred Memory Implementtions of Synchronous Dtflow Specifictions using Lifetime Anlysis Techniques, Tech. Rpt. UMIACS-TR-99-32, University of Mrylnd Institute for Advnced Computer Studies, College Prk, MD 20742, http://www.cs.umd.edu/trs/trumics.html, 999. [8] M. Slusrek, A Coloring Algorithm for Intervl Grphs, Proceedings of the 4th Interntionl Symposium on Mthemticl Foundtions of Computer Science, LCS 379, pp47-480, 989. 5 of 5