Efficient Parameterized Algorithms for Data Packing

Size: px
Start display at page:

Download "Efficient Parameterized Algorithms for Data Packing"

Transcription

1 Effiient Prmeterized Algorithms for Dt Pking Krishnendu Chtterjee, Amir Kfshdr Gohrshdy, Nstrn Okti, Andres Pvloginnis To ite this version: Krishnendu Chtterjee, Amir Kfshdr Gohrshdy, Nstrn Okti, Andres Pvloginnis. Effiient Prmeterized Algorithms for Dt Pking. ACM Symposium on Priniples of Progrmming Lnguges (POPL 2019), Jn 2019, Lison, Portugl. <hl > HAL Id: hl Sumitted on 17 Ot 2018 HAL is multi-disiplinry open ess rhive for the deposit nd dissemintion of sientifi reserh douments, whether they re pulished or not. The douments my ome from tehing nd reserh institutions in Frne or rod, or from puli or privte reserh enters. L rhive ouverte pluridisiplinire HAL, est destinée u dépôt et à l diffusion de douments sientifiques de niveu reherhe, puliés ou non, émnnt des étlissements d enseignement et de reherhe frnçis ou étrngers, des lortoires pulis ou privés.

2 1 Effiient Prmeterized Algorithms for Dt Pking KRISHNENDU CHATTERJEE, IST Austri (Institute of Siene nd Tehnology Austri), Austri AMIR KAFSHDAR GOHARSHADY, IST Austri (Institute of Siene nd Tehnology Austri), Austri NASTARAN OKATI, Ferdowsi University of Mshhd, Irn ANDREAS PAVLOGIANNIS, Éole Polytehnique Fédérle de Lusnne (EPFL), Switzerlnd There is huge gp etween the speeds of modern hes nd min memories, nd therefore he misses ount for onsiderle loss of effiieny in progrms. The predominnt tehnique to ddress this issue hs een Dt Pking: dt elements tht re frequently essed within time proximity re pked into the sme he lok, therey minimizing esses to the min memory. We onsider the lgorithmi prolem of Dt Pking on two-level memory system. Given referene sequene R of esses to dt elements, the tsk is to prtition the elements into he loks suh tht the numer of he misses on R is minimized. The prolem is notoriously diffiult: it is NP-hrd even when the he hs size 1, nd is hrd to pproximte for ny he size lrger thn 4. Therefore, ll existing tehniques for Dt Pking re sed on heuristis nd lk theoretil gurntees. In this work, we present the first positive theoretil results for Dt Pking, long with new nd stronger negtive results. We onsider the prolem under the lens of the underlying ess hypergrphs, whih re hypergrphs of ffinities etween the dt elements, where the order of n ess hypergrph orresponds to the size of the ffinity group. We study the prolem prmeterized y the treewidth of ess hypergrphs, whih is stndrd notion in grph theory to mesure the loseness of grph to tree. Our min results re s follows: we show there is numer q depending on the he prmeters suh tht () if the ess hypergrph of order q hs onstnt treewidth, then there is liner-time lgorithm for Dt Pking; () the Dt Pking prolem remins NP-hrd even if the ess hypergrph of order q 1 hs onstnt treewidth. Thus, we estlish fine-grined dihotomy depending on single prmeter, nmely, the highest order mong ess hypegrphs tht hve onstnt treewidth; nd estlish the optiml vlue q of this prmeter. Finlly, we present n experimentl evlution of prototype implementtion of our lgorithm. Our results demonstrte tht, in prtie, ess hypergrphs of mny ommonly-used lgorithms hve smll treewidth. We ompre our pproh with severl stte-of-the-rt heuristi-sed lgorithms nd show tht our lgorithm leds to signifintly fewer he-misses. Additionl Key Words nd Phrses: ompilers, dt pking, he mngement, prmeterized lgorithms, dt lolity 1 INTRODUCTION We onsider the prolem of Dt Pking over two-level memory system onsisting of smll he nd lrge min memory. Given referene sequene of memory esses to dt elements, the gol is to orgnize the dt elements into loks in order to minimize he misses. Intuitively, putting ontemporneously-essed elements in the sme lok redues the numer of he misses, ut existing heuristi-sed results do not present ny theoretil gurntees. In this pper, we onsider this prolem from theoretil perspetive nd estlish its omplexity y presenting ext lgorithms nd stronger hrdness results. We lso omplement our theoretil results with n experimentl evlution. Authors ddresses: Krishnendu Chtterjee, IST Austri (Institute of Siene nd Tehnology Austri), Austri, krishnendu. htterjee@ist..t; Amir Kfshdr Gohrshdy, IST Austri (Institute of Siene nd Tehnology Austri), Austri, mir.gohrshdy@ist..t; Nstrn Okti, Ferdowsi University of Mshhd, Irn, nstrn.okti@mil.um..ir; Andres Pvloginnis, Éole Polytehnique Fédérle de Lusnne (EPFL), Switzerlnd, ndres.pvloginnis@epfl.h /2019/1-ART1 $

3 1:2 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis Che Mngement. Consider memory system with n ssoitive he nd min memory. Dt items re stored in the min memory nd orgnized into sets of smll size, whih re lled loks (or pges). All dt items hve the sme size nd ll loks n hold the sme numer of dt items. The he hs smll pity nd n hold few loks t ny given time. Whenever progrm needs to ess dt element, its orresponding lok must e present in the he efore the ess n hppen. Therefore, if the lok is not lredy in the he, it will e opied into the he from the min memory, potentilly y eviting nother lok. This opying proess is lled he miss, nd given the onsiderly slower speed of the min memory, he misses re very time-onsuming nd led to signifint overhed [Wulf nd MKee 1995]. Therefore, the prolem of he mngement, i.e., minimizing the numer of he misses, is of gret importne in ompilers nd operting systems. Che mngement n nturlly e divided in two prts [Clder et l. 1998]: (i) deiding on how to reple the loks in the he, i.e. whih lok to evit when the he is full nd miss ours nd (ii) deiding on the plement sheme of the dt items inside loks. These prolems re respetively lled Pging (or hoosing replement poliy) [Sletor nd Trjn 1985] nd Dt Pking [Lvee 2016; Thit 1982]. Pging (Replement Poliy). In pging, given dt plement sheme tht divides the dt items into loks nd so-lled referene sequene of esses to dt elements, the prolem is to hoose lok to e evited eh time he miss ours. The gol is to do this in wy tht minimizes the totl numer of he misses over the referene sequene [Pngiotou nd Souz 2006]. An lgorithm tht hooses the lok to e evited is lled replement poliy. Common replement poliies inlude FIFO, whih evits the oldest lok in the he, nd LRU, whih evits the lest reently used lok [Borodin et l. 1995; Lvee 2016]. Note tht oth FIFO nd LRU n lso e pplied in the online setting, i.e., when the lgorithm does not know the entire sequene in dvne nd n only oserve esses s they re mde. In the offline se, where the entire referene sequene is given in the eginning, the optiml replement poliy is to evit the lok whose first use is furthest in the future [Borodin et l. 1995]. This is lled the optiml offline poliy (OOP). We primrily fous on LRU s the replement poliy, euse it is the one tht is most ommonly used in prtie [Zhong et l. 2004]. Dt Pking. The other spet of he mngement, whih is the fous of this pper, is Dt Pking [Thit 1982]. Consider he with pity of m loks, where eh lok n store p dt items. Given referene sequene R of length N of esses to n distint dt items nd replement poliy, Dt Pking sks for the optiml plement of dt items into loks in order to minimize the numer of he misses. The prmeters m nd p re onsidered to e smll onstnts, nd the omplexity is studied wrt n nd N whih re lrge. Dt Pking is n extremely hrd prolem nd is known to e hrd to pproximte within ny non-trivil ftor, i.e., ny ftor signifintly less thn N, unless P=NP [Lvee 2016]. Relevne of Dt Pking in Progrmming Lnguges. Dt Pking is n importnt tehnique for performne optimiztion during ompiltion nd hs een widely studied y the progrmming lnguges ommunity (See [Clder et l. 1998; Ding nd Kennedy 1999; Lvee 2016; Petrnk nd Rwitz 2002; Zhng et l. 2006; Zhong et l. 2004]). The key relevne is two-fold: Limit studies: To test the performne of ompiler for dt plement, vrious inputs n e generted s enhmrks, nd the seline omprison of the performne n e performed ginst n optiml lgorithm [Petrnk nd Rwitz 2002]. Hene, n optiml dt pking lgorithm is neessry s the seline. This neessrily mens tht there is limit on the size of dt items nd lrge item should e roken into smller prts, eh of whih is onsidered distint dt item.

4 Effiient Prmeterized Algorithms for Dt Pking 1:3 Profiling: Progrms usully hve similr memory-ess ehviors over different inputs [Petrnk nd Rwitz 2002]. Hene, n effetive pproximte pproh for the online he mngement prolem is to onsider severl representtive inputs, then run n optiml offline lgorithm for profiling, nd then synthesize n nswer to the online prolem from optiml offline solutions [Clder et l. 1998; Petrnk nd Rwitz 2002]. Previous theoretil results on dt pking hve ll een negtive (hrdness) results. Heuristis nd Affinity. Given the hrdness of he mngement nd Dt Pking, the reserh in this re hs een mostly foused on developing heuristis. The intuition ehind mny of these heuristis is to exploit the underlying ffinities etween dt elements or loks y trying to ple elements tht re ommonly essed together in the sme lok or eviting the lok tht is less frequently essed in onjuntion with the rest of the loks in the he [Clder et l. 1998; Ding nd Kennedy 1999; Ding nd Kndemir 2014; Hn nd Tseng 2006; Zhong et l. 2004]. Some pprohes, suh s [Zhng et l. 2006], provide more sophistited heuristis nd onstrut hierrhy of ffinities. However, none of the existing heuristis provide ny theoretil gurntees. Aess Grphs. The onept of ess grph [Borodin et l. 1995] hs een introdued to model the ffinities etween dt elements or loks. An ess grph is simply grph in whih there is vertex orresponding to every dt item nd two verties re onneted y n edge if their respetive items pper onseutively in the referene sequene. Aess grphs might e weighted to model how mny times every pir of elements hve ppered onseutively. Similr strutures nd extensions of ess grphs to ess hypergrphs hve een introdued in [Lvee 2016; Thit 1982] where they re lled proximity (hyper)grphs. Moreover, most of the heuristi-sed pprohes lso onsider vrints of the notion of ess grphs. Che Misses vs Che Hits. We onsider the Dt Pking prolem, whih sks to minimize the he misses. Its nturl dul prolem is to mximize he hits. While the two prolems re equivlent in se of ext lgorithms, n pproximtion lgorithm for mximum he hits does not neessrily led to n pproximtion for minimum he misses [Lvee 2016]. For exmple, if in n ess sequene of length N we hve N N he hits nd N he misses, n pproximtion of N N hits n led to n ritrrily d pproximtion of N he misses. In prtie, he misses our muh less frequently thn he hits, ut ontriute signifintly to the overhed. Thus, pproximtion of he misses is more importnt thn pproximtion of he hits, nd the Dt Pking prolem is defined in terms of he misses. Previous Results on Che Mngement. To the est of our knowledge, ll theoretil results on minimizing he misses re negtive or hrdness results. We summrize some of the min results in this re. Given referene sequene R of length N nd he with pity of m loks, the following results hve een shown: (i) In [Petrnk nd Rwitz 2002], the uthors onsidered the prolem of Che-onsious Dt Plement, whih is somewht different formultion of he-miss minimiztion nd is intuitively similr nd relted to Dt Pking. In Che-onsious Dt Plement, he onsists of m lines, eh ple of holding up to p dt items t ny given time. The prolem is to ssign eh dt item d to he line l d. When the progrm wnts to ess the dt item d, it should e present in he line l d, otherwise he miss ours nd d is opied to l d, potentilly y eviting nother dt item from l d. Given n evition strtegy, the gol is to ssign dt items to he lines in mnner tht minimizes he misses. In [Petrnk nd Rwitz 2002] it ws shown tht the prolem is NP-hrd nd unless P=NP, it nnot even e pproximted within ftor of O(N 1 ϵ ).

5 1:4 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis (ii) In the sme pper, it ws shown tht ny lgorithm tht does not proess the entire sequene, ut insted relies on pirwise ffinity informtion on dt items, suh s the ess grph, nnot find solution within ftor of m 3 from the optiml, even with unounded time. (iii) In [Lvee 2016], the uthor showed tht Dt Pking is NP-hrd for ny he size nd hrd to pproximte within ftor of O(N 1 ϵ ) unless P = NP. Given these hrdness results, Dt Pking is usully hndled y heuristi-sed lgorithms tht do not provide ny theoretil gurntee. The only positive theoretil result dels with pproximting mximum he hits: (iv) In [Lvee 2016] it ws estlished tht the dul prolem of Dt Pking with the gol of mximizing he hits, insted of minimizing he misses, is pproximle within onstnt ftor. However, this does not pproximte the optiml numer of he misses. Exploiting Struturl Properties. Dt Pking is notoriously diffiult omputtionl prolem. In deling with this prolem, diretion tht hs not een pursued is to exploit struturl properties of the ess grphs. In mny ses, struturl properties of grphs help in otining effiient prmetrized lgorithms for omputtionlly-hrd prolems. Speifilly, well-studied struturl property in grph theory, whih is frequently pplied to omputtionlly-hrd grph prolems, is the notion of treewidth. We present this notion elow. Treewidth. Treewidth [Roertson nd Seymour 1984] is well-known nd extensively-studied prmeter in grph theory. The treewidth of grph is mesure of how tree-like the grph is. Speifilly, trees nd forests re the only grphs with treewidth of 1. The importne of treewidth in lgorithm design stems from the ft tht mny NP-hrd grph prolems (e.g., Vertex Cover nd Hmiltonin Cyle) n e solved in polynomil time if the input grphs hve onstnt treewidth nd moreover, mny other grph prolems n e solved in lower omplexity [Aoud et l. 2016; Bodlender 1997; Chtterjee et l. 2018; Cygn et l. 2015; Fomin et l. 2017; Roertson nd Seymour 1986]. The forml definition of treewidth is presented in the next setion. Treewidth in Progrm Anlysis. Mny importnt fmilies of grphs tht rise ommonly in lgorithm design re shown to hve onstnt treewidth, e.g., series-prllel nd outer-plnr grphs [Bodlender 1998]. Perhps the most importnt exmple in progrm nlysis is tht the ontrol-flow grphs of strutured goto-free progrms in mny lnguges suh s Psl nd C++ hve onstnt treewidth [Thorup 1998]. The sme result ws lso shown experimentlly for most Jv progrms [Gustedt et l. 2002]. This led to lgorithmi dvnes in verifition nd progrm nlysis [Chtterjee et l. 2015]. Moreover, treewidth hs lso een exploited to otin fster lgorithms for stti nlysis of reursive stte mhines [Chtterjee et l. 2015] nd onurrent systems [Chtterjee et l. 2016, 2017]. Treewidth in Dt Pking. In this work we show tht Dt Pking n e redued to grph prolem. In mny ses when grph rises from strutured proess, the treewidth of the grph is not very lrge [Bodlender 1998]. For Dt Pking, the ess grphs rise from strutured progrm essing dt from well-defined dt struture. Thus, it is nturl to study the prolem of Dt Pking in terms of the treewidth property of the rising grphs, s we do in this work. Our Contriutions. Our ontriutions inlude () polynomil lgorithms for Dt Pking in onstnt treewidth ess (hyper)grphs, () stronger hrdness results, nd () experimentl results demonstrting tht our pproh leds to onsiderly fewer he misses in omprison with previously-known heuristi-sed pprohes. Conretely, onsider tht the he hs size m, every lok n hold p dt items nd the referene sequene is of length N with n distint items. We onsider the ess hypergrph of order q, where eh vertex of the grph is dt item, nd n edge onnets set of q distint dt items if they pper ontiguously in the referene sequene. We show tht the Dt Pking prolem n e redued to grph prtitioning prolem of the

6 Effiient Prmeterized Algorithms for Dt Pking 1:5 q Liner-time Theorem Liner-time Theorem 3.1 NP-hrd Theorem (m 1)p + 2 NP-hrd Theorem (m 5)p + 1 Hrd to Approximte Theorem 4.3 Hrd to Approximte Theorem m Fig. 1. The omplexity of Dt Pking for p 3. Here m is the he size nd q is the highest order for whih the ess hypergrph hs onstnt treewidth. For forml definition of order see Setion 2.1. Theorem 2.1 ws estlished in [Lvee 2016]. The rest of the piture is filled y this pper. Our results re shown in old. ess (hyper)grph nd we study whether the onstnt treewidth property n e exploited for polynomil-time lgorithms. Our min results, ssuming onstnt m nd p, re s follows: (1) Results on Aess Grphs. We first onsider q = 2. Note tht order-2 ess hypergrphs re silly ess grphs. We estlish the following results: Liner-time lgorithm. We present liner-time lgorithm for Dt Pking when the ess grph is of onstnt treewidth nd m = 1 (Theorem 3.1). Hrdness of the ext prolem. The Dt Pking prolem remins NP-hrd for m 2 nd p 3 even if the underlying ess grph is tree (whih hs treewidth 1) (Theorem 3.2). Hrdness of pproximtion. Unless P=NP, for ny m 6,p 2 nd ny onstnt ϵ > 0, the Dt Pking prolem is hrd to pproximte within ftor of O(N 1 ϵ ) even if the underlying ess grph is tree (Theorem 3.2). (2) Results on Aess Hypergrphs. We define ess hypergrphs of higher orders nd onsider their treewidth. Let q = (m 1)p + 2. Note tht q depends only on the he prmeters, nd not on n or N. We onsider the ess hypergrph of order q. Intuitively, every edge of this ess hypergrph ontins ll the neessry historil he dt for determining whether miss ours t orresponding memory ess. Formlly, we estlish the following results: Liner-time lgorithm. We present liner-time lgorithm for Dt Pking when the ess hypergrph of order q hs onstnt treewidth (Theorem 4.1). Hrdness of the ext prolem. For m 2 nd p 3, the Dt Pking prolem remins NP-hrd even if the ess hypergrph of order q 1 hs onstnt treewidth (Theorem 4.2). Hrdness of pproximtion. Unless P=NP, for m 6 nd p 2 nd ny onstnt ϵ > 0, the Dt Pking prolem is hrd to pproximte within ftor of O(N 1 ϵ ) even if the ess hypergrph of order q 4p 1 hs onstnt treewidth (Theorem 4.3). Note tht while onstnt treewidth hs een exploited to otin polynomil-time lgorithms for NP-omplete grph prolems suh s Vertex Cover nd Hmiltonin Cyle, we show tht for Dt Pking the onstnt treewidth property does not lwys help, nd the prolem remins hrd even when the ess hypergrph of order q 1 hs onstnt treewidth. Our hrdness result nd liner-time lgorithm present shrp oundry (or fine-grined dihotomy) tht shows when the treewidth n e exploited. Conretely, the hrdness of

7 1:6 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis the Dt Pking prolem n e ptured y single prmeter, nmely, the highest order mongst ess hypergrphs tht hve onstnt treewidth. We estlish the optiml vlue q of this prmeter whih is the neessry nd suffiient ondition for existene of effiient prmeterized lgorithms tht exploit treewidth. (3) Experimentl results. We present n experimentl evlution of prototype implementtion of our lgorithm on vriety of enhmrks from liner lger, sorting lgorithms, dynmi progrmming, reursive lgorithms, string mthing, omputtionl geometry nd lgorithms on tree dt-strutures. Our results show tht the ess hypergrphs of most of the enhmrks hve smll treewidth. We ompre our pproh with severl stte-of-thert heuristi-sed lgorithms. The experimentl results show tht on verge our optiml lgorithms otin 15-30% imporvement over the previous heuristi-sed pprohes. Novelty nd Signifine. In this pper, we define novel nd rih struturl property of progrms, i.e. ess hypergrphs nd their treewidth, nd show tht it n e exploited to otin fster lgorithms for Dt Pking. We present the first positive theoretil results for Dt Pking, i.e., for he-miss minimiztion. We lso enrih the omplexity lndspe s shown in Figure 1. Only the results of Theorem 2.1 were known efore, nd ll other results (whih re shown in old) re estlished in the present work. 2 PRELIMINARIES 2.1 Dt Pking In this setion, we define the prolem of dt pking nd fix our nottion. We lso present severl previously-known results. The prolem ws first studied in [Thit 1982]. Here, we present n dpttion of its definition s formlized in [Lvee 2016]. Nottion. We use Z to denote the set of integers nd N to denote the set of positive integers. Let G = (V, E) e (hyper)grph, nd X V, then we denote y G[X], the indued sugrph of G over X, i.e. G[X ] = (X, {e E e X }). Given two (hyper)grphs G 1 = (V 1, E 1 ) nd G 2 = (V 2, E 2 ), we define their union nd intersetion in the nturl wy, i.e. G 1 G 2 = (V 1 V 2, E 1 E 2 ) nd G 1 G 2 = (V 1 V 2, E 1 E 2 ). If F is fmily of sets, we write F (resp. F ) to denote A F A (resp. A F A). Given two funtions f,д : A Z, equlity nd summtion re defined in pointwise mnner, i.e. f д A; f () = д() nd for ny A, we hve (f + д)() = f () + д(). Given funtion f : A B nd suset A A, we use f A to denote the restrition of f to A. This restrition is funtion of the form f A : A B tht grees with f on every point in A. For set X, we write P(X ) to denote the power set of X, i.e., the set of ll susets of X. Dt Plement Shemes. Given set D of size n of dt items nd positive integer p, dt plement sheme σ is prtitioning of D into loks of size t most p. We ll p the pking ftor. It is often useful to think of σ s n equivlene reltion on D whose equivlene lsses re the loks. Hene, following the usul nottion, we write xσy to denote tht x nd y re in the sme lok, [x] σ to denote the lok of σ tht ontins the dt element x nd D/σ to denote the set of loks or equivlene lsses of σ. Replement Poliies. Given set D of n dt items, he of size m, dt plement sheme σ, nd sequene R D N of esses to dt items, replement poliy is funtion tht deides whih lok must e evited from the he t eh time. Formlly, replement poliy is funtion π : {0, 1, 2,..., N } P(D/σ) tht ssigns to eh time point i, the set of loks tht re present in the he right fter the ess R[i]. Any suh poliy must stisfy the following: π(0) =, i.e. the he must e empty t the eginning; For ll 1 i N, π(i) m, i.e. there re t most m loks in the he t eh time;

8 Effiient Prmeterized Algorithms for Dt Pking 1:7 For ll 1 i N, π(i) \ π(i 1) 1 nd π(i 1) \ π(i) 1, i.e. t most one lok n e dded to the he nd t most one lok n e evited t eh step; For ll 1 i N, R[i] π(i), i.e. the lok ontining n ess R[i] must e in the he right fter tht ess. Remrk 2.1. Note tht the replement poliy only mtters when the he hs size of t lest 2. When the he hs unit size, there is lwys unique hoie for the lok tht must e evited. Che Misses. Given dt plement sheme σ nd replement poliy π s ove, the numer of he misses used y σ nd π over R is defined s the numer of times new lok is loded into the he. Formlly, misses(σ, π) = {i 1 i N, π(i) \ π(i 1) }. The LRU Poliy. Due to its populrity, we ssume throughout this pper tht the replement poliy is LRU, i.e. the Lest-Reently-Used lok is lwys evited from the he. However, most of our results rry over to First-In-First-Out (FIFO) nd the Optiml Offline Poliy (OOP), s well. Rell tht FIFO evits the oldest lok in the he nd OOP evits the lok tht is going to e used furthest in the future. The Dt Pking Optimiztion Prolem. Consider memory susystem tht onsists of n distint dt elements nd fully-ssoitive he with pity of m loks nd pking ftor of p. Given sequene R of length N of referenes to dt elements, the Dt Pking prolem sks for dt plement sheme σ tht minimizes the numer of he misses inurred y the referene sequene R, using LRU s the replement poliy. We denote n instne of the Dt Pking prolem y I = (n,m,p, R). Prmeters. In the sequel, we onsider the prmeters m nd p to e smll onstnts nd try to find polynomil lgorithms in terms of N nd n. We now define the onepts of ess grph nd ess hypergrph. Vrious similr notions hve een defined in the pst, nd re sometimes lled ffinity grphs or proximity grphs. These hypergrphs will lter serve s sis for reduing the Dt Pking prolem to grph prolem. Aess Grph. Given sequene R of length N of esses to dt elements from set D of size n, the ess grph of R is simple grph G R = (V, E) in whih V onsists of n verties, eh orresponding to one of the dt elements in D, nd there is n edge etween two distint verties iff their orresponding dt elements pper onseutively somewhere in R. More formlly, {u, v} E iff u v nd there exists n index i, suh tht {R[i], R[i + 1]} = {u,v}. Intuitively, one n think of the grph G R s the struture on dt elements tht is respeted y the ess sequene R, in the sense tht R n only go from vertex in G R to one of its neighors. Moreover, G R is the sprsest grph over whih R is (non-simple) pth. Exmple 2.1. Consider the ess sequene R =<,,,,,, d,, d, e,,, f >. There re 6 dt elements in this sequene nd its ess grph G R is shown in Figure 2. Note tht R is pth on this grph nd every edge ppers somewhere long R, hene no sugrph of G R hs the sme property. f d e Fig. 2. The ess grph G R of R =<,,,,,,d,,d, e,,, f >

9 1:8 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis We now extend the onept of ess grphs to higher order ffinity reltions etween dt items, resulting in ess hypergrphs. Hypergrphs nd Ordered Hypergrphs. A hypergrph G = (V, E) onsists of setv of verties nd multiset E of hyperedges. Eh hyperedge e E is in turn suset of the verties of G. An ordered hypergrph G = (V, E) onsists of set V of verties nd set E of ordered hyperedges. Eh ordered hyperedge e E is sequene of distint verties of G, i.e. hyperedge together with n order on its verties. Intuitively, hypergrphs re nturl extensions of grphs, where eh edge n onnet more thn two verties. Given hypergrph G, its priml grph G p is grph on the sme set V of verties, where two verties u nd v re onneted y n edge iff there exists hyperedge e E ontining oth u nd v. We shll simply refer to hypergrphs nd hyperedges s grphs nd edges when there is no fer of onfusion. Aess Hypergrph. Given nturl numer q nd n ess sequene R s ove, the ess hypergrph G q R = (V, E) is hypergrph defined s follows: There re n verties in V, eh orresponding to one dt element; For eh dt ess R[i], there is orresponding hyperedge e i in E. The hyperedge e i onsists of R[i] nd the q 1 distint dt elements tht re essed right efore R[i]. If there re less thn q 1 suh elements, e i will inlude ll of them. Conretely, e i is defined s follows: e i := {R[j] j i {R[j], R[j + 1],..., R[i]} q}. We ll q the order of the ess hypergrph. It is esy to verify tht removing repeted edges from the ess hypergrph GR 2 leds to the ess grph G R. Exmple 2.2. Consider the ess sequene R =<,,,,,,d,,d, e,,, f >. Letting q = 3, the orresponding ess hypergrph GR 3 of order 3 onsists of the following hyperedges (sometimes there re multiple opies of the sme hyperedge, s shown elow. We onsider these to e distint hyperedges): {}, {,}, {,,} 4, {,,d} 3, {,d, e}, {,d, e}, {,, e}, {,, f }. Figure 3 shows the segments of the sequene tht orrespond to edges in GR 3.,,,,,, d,, d, e,,, f Fig. 3. Segments of R orresponding to edges in the hypergrph G 3 R Ordered Aess Hypergrphs. Given n ess sequene R s ove, the ordered ess hypergrph Ĝ q R is defined similrly to Gq R, exept tht eh hyperedge is ordered in the nturl wy, i.e. in the order of pperne of its orresponding dt elements in R. Formlly, for every ess R[i], there is orresponding ordered hyperedge e i in Ĝ q R. The ordered hyperedge e i is sequene < v 1,v 2,...,v l > of verties of Ĝ q R suh tht v l = R[i], v l 1 is the first distint dt element essed efore R[i], v l 2 is the seond distint element, et. Moreover, l is the mximum etween q nd the numer of distint elements essed up until R[i]. Exmple 2.3. Consider the ess sequene R =<,,,,,,d,,d, e,,, f >. The ess hypergrph GR 3 ws shown in Exmple 2.2. We now onstrut the ordered hyperedges of Ĝ3 R. Intuitively, we strt from ny ess R[i] in R nd go k until we see 3 different dt elements. These dt elements will form the ordered hyperedge e i orresponding to R[i]. This is illustrted in Figure 4. Note tht the elements in n ordered hyperedge e i re ordered y their lst ess time efore or t R[i], e.g. see the hyeperedge <, d, > in Figure 4.

10 Effiient Prmeterized Algorithms for Dt Pking 1:9 R: <,, > <,, > <,, > <> <, > <,, > <,, f> <e,, > <d, e, > <, d, e>,,,,,, d,, d, e,,, f <,, d> <, d, > <,, d> Fig. 4. Ordered Hyperedges of G nd the segments in R to whih they orrespond 2.2 Tree Deompositions nd Treewidth In prmeterized omplexity, treewidth is one of the most widely-used prmeters for grph prolems. It is mesure of how tree-like given grph is. In this setion, we provide quik overview of tree deompositions nd treewidth. For n in-depth tretment see [Cygn et l. 2015]. Tree Deomposition. Given (hyper)grph G = (V, E), tree deomposition of G is pir (T, {X t t T }) where T is tree nd eh node t of T is ssoited with suset X t V of verties of G, suh tht the following onditions re met: (i) Every vertex ppers in some X t, i.e. t T X t = V ; (ii) Every (hyper)edge ppers in some X t, i.e. e E X t e X t ; (iii) For every vertex v V, the set T v = {t T v X t } of ll nodes of the tree T tht ontin v in their orresponding X t, forms onneted sutree of T. It is evident from the definition tht (T, {X t }) is tree deomposition of hypergrph G iff it is tree deomposition of its priml grph G p. To void onfusion, we reserve the word vertex for verties of G nd use the word node for verties of T. Moreover, we ll eh X t g. Treewidth. The width of tree deomposition (T, {X t }) is the size of its lrgest g minus 1, i.e. min t T X t - 1. The treewidth of grph G is the smllest width mong ll tree deompositions of G nd is denoted tw(g). Exmple 2.4. Figure 5 shows the grph G R (s in Figure 2) nd tree deomposition of G R. This tree deomposition hs width of 2 nd is n optiml tree deomposition. Hene, the treewidth of G R is 2. f {,,} d {,,d} {, f } e {,d, e} Fig. 5. A grph G R (left) nd one of its optiml tree deompositions (T, {X t }) (right). To simplify the lgorithms tht exploit tree deompositions, we now define the notions of leling nd nie tree deomposition. Nie Tree Deompositions. A nie tree deomposition [Cygn et l. 2015] of (hyper)grph G is tree deomposition (T, {X t }) in whih speifi node is designted s the root nd every node t T is leled y sugrph G t of G, suh tht the following rules re oeyed: (1) If t is lef in T, then X t = nd G t = (, ). (2) Otherwise, t stisfies one of the following ses: Join Node. The node t hs two hildren, t 1 nd t 2, X t = X t1 = X t2 nd G t = G t1 G t2.

11 1:10 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis Introdue Vertex Node. The node t hs single hild t 1 nd X t = X t1 {v} for some vertex v X t1. In this se, we sy tht t introdues v. Moreover, G t = G t1 {v}, i.e. G t is defined s the grph resulting from dding v s n isolted vertex to G t1. Introdue Edge Node. Similr to the previous se, t hs single hild t 1. This time, X t = X t1, ut G t is defined s the grph resulting from dding new edge e to G t1. All verties of e must e present in X t. We sy tht t introdues e. Forget Vertex Node. The node t hs single hild t 1 nd X t = X t1 \ {v} for some vertex v X t1. We sy tht t forgets v. Moreover, G t = G t1. (3) Eh edge is introdued extly one. Intuitively, the lel grph G t is the sugrph of G onsisting of ll the verties nd edges tht re introdued in the sutree of T rooted t t. Remrk 2.2. Note tht in our (ordered) hypergrphs in this pper, we might hve multiple opies of the sme (ordered) hyperedge. We tret these s distint edges nd require tht eh of them e introdued seprtely in nie tree deompositions. Remrk 2.3. The notion of lel grphs G t is solely defined for theoretil purposes nd used in our proofs of orretness. In prtie, our implementtion voids the overhed of onstruting G t s. Exmple 2.5. Figure 6 shows nie tree deomposition of the grph G of Figure 2. In eh node t of the tree, its lel sugrph G t is illustrted nd the verties of the g X t re shown in red. Intuitively, nie tree deomposition onstruts the grph in smll inrements nd the g X t ontins the verties tht n prtiipte in the inrementl hnge. Fig. 6. A nie tree deomposition of the grph in Figure 2. The leftmost node is the root. The grph G t is illustrted in eh node t. The verties of the gs X t re shown in red. 2.3 Existing Results We now formlly present known results regrding Dt Pking nd Tree Deompositions tht will e used in the sequel. The Hrdness of Dt Pking. Note tht we re onsidering the prolem of minimizing he misses, not tht of mximizing he hits. While the two prolems re equivlent in terms of ext lgorithms, pproximting the miniml numer of he misses is muh hrder thn pproximting the mximl numer of he hits. The ltter prolem dmits polynomil-time onstnt-ftor pproximtion [Lvee 2016]. In ontrst, the following theorem shows tht the former prolem is hrd to even pproximte. Theorem 2.1 ([Lvee 2016]). Assuming either LRU, FIFO or OOP s the replement poliy, we hve the following hrdness results: For ny m nd ny p 3, Dt Pking is NP-hrd. Unless P=NP, for ny m 5, p 2 nd ny onstnt ϵ > 0, there is no polynomil lgorithm tht n pproximte the Dt Pking prolem within ftor of O(N 1 ϵ ).

12 Effiient Prmeterized Algorithms for Dt Pking 1:11 We now turn to tree deompositions. Wht mkes tree deompositions very useful tool is the ft tht one n perform ottom-up dynmi progrmming on them in mnner similr to trees. This is due to n property of tree deompositions, lled the seprtion lemm. Seprtors. Given (hyper)grph G = (V, E), nd two sets of verties A, B V, we sy tht the pir (A, B) is seprtion of G if A B = V nd no (hyper)edge in E ontins verties of oth A \ B nd B \ A. We ll A B the seprtor orresponding to the seprtion (A, B) nd the order of the seprtion (A, B) is the size of its seprtor A B. Lemm 2.1 (Seprtion Lemm, [Bodlender 1988; Cygn et l. 2015]). Let (T, {X t }) e tree deomposition of G, where G is grph or hypergrph, nd let {,} e n edge of T. By removing the edge {,}, T reks into two onneted omponents T nd T, respetively ontining nd. Let A = t T X t nd B = t T X t. Then (A, B) is seprtion of G with seprtor X X. In our lgorithms in the rest of this pper, we ssume tht whenever (hyper)grph G of onstnt treewidth ppers s n input to n lgorithm, the input lso ontins n optiml nie tree deomposition (T, {X t }) of G. This is justified y the following two lemms tht show one n otin (T, {X t }) from G in liner time. Lemm 2.2 ([Bodlender 1996] ). There is n lgorithm tht given (hyper)grph G = (V, E) nd onstnt k, deides in liner time whether G hs treewidth t most k nd if so, produes tree deomposition of G with optiml width nd O(k V ) nodes. Lemm 2.3 ([Cygn et l. 2015]). There is liner-time lgorithm tht given grph G = (V, E) nd tree deomposition (T, {X t }) of G of width k with O(k V ) nodes, produes nie tree deomposition (T, {X t }) of G with the sme width k nd O(k V ) nodes. This lgorithm n lso e pplied if G is hypergrph, in whih se the output tree deomposition (T, {X t }) will hve width k nd O(k V + E ) nodes. 3 DATA PACKING ON CONSTANT-TREEWIDTH ACCESS GRAPHS We now onsider the prolem of Dt Pking when prmeterized y the treewidth of the underlying ess grph. In Setion 3.1, we provide liner-time lgorithm when m = 1 nd the ess grph hs onstnt treewidth. Note tht this prolem is NP-hrd for generl ess grphs, s demonstrted y Theorem 2.1. Then, in Setion 3.2 we show tht for m 2 the prolem remins NP-hrd nd hrd-to-pproximte even when the ess grph is tree, i.e. hs treewidth Algorithm for m = 1 nd Constnt-treewidth Aess Grph We re given Dt Pking instne I = (n, 1,p, R), its ess grph G R nd nie tree deomposition (T, X t ) of the ess grph with width k nd O(n k) nodes. We first redue the prolem of Dt Pking to grph prolem over G R nd then provide liner-time fixed-prmeter lgorithm for solving the grph prolem. We strt y defining the minimum-weight p-prtitioning prolem. p-prtitionings. Given n integer p > 0 nd grph G = (V, E), p-prtitioning of G is prtitioning ψ of the set V of verties suh tht eh prtition set hs size of t most p. In other words, p-prtitioning of G is dt plement sheme where the verties of G re the dt elements nd p is the pking ftor. Cross Edges. Given p-prtitioning ψ of the grph G = (V, E), n edge e = {u,v} E is lled ross edge if its two endpoints re in different prtition sets, i.e. if [u] ψ [v] ψ. Minimum-weight p-prtitioning. Given simple grph G = (V, E), weight funtion w : E N nd positive integer p, the minimum-weight p-prtitioning prolem sks for p-prtitioning of G in whih the totl weight of ross edges is minimized.

13 1:12 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis 2 1 f d 1 e Fig. 7. An optiml 2-prtitioning Redution of Dt Pking to Minimum-weight p-prtitioning. We now redue the Dt Pking prolem to minimum-weight p-prtitioning. Given n instne I = (n, 1, p, R) of Dt Pking, we onsider the ess grph G R = (V, E) nd define the weight funtion w R : E N s w R ({u,v}) := {i {R[i], R[i + 1]} = {u,v}}. Informlly, the weight of n edge is the numer of times its two endpoints hve ppered onseutively in R. The redution is now omplete. Lemm 3.1. The optiml numer of he misses in Dt Pking instne I = (n, 1,p, R) is 1 plus the totl weight of ross edges in minimum-weight p-prtitioning of G R with weight funtion w R. Proof. Every p-prtitioning ψ of G R is dt plement sheme for I nd vie vers. Given tht m = 1, the replement poliy does not mtter (Remrk 2.1) nd he miss ours eh time R esses new lok. If we onsider R s pth on G R, he miss ours t the very eginning nd then eh time this pth goes from one equivlene lss of ψ to nother. Therefore, the numer of he misses of ψ is 1 plus the totl weight of ross edges in ψ. Exmple 3.1. Consider the ess sequene R =<,,,,,,d,,d, e,,, f > of Exmple 2.1 nd the Dt Pking instne I = (6, 1, 2, R), i.e. eh lok n store up to 2 dt elements. Figure 7 shows the grph G R in whih every edge is weighted y the numer of times it is trversed in R. An optiml 2-prtitioning of G R is shown in whih verties of the sme olor re in the sme prtition. The totl weight of ross edges in this prtitioning is 7. The orresponding dt plement sheme is {{,}, {,d}, {e}, {f }} whih leds to 8 he misses on R. The he misses re underlined. We will provide n lgorithm for solving the Minimum-weight p-prtitioning prolem on grph G using n optiml nie tree deomposition of G. Our lgorithm employs ottom-up dynmi progrmming tehnique. We first need severl si onepts to define the lgorithm. Sttes over Set of Verties. Given grph G = (V, E), nturl numer p nd suset A V of verties, stte over A is pir s = (φ, sz) suh tht (i) φ is prtitioning of A in whih every equivlene lss hs size of t most p, nd (ii) sz is size enlrgement funtion sz : A/φ {0,...,p 1} tht mps eh equivlene lss [v] φ to numer whih is t most p [v] φ. Intuitively, the ide is to tke A to e one of the gs in the tree deomposition nd lter extend stte over A to p-prtitioning of G y dding the verties in V \ A. So, stte over A prtitions the verties of A into sets of size t most p nd for eh prtition [v] φ fixes the ext numer sz([v] φ ) of verties from V \ A tht should e dded to [v] φ. We denote the set of ll sttes over A y S A,p or simply S A when p is ler from the ontext. Reliztion. We sy tht p-prtitioning ψ relizes the stte s = (φ, sz) over A, if (i) the restrition ofψ to A is equl to φ, i.e.ψ A = φ nd (ii) for ll verties v A, sz([v] φ ) = [v] ψ [v] φ. Intuitively, ψ relizes s if (i) ψ prtitions the verties in A in the sme mnner s φ nd (ii) if prtition [v] ψ of ψ intersets A, then [v] ψ ontins s mny verties from outside of A s fixed y sz. Exmple 3.2. Figure 8 shows ll 14 possile sttes over the set A = {,,} of verties with p = 2. In eh se, eh row denotes one prtition set nd hene the order of rows nd the order of squres in row does not mtter. Empty squres orrespond to the possiility of extension of the set, s defined

14 Effiient Prmeterized Algorithms for Dt Pking 1:13 Fig. 8. All possile sttes over A = {,,} with p = 2 d e d e f f Fig. 9. Two omptile sttes over A = {,,} nd A = {d, e, f } y sz. The optiml 2-prtitioning ψ presented in Figure 7 relizes the highlighted stte in Figure 8, euse ψ puts nd in the sme prtition nd puts in prtition of size 2, whose other memer, d, omes from outside the set {,,}. Comptiility. We sy tht two sttes s nd s, respetively over the sets A nd A, re omptile if there exists p-prtitioning tht relizes oth of them. We write s s to show omptiility. Exmple 3.3. Intuitively, two sttes re omptile if they n fit into eh other. Figure 9 shows the sttes relized y the 2-prtitioning of Figure 7 ove over the sets A = {,,} nd A = {d, e, f } nd how they n e fitted together to rete the entire 2-prtitioning. Algorithm 1. We re now redy to desrie our lgorithm in detil. Given grph G, weight funtion w nd n optiml nie tree deomposition T of G, our lgorithm performs ottom-up dynmi progrmming on T. This is roken into three steps. Step 0: Initiliztion. We define severl vriles t eh node of our tree T. These vriles re ment to e omputed in ottom-up mnner. Conretely, for every t T nd every stte s over the g X t, we define vrile dp[t, s] nd initilize it to +. Invrint. Formlly, our lgorithm stisfies the following invrint for every dp vrile right fter the end of its omputtion: dp[t, s] = The minimum totl weight of ross edges over ll p-prtitionings of G t tht relize s. Intuitively, we re onsidering the sttes over the g X t nd extending them y dding verties tht were introdued in the sutree of t in T. Step 1: Computtion of dp. The lgorithm strts from the ottom of the tree T nd omputes the dp vriles ottom up, i.e. with n order suh tht for every node t T the dp vriles t its hildren re omputed efore the dp vriles of t. For every node t T nd stte s = (φ, sz) S Xt, we show how dp[t, s] is omputed sed on the type of the node t: (1.1) if t is Lef: dp[t, s] = 0; (1.2) if t is Join node with hildren t 1 nd t 2 : dp[t, s] = min dp[t 1, (φ, sz 1 )] + dp[t 2, (φ, sz 2 )]; sz 1 +sz 2 sz

15 1:14 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis Note tht the summtion nd equlity ove re pointwise. (1.3) if t is n Introdue Vertex node, introduing v, with single hild t 1 : dp[t, s] = dp[t 1, (φ Xt1, sz Xt1 )]; (1.4) if t is n Introdue Edge node, introduing e, with single hild t 1 : dp[t, s] = dp[t 1, s] + w(e, φ), where w(e, φ) is equl to w(e) if e is ross edge in φ nd zero otherwise; (1.5) if t is Forget Vertex node, forgetting v, with single hild t 1 : dp[t, s] = Rell tht denotes omptiility. min dp[t 1, s ]. s S X t s s 1 Step 2: Computing the Output. The lgorithm omputes the output, i.e. the optiml weight of p-prtitioning, using the vlues stored t dp vriles. If r is the root node of T, then the lgorithm outputs the following vlue: min s SXr dp[r, s]. This onludes Algorithm 1. We now prove the orretness of our lgorithm. Lemm 3.2. Algorithm 1 orretly omputes the totl weight of ross edges in minimum-weight p-prtitioning. Proof. We prove this lemm in two steps. First, we show tht the invrint defined ove holds fter omputing dp[t, s] ssuming tht it ws stisfied for ll dp vriles in the hildren of t (Corretness of Step 1). Then, ssuming tht the invrint holds for dp vriles t the root, we show tht the output is the totl weight of n optiml p-prtitioning (Corretness of Step 2). Intuitively, the invrint sys tht if we only onsider the grph G t, i.e. the prt of G tht ws introdued in the sutree of T rooted t t, nd those p-prtitionings of G t tht relize the stte s, then dp[t, s] holds the minimum totl weight of ross edges mong these p-prtitionings. Corretness of Step 1. As in the lgorithm, we rek this prt into severl ses: (1.1) Computtions t Leves. The node t is lef in T, hene G t is the empty grph nd X t is the empty set. Therefore, S Xt ontins single trivil stte s nd we hve dp[t, s ] = 0 euse the totl weight of ross edges in n empty grph is zero. (1.2) Computtions t Join Nodes. The node t is join node with hildren t 1 nd t 2. We wnt to ompute dp[t, s] where s = (φ, sz). Therefore, we only onsider those p-prtitionings tht relize s. Given tht X t = X t1 = X t2, φ imposes itself on oth X t1 nd X t2. However, eh prtition in φ must e extended y numer of verties s defined y sz. These verties must ome from either G t1 or G t2 nd must not lredy e present in X t. Aording to the seprtion lemm (Lemm 2.1), the only verties tht re in oth G t1 nd G t2 re preisely those of X t. Hene, eh new vertex omes either from G t1 or G t2 ut not from oth. Therefore, we should minimize our totl ross edge weights wrt dp vriles of the form dp[t 1, (φ, sz 1 )] nd dp[t 2, (φ, sz 2 )] where sz 1 +sz 2 sz. The funtion sz 1 defines the numer of verties tht should e dded from G t1 X t to eh prtition of φ nd sz 2 does the sme for G t2 X t. Formlly, if we let w(φ) e the totl weight of ross edges used y φ in G t1 G t2 = G t1 [X t ] G t2 [X t ], then we should let: dp[t, s] = dp[t, (φ, sz)] = min dp[t 1, (φ, sz 1 )] + dp[t 2, (φ, sz 2 )] w(φ). sz 1 +sz 2 sz The reson we re sutrting w(φ) t the end is tht the weights of its orresponding edges re tken into ount twie, i.e. one in eh of dp[t 1, (φ, sz 1 )] nd dp[t 2, (φ, sz 2 )].

16 Effiient Prmeterized Algorithms for Dt Pking 1:15 We now show it is lwys the se tht w(φ) = 0. If n edge ontriutes to w(φ), then it must e present in oth G t1 nd G t2. However, y property (3) of nie tree-deomposition, eh edge is introdued extly one. Hene, G t1 nd G t2 do not shre ny edges nd w(φ) = 0. Therefore, y setting dp[t, s] = dp[t, (φ, sz)] = min sz1 +sz 2 sz dp[t 1, (φ, sz 1 )] + dp[t 2, (φ, sz 2 )], we stisfy the invrint. t t 1 t 2 Fig. 10. In join node t, G t1 nd G t2 do not shre ny edges nd their shred verties re in X t. (1.3) Computtions t Introdue Vertex Nodes. The node t is n introdue vertex node. So, it hs single hild t 1 nd X t = X t1 {v} for some v X t1. We know tht the vertex v nnot possily pper in G t1 euse every vertex ppers in onneted sutree of T nd v X t1. Hene, G t is otined y dding v s n isolted vertex to G t1. Agin, we wnt to ompute dp[t, s] nd should hene only onsider the p-prtitionings tht relize s. Given tht X t1 X t, s imposes unique omptile stte on X t1. Moreover, G t hs no new edges in omprison with G t1, so the totl weight of ross edges should only e omputed in G t1. Hene, we let dp[t, s] = dp[t, (φ, sz)] = dp[t 1, (φ Xt1, sz Xt1 )]. Intuitively, this is equivlent to removing v from its prtition nd then omputing the dp in t 1. t t 1 Fig. 11. In n introdue vertex node t, the newly introdued vertex is isolted nd there re no new edges. (1.4) Computtions t Introdue Edge Nodes. The node t hs single hild t 1 nd X t = X t1. Moreover, the only differene etween G t nd G t1 is in single edge e. When omputing dp[t, s], the stte s fores itself on X t1 = X t. Hene we should let dp[t, s] = dp[t 1, s] +w(e, s), where w(e, s) is the ontriution of the edge e to the totl weight of ross edges in s. It is zero if the two sides of e re put in the sme prtition set y s nd is equl to w(e) otherwise. t t 1 Fig. 12. A new edge is introdued in the node t. The sttes re only dependent on verties nd hene re the sme over X t nd X t1. However, we hve to ount for the weight of the new edge. (1.5) Computtions t Forget Vertex Nodes. In this se the node t hs single hild t 1 nd X t = X t1 \ {v} for some v X t1. However, G t = G t1. Hene, when omputing dp[t, s], it is suffiient

17 1:16 K. Chtterjee, A.K. Gohrshdy, N. Okti nd A. Pvloginnis to tke the minimum mong the vlues of dp vriles of ll sttes s over X t1 omptile with s. More preisely, we let dp[t, s] = min s S X t s s dp[t 1, s ]. 1 tht re t t 1 Fig. 13. When vertex v is forgotten y t, we hve G t = G t1, ut X t = X t1 \ {v}. Corretness of Step 2. Given tht r is the root node of T, we hve G r = G. Sine every p- prtitioning of G relizes some stte over X r, it follows tht the optiml weight of p-prtitioning is min s SXr dp[r, s]. This onludes the proof. Remrk 3.1. Algorithm 1 omputes the totl weight of ross edges in minimum-weight p- prtitioning. As is ommon with dynmi progrmming lgorithms, n optiml p-prtitioning itself n e otined y keeping trk of the hoies mde during the omputtion of dp vriles, i.e. keeping trk of the ses tht led to the miniml vlues in eh omputtion. We now estlish the omplexity of our pproh nd present the min theorem of this setion. Numer of Sttes. For fixed p, let C p denote the numer of different possile sttes over set of k size k, i.e. C p k := S {1,2,...,k }. We write C k insted of C p when p n e inferred from the ontext. k Appendix A estlishes ounds on the vlue of C k. Note tht this vlue only depends on p nd k. Theorem 3.1. Given Dt Pking instne I = (n, 1,p, R) s input, where n is the numer of distint dt elements, p is the pking ftor, R is the referene sequene with length of N nd the he hs unit size, the Dt Pking prolem, i.e. finding the miniml numer of he misses, n e solved in liner time, i.e. in time O(N + n k 2 C k p k ), when the underlying ess grph G R hs treewidth k 1. Proof. Given Dt Pking instne I = (n, 1,p, R), we first pply the redution of Lemm 3.1 whih tkes O(N ). We then use Algorithm 1 to solve the resulting minimum-weight p-prtitioning prolem. The orretness of this lgorithm ws estlished in Lemm 3.2. The only remining prt is to find the runtime of Algorithm 1. Note tht the time spent for omputing nie tree deomposition, s in Lemms 2.2 nd 2.3 re liner nd dominted y the rest of our runtime. The lgorithm needs vlues of dp vriles for ll nodes of the tree deomposition whih re t most O(n k). We otin upper-ounds for the runtime of our lgorithm on eh type of node: Leves. There is single stte t eh lef nd its dp is zero. Hene we spend O(1) t eh lef. Join Nodes. At join node t, there re t most C k sttes nd for eh stte s = (φ, sz) we hve to look into the sttes orresponding to every possile size enlrgement funtion sz 1 sz. As in the proof of Lemm A.2, there re t most p k suh funtions. Creting eh orresponding stte tkes O(k). Hene, we spend O(k C k p k ) t eh join node. Introdue Vertex Nodes. At node t, there re C k sttes nd we spend O(k) omputing the unique orresponding stte over X t1. Thus, eh introdue vertex node tkes O(k C k ). Introdue Edge Nodes. This se is similr to the previous one nd tkes O(k C k ). Forget Vertex Nodes. At node t, there re C k sttes nd for eh of them we hve to look into ll its omptile sttes over X t1. Note tht suh omptile sttes n e otined either y putting the vertex v in its own prtition set, whih n hve ny size etween 1 nd p, or

18 Effiient Prmeterized Algorithms for Dt Pking 1:17 y dding it to the prtition set of nother vertex in X t. Hene, there re t most p + k suh sttes nd the totl proessing time of forget vertex node is O(k (p + k) C k ). Note tht the runtime for join nodes domintes the rest. Given tht there re O(n k) nodes in totl, the whole omputtion tkes O(n k 2 C k p k ) time. Finlly, the lgorithm spends O(C k ) time omputing the finl result using the dp vlues t the root. Remrk 3.2. By exploiting treewidth, we provided liner-time lgorithm for finding the ext solution to the Dt Pking prolem when m = 1. Note tht in the generl se, i.e. without onsidering prmeteriztion y treewidth, this prolem is NP-hrd s mentioned in Theorem 2.1. Remrk 3.3. We ssumed LRU s the replement poliy. However, given tht the replement poliy does not mtter when the he hs unit size (Remrk 2.1), our lgorithm is pplile to ny replement poliy, inluding FIFO nd OOP. 3.2 Hrdness of Dt Pking on Trees In this setion, we provide redution from the generl prolem of Dt Pking to the speil se where the ess grph is tree, i.e. hs treewidth 1. This redution leds to hrdness results tht enhne those of [Lvee 2016] y showing tht the prolem remins hrd even on trees. This indites tht lthough onsidering onstnt treewidth ess grphs led to effiient lgorithms for the se of m = 1, onstnt treewidth ess grphs lone re not suffiient for m 2. Theorem 3.2 (Hrdness of Dt Pking on Trees). Given Dt Pking instne I = (n,m,p, R), we hve the following hrdness results: Hrdness of the Ext Prolem. For ny m 2 nd ny p 3, Dt Pking is NP-hrd even if the underlying ess grph G R is tree. Hrdness of Approximtion. Unless P=NP, for ny m 6,p 2 nd ny onstnt ϵ > 0, there is no polynomil pproximtion lgorithm for the Dt Pking prolem with n pproximtion ftor of O(N 1 ϵ ) even if the ess grph G R is tree. Proof. We provide liner-time redution tht trnsforms Dt Pking instne I = (n,m,p, R) to nother instne I = (n + (m + 1)p,m + 1,p, R ) suh tht the ess grph G R is tree. Both hrdness results n then e otined y pplying this redution to the hrdness results of Setion 2.1. Given I, we introdue (m + 1)p new dt elements d 1,d 2,...,d (m+1)p. Let X e the sequene d 1,d 2,...,d (m+1)p,d (m+1)p 1,...,d 1. We form the sequene R s follows: d 1, R[1],d 1, R[2],d 1,...,d 1, R[N ],d 1, X, X,..., X, } {{ } 2N +m+2 times i.e. we tke R nd dd d 1 t its eginning, end nd etween every two elements of it, then we ontente the result with 2N + m + 2 opies of X. We let I = (n + (m + 1)p,m + 1,p, R ). Note tht the he in I hs one spot more thn the he of I. By onstrution, G R is tree, euse it onsists of pth d 1,...,d (m+1)p nd every other vertex of the grph is only onneted to d 1. We now show tht the optiml numer of he misses in I is extly m + 1 plus the optiml numer of he misses in I. Let σ e n optiml dt plement sheme for I, then σ must neessrily put the d i s in extly m + 1 loks, otherwise eh X in the sequene R will led to t lest one he miss for totl of t lest 2N + m + 2. On the other hnd, putting the d i s in m + 1 loks leds to t most 2N + m + 1 he misses, even if ll esses efore the X s re missed. In prtiulr, σ does not put ny element of R in the sme lok s d 1. Therefore, σ first leds to he miss on the first ess to d 1, then keeps d 1 in the he forever. Hene, σ fills one spot of the he with the lok of d 1 nd hs m spots left for sheduling R. Finlly, σ lods the other m loks tht ontin some d i s ut not d 1.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides. 1 PYTHAGORAS THEOREM 1 1 Pythgors Theorem In this setion we will present geometri proof of the fmous theorem of Pythgors. Given right ngled tringle, the squre of the hypotenuse is equl to the sum of the

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 6: Minigoals Towards Simplifying and Rewriting Expressions MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,

More information

Lecture Notes No. 10

Lecture Notes No. 10 2.6 System Identifition, Estimtion, nd Lerning Leture otes o. Mrh 3, 26 6 Model Struture of Liner ime Invrint Systems 6. Model Struture In representing dynmil system, the first step is to find n pproprite

More information

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution Tehnishe Universität Münhen Winter term 29/ I7 Prof. J. Esprz / J. Křetínský / M. Luttenerger. Ferur 2 Solution Automt nd Forml Lnguges Homework 2 Due 5..29. Exerise 2. Let A e the following finite utomton:

More information

NON-DETERMINISTIC FSA

NON-DETERMINISTIC FSA Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is

More information

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6 CS311 Computtionl Strutures Regulr Lnguges nd Regulr Grmmrs Leture 6 1 Wht we know so fr: RLs re losed under produt, union nd * Every RL n e written s RE, nd every RE represents RL Every RL n e reognized

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 8 Mx. lteness ont d Optiml Ching Adm Smith 9/12/2008 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov, K. Wyne Sheduling to Minimizing Lteness Minimizing

More information

CS 573 Automata Theory and Formal Languages

CS 573 Automata Theory and Formal Languages Non-determinism Automt Theory nd Forml Lnguges Professor Leslie Lnder Leture # 3 Septemer 6, 2 To hieve our gol, we need the onept of Non-deterministi Finite Automton with -moves (NFA) An NFA is tuple

More information

CS 491G Combinatorial Optimization Lecture Notes

CS 491G Combinatorial Optimization Lecture Notes CS 491G Comintoril Optimiztion Leture Notes Dvi Owen July 30, August 1 1 Mthings Figure 1: two possile mthings in simple grph. Definition 1 Given grph G = V, E, mthing is olletion of eges M suh tht e i,

More information

Linear choosability of graphs

Linear choosability of graphs Liner hoosility of grphs Louis Esperet, Mikel Montssier, André Rspud To ite this version: Louis Esperet, Mikel Montssier, André Rspud. Liner hoosility of grphs. Stefn Felsner. 2005 Europen Conferene on

More information

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

6.5 Improper integrals

6.5 Improper integrals Eerpt from "Clulus" 3 AoPS In. www.rtofprolemsolving.om 6.5. IMPROPER INTEGRALS 6.5 Improper integrls As we ve seen, we use the definite integrl R f to ompute the re of the region under the grph of y =

More information

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version A Lower Bound for the Length of Prtil Trnsversl in Ltin Squre, Revised Version Pooy Htmi nd Peter W. Shor Deprtment of Mthemtil Sienes, Shrif University of Tehnology, P.O.Bo 11365-9415, Tehrn, Irn Deprtment

More information

Introduction to Olympiad Inequalities

Introduction to Olympiad Inequalities Introdution to Olympid Inequlities Edutionl Studies Progrm HSSP Msshusetts Institute of Tehnology Snj Simonovikj Spring 207 Contents Wrm up nd Am-Gm inequlity 2. Elementry inequlities......................

More information

Section 1.3 Triangles

Section 1.3 Triangles Se 1.3 Tringles 21 Setion 1.3 Tringles LELING TRINGLE The line segments tht form tringle re lled the sides of the tringle. Eh pir of sides forms n ngle, lled n interior ngle, nd eh tringle hs three interior

More information

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs Isomorphism of Grphs Definition The simple grphs G 1 = (V 1, E 1 ) n G = (V, E ) re isomorphi if there is ijetion (n oneto-one n onto funtion) f from V 1 to V with the property tht n re jent in G 1 if

More information

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem. 27 Lesson 2: The Pythgoren Theorem nd Similr Tringles A Brief Review of the Pythgoren Theorem. Rell tht n ngle whih mesures 90º is lled right ngle. If one of the ngles of tringle is right ngle, then we

More information

Nondeterministic Automata vs Deterministic Automata

Nondeterministic Automata vs Deterministic Automata Nondeterministi Automt vs Deterministi Automt We lerned tht NFA is onvenient model for showing the reltionships mong regulr grmmrs, FA, nd regulr expressions, nd designing them. However, we know tht n

More information

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite! Solutions for HW9 Exerise 28. () Drw C 6, W 6 K 6, n K 5,3. C 6 : W 6 : K 6 : K 5,3 : () Whih of the following re iprtite? Justify your nswer. Biprtite: put the re verties in V 1 n the lk in V 2. Biprtite:

More information

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Voting Prdoxes Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Voting Prdoxes Properties Arrow s Theorem Leture Overview 1 Rep

More information

Exercise sheet 6: Solutions

Exercise sheet 6: Solutions Eerise sheet 6: Solutions Cvet emptor: These re merel etended hints, rther thn omplete solutions. 1. If grph G hs hromti numer k > 1, prove tht its verte set n e prtitioned into two nonempt sets V 1 nd

More information

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals AP Clulus BC Chpter 8: Integrtion Tehniques, L Hopitl s Rule nd Improper Integrls 8. Bsi Integrtion Rules In this setion we will review vrious integrtion strtegies. Strtegies: I. Seprte the integrnd into

More information

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of: 22: Union Fin CS 473u - Algorithms - Spring 2005 April 14, 2005 1 Union-Fin We wnt to mintin olletion of sets, uner the opertions of: 1. MkeSet(x) - rete set tht ontins the single element x. 2. Fin(x)

More information

QUADRATIC EQUATION. Contents

QUADRATIC EQUATION. Contents QUADRATIC EQUATION Contents Topi Pge No. Theory 0-04 Exerise - 05-09 Exerise - 09-3 Exerise - 3 4-5 Exerise - 4 6 Answer Key 7-8 Syllus Qudrti equtions with rel oeffiients, reltions etween roots nd oeffiients,

More information

Finite State Automata and Determinisation

Finite State Automata and Determinisation Finite Stte Automt nd Deterministion Tim Dworn Jnury, 2016 Lnguges fs nf re df Deterministion 2 Outline 1 Lnguges 2 Finite Stte Automt (fs) 3 Non-deterministi Finite Stte Automt (nf) 4 Regulr Expressions

More information

Discrete Structures Lecture 11

Discrete Structures Lecture 11 Introdution Good morning. In this setion we study funtions. A funtion is mpping from one set to nother set or, perhps, from one set to itself. We study the properties of funtions. A mpping my not e funtion.

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

(a) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P.

(a) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P. Chpter 7: The Riemnn Integrl When the derivtive is introdued, it is not hrd to see tht the it of the differene quotient should be equl to the slope of the tngent line, or when the horizontl xis is time

More information

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18 Computt onl Biology Leture 18 Genome Rerrngements Finding preserved genes We hve seen before how to rerrnge genome to obtin nother one bsed on: Reversls Knowledge of preserved bloks (or genes) Now we re

More information

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Fun Gme Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Fun Gme Properties Arrow s Theorem Leture Overview 1 Rep 2 Fun Gme 3 Properties

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS The University of ottinghm SCHOOL OF COMPUTR SCIC A LVL 2 MODUL, SPRIG SMSTR 2015 2016 MACHIS AD THIR LAGUAGS ASWRS Time llowed TWO hours Cndidtes my omplete the front over of their nswer ook nd sign their

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

Engr354: Digital Logic Circuits

Engr354: Digital Logic Circuits Engr354: Digitl Logi Ciruits Chpter 4: Logi Optimiztion Curtis Nelson Logi Optimiztion In hpter 4 you will lern out: Synthesis of logi funtions; Anlysis of logi iruits; Tehniques for deriving minimum-ost

More information

2.4 Theoretical Foundations

2.4 Theoretical Foundations 2 Progrmming Lnguge Syntx 2.4 Theoretil Fountions As note in the min text, snners n prsers re se on the finite utomt n pushown utomt tht form the ottom two levels of the Chomsky lnguge hierrhy. At eh level

More information

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic

Chapter 3. Vector Spaces. 3.1 Images and Image Arithmetic Chpter 3 Vetor Spes In Chpter 2, we sw tht the set of imges possessed numer of onvenient properties. It turns out tht ny set tht possesses similr onvenient properties n e nlyzed in similr wy. In liner

More information

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh Computtionl Biology Leture 8: Genome rerrngements, finding miml mthes Sd Mneimneh We hve seen how to rerrnge genome to otin nother one sed on reversls nd the knowledge of the preserved loks or genes. Now

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b CS 294-2 9/11/04 Quntum Ciruit Model, Solovy-Kitev Theorem, BQP Fll 2004 Leture 4 1 Quntum Ciruit Model 1.1 Clssil Ciruits - Universl Gte Sets A lssil iruit implements multi-output oolen funtion f : {0,1}

More information

Part 4. Integration (with Proofs)

Part 4. Integration (with Proofs) Prt 4. Integrtion (with Proofs) 4.1 Definition Definition A prtition P of [, b] is finite set of points {x 0, x 1,..., x n } with = x 0 < x 1

More information

Lecture 6: Coding theory

Lecture 6: Coding theory Leture 6: Coing theory Biology 429 Crl Bergstrom Ferury 4, 2008 Soures: This leture loosely follows Cover n Thoms Chpter 5 n Yeung Chpter 3. As usul, some of the text n equtions re tken iretly from those

More information

1B40 Practical Skills

1B40 Practical Skills B40 Prcticl Skills Comining uncertinties from severl quntities error propgtion We usully encounter situtions where the result of n experiment is given in terms of two (or more) quntities. We then need

More information

Symmetrical Components 1

Symmetrical Components 1 Symmetril Components. Introdution These notes should e red together with Setion. of your text. When performing stedy-stte nlysis of high voltge trnsmission systems, we mke use of the per-phse equivlent

More information

Proving the Pythagorean Theorem

Proving the Pythagorean Theorem Proving the Pythgoren Theorem W. Bline Dowler June 30, 2010 Astrt Most people re fmilir with the formul 2 + 2 = 2. However, in most ses, this ws presented in lssroom s n solute with no ttempt t proof or

More information

8 THREE PHASE A.C. CIRCUITS

8 THREE PHASE A.C. CIRCUITS 8 THREE PHSE.. IRUITS The signls in hpter 7 were sinusoidl lternting voltges nd urrents of the so-lled single se type. n emf of suh type n e esily generted y rotting single loop of ondutor (or single winding),

More information

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix tries Definition of tri mtri is regulr rry of numers enlosed inside rkets SCHOOL OF ENGINEERING & UIL ENVIRONEN Emple he following re ll mtries: ), ) 9, themtis ), d) tries Definition of tri Size of tri

More information

Graph width-parameters and algorithms

Graph width-parameters and algorithms Grph width-prmeters nd lgorithms Jisu Jeong (KAIST) joint work with Sigve Hortemo Sæther nd Jn Arne Telle (University of Bergen) 2015 KMS Annul Meeting 2015.10.24. YONSEI UNIVERSITY Grph width-prmeters

More information

University of Sioux Falls. MAT204/205 Calculus I/II

University of Sioux Falls. MAT204/205 Calculus I/II University of Sioux Flls MAT204/205 Clulus I/II Conepts ddressed: Clulus Textook: Thoms Clulus, 11 th ed., Weir, Hss, Giordno 1. Use stndrd differentition nd integrtion tehniques. Differentition tehniques

More information

ILLUSTRATING THE EXTENSION OF A SPECIAL PROPERTY OF CUBIC POLYNOMIALS TO NTH DEGREE POLYNOMIALS

ILLUSTRATING THE EXTENSION OF A SPECIAL PROPERTY OF CUBIC POLYNOMIALS TO NTH DEGREE POLYNOMIALS ILLUSTRATING THE EXTENSION OF A SPECIAL PROPERTY OF CUBIC POLYNOMIALS TO NTH DEGREE POLYNOMIALS Dvid Miller West Virgini University P.O. BOX 6310 30 Armstrong Hll Morgntown, WV 6506 millerd@mth.wvu.edu

More information

Line Integrals and Entire Functions

Line Integrals and Entire Functions Line Integrls nd Entire Funtions Defining n Integrl for omplex Vlued Funtions In the following setions, our min gol is to show tht every entire funtion n be represented s n everywhere onvergent power series

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

System Validation (IN4387) November 2, 2012, 14:00-17:00

System Validation (IN4387) November 2, 2012, 14:00-17:00 System Vlidtion (IN4387) Novemer 2, 2012, 14:00-17:00 Importnt Notes. The exmintion omprises 5 question in 4 pges. Give omplete explntion nd do not onfine yourself to giving the finl nswer. Good luk! Exerise

More information

Part I: Study the theorem statement.

Part I: Study the theorem statement. Nme 1 Nme 2 Nme 3 A STUDY OF PYTHAGORAS THEOREM Instrutions: Together in groups of 2 or 3, fill out the following worksheet. You my lift nswers from the reding, or nswer on your own. Turn in one pket for

More information

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths Intermedite Mth Cirles Wednesdy 17 Otoer 01 Geometry II: Side Lengths Lst week we disussed vrious ngle properties. As we progressed through the evening, we proved mny results. This week, we will look t

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Logic Synthesis and Verification

Logic Synthesis and Verification Logi Synthesis nd Verifition SOPs nd Inompletely Speified Funtions Jie-Hong Rolnd Jing 江介宏 Deprtment of Eletril Engineering Ntionl Tiwn University Fll 2010 Reding: Logi Synthesis in Nutshell Setion 2 most

More information

TIME AND STATE IN DISTRIBUTED SYSTEMS

TIME AND STATE IN DISTRIBUTED SYSTEMS Distriuted Systems Fö 5-1 Distriuted Systems Fö 5-2 TIME ND STTE IN DISTRIUTED SYSTEMS 1. Time in Distriuted Systems Time in Distriuted Systems euse eh mhine in distriuted system hs its own lok there is

More information

MAT 403 NOTES 4. f + f =

MAT 403 NOTES 4. f + f = MAT 403 NOTES 4 1. Fundmentl Theorem o Clulus We will proo more generl version o the FTC thn the textook. But just like the textook, we strt with the ollowing proposition. Let R[, ] e the set o Riemnn

More information

CIT 596 Theory of Computation 1. Graphs and Digraphs

CIT 596 Theory of Computation 1. Graphs and Digraphs CIT 596 Theory of Computtion 1 A grph G = (V (G), E(G)) onsists of two finite sets: V (G), the vertex set of the grph, often enote y just V, whih is nonempty set of elements lle verties, n E(G), the ege

More information

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4 Am Blnk Leture 13 Winter 2016 CSE 332 CSE 332: Dt Astrtions Sorting Dt Astrtions QuikSort Cutoff 1 Where We Are 2 For smll n, the reursion is wste. The onstnts on quik/merge sort re higher thn the ones

More information

y1 y2 DEMUX a b x1 x2 x3 x4 NETWORK s1 s2 z1 z2

y1 y2 DEMUX a b x1 x2 x3 x4 NETWORK s1 s2 z1 z2 BOOLEAN METHODS Giovnni De Miheli Stnford University Boolen methods Exploit Boolen properties. { Don't re onditions. Minimiztion of the lol funtions. Slower lgorithms, etter qulity results. Externl don't

More information

THE PYTHAGOREAN THEOREM

THE PYTHAGOREAN THEOREM THE PYTHAGOREAN THEOREM The Pythgoren Theorem is one of the most well-known nd widely used theorems in mthemtis. We will first look t n informl investigtion of the Pythgoren Theorem, nd then pply this

More information

For a, b, c, d positive if a b and. ac bd. Reciprocal relations for a and b positive. If a > b then a ab > b. then

For a, b, c, d positive if a b and. ac bd. Reciprocal relations for a and b positive. If a > b then a ab > b. then Slrs-7.2-ADV-.7 Improper Definite Integrls 27.. D.dox Pge of Improper Definite Integrls Before we strt the min topi we present relevnt lger nd it review. See Appendix J for more lger review. Inequlities:

More information

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then. pril 8, 2017 Mth 9 Geometry Solving vetor prolems Prolem Prove tht if vetors nd stisfy, then Solution 1 onsider the vetor ddition prllelogrm shown in the Figure Sine its digonls hve equl length,, the prllelogrm

More information

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Siene Deprtment Compiler Design Spring 7 Lexil Anlysis Smple Exerises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sienes Institute 47 Admirlty Wy, Suite

More information

Activities. 4.1 Pythagoras' Theorem 4.2 Spirals 4.3 Clinometers 4.4 Radar 4.5 Posting Parcels 4.6 Interlocking Pipes 4.7 Sine Rule Notes and Solutions

Activities. 4.1 Pythagoras' Theorem 4.2 Spirals 4.3 Clinometers 4.4 Radar 4.5 Posting Parcels 4.6 Interlocking Pipes 4.7 Sine Rule Notes and Solutions MEP: Demonstrtion Projet UNIT 4: Trigonometry UNIT 4 Trigonometry tivities tivities 4. Pythgors' Theorem 4.2 Spirls 4.3 linometers 4.4 Rdr 4.5 Posting Prels 4.6 Interloking Pipes 4.7 Sine Rule Notes nd

More information

Test Generation from Timed Input Output Automata

Test Generation from Timed Input Output Automata Chpter 8 Test Genertion from Timed Input Output Automt The purpose of this hpter is to introdue tehniques for the genertion of test dt from models of softwre sed on vrints of timed utomt. The tests generted

More information

Chapter 8 Roots and Radicals

Chapter 8 Roots and Radicals Chpter 8 Roots nd Rdils 7 ROOTS AND RADICALS 8 Figure 8. Grphene is n inredily strong nd flexile mteril mde from ron. It n lso ondut eletriity. Notie the hexgonl grid pttern. (redit: AlexnderAIUS / Wikimedi

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours Mi-Term Exmintion - Spring 0 Mthemtil Progrmming with Applitions to Eonomis Totl Sore: 5; Time: hours. Let G = (N, E) e irete grph. Define the inegree of vertex i N s the numer of eges tht re oming into

More information

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4. Mth 5 Tutoril Week 1 - Jnury 1 1 Nme Setion Tutoril Worksheet 1. Find ll solutions to the liner system by following the given steps x + y + z = x + y + z = 4. y + z = Step 1. Write down the rgumented mtrix

More information

Fast index for approximate string matching

Fast index for approximate string matching Fst index for pproximte string mthing Dekel Tsur Astrt We present n index tht stores text of length n suh tht given pttern of length m, ll the sustrings of the text tht re within Hmming distne (or edit

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Green s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e

Green s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e Green s Theorem. Let be the boundry of the unit squre, y, oriented ounterlokwise, nd let F be the vetor field F, y e y +, 2 y. Find F d r. Solution. Let s write P, y e y + nd Q, y 2 y, so tht F P, Q. Let

More information

Surface maps into free groups

Surface maps into free groups Surfce mps into free groups lden Wlker Novemer 10, 2014 Free groups wedge X of two circles: Set F = π 1 (X ) =,. We write cpitl letters for inverse, so = 1. e.g. () 1 = Commuttors Let x nd y e loops. The

More information

5. Every rational number have either terminating or repeating (recurring) decimal representation.

5. Every rational number have either terminating or repeating (recurring) decimal representation. CHAPTER NUMBER SYSTEMS Points to Rememer :. Numer used for ounting,,,,... re known s Nturl numers.. All nturl numers together with zero i.e. 0,,,,,... re known s whole numers.. All nturl numers, zero nd

More information

T b a(f) [f ] +. P b a(f) = Conclude that if f is in AC then it is the difference of two monotone absolutely continuous functions.

T b a(f) [f ] +. P b a(f) = Conclude that if f is in AC then it is the difference of two monotone absolutely continuous functions. Rel Vribles, Fll 2014 Problem set 5 Solution suggestions Exerise 1. Let f be bsolutely ontinuous on [, b] Show tht nd T b (f) P b (f) f (x) dx [f ] +. Conlude tht if f is in AC then it is the differene

More information

INTEGRATION. 1 Integrals of Complex Valued functions of a REAL variable

INTEGRATION. 1 Integrals of Complex Valued functions of a REAL variable INTEGRATION NOTE: These notes re supposed to supplement Chpter 4 of the online textbook. 1 Integrls of Complex Vlued funtions of REAL vrible If I is n intervl in R (for exmple I = [, b] or I = (, b)) nd

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon LIP Lortoire de l Informtique du Prllélisme Eole Normle Supérieure de Lyon Institut IMAG Unité de reherhe ssoiée u CNRS n 1398 One-wy Cellulr Automt on Cyley Grphs Zsuzsnn Rok Mrs 1993 Reserh Report N

More information

A Study on the Properties of Rational Triangles

A Study on the Properties of Rational Triangles Interntionl Journl of Mthemtis Reserh. ISSN 0976-5840 Volume 6, Numer (04), pp. 8-9 Interntionl Reserh Pulition House http://www.irphouse.om Study on the Properties of Rtionl Tringles M. Q. lm, M.R. Hssn

More information

Expand the Shares Together: Envy-free Mechanisms with a Small Number of Cuts

Expand the Shares Together: Envy-free Mechanisms with a Small Number of Cuts Nonme mnusript No. (will e inserted y the editor) Expnd the Shres Together: Envy-free Mehnisms with Smll Numer of uts Msoud Seddighin Mjid Frhdi Mohmmd Ghodsi Rez Alijni Ahmd S. Tjik Reeived: dte / Aepted:

More information

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09 Metodologie di progetto HW Tehnology Mpping Lst updte: 19/03/09 Tehnology Mpping 2 Tehnology Mpping Exmple: t 1 = + b; t 2 = d + e; t 3 = b + d; t 4 = t 1 t 2 + fg; t 5 = t 4 h + t 2 t 3 ; F = t 5 ; t

More information

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES PAIR OF LINEAR EQUATIONS IN TWO VARIABLES. Two liner equtions in the sme two vriles re lled pir of liner equtions in two vriles. The most generl form of pir of liner equtions is x + y + 0 x + y + 0 where,,,,,,

More information

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α Disrete Strutures, Test 2 Mondy, Mrh 28, 2016 SOLUTIONS, VERSION α α 1. (18 pts) Short nswer. Put your nswer in the ox. No prtil redit. () Consider the reltion R on {,,, d with mtrix digrph of R.. Drw

More information

Behavior Composition in the Presence of Failure

Behavior Composition in the Presence of Failure Behvior Composition in the Presene of Filure Sestin Srdin RMIT University, Melourne, Austrli Fio Ptrizi & Giuseppe De Giomo Spienz Univ. Rom, Itly KR 08, Sept. 2008, Sydney Austrli Introdution There re

More information

AP CALCULUS Test #6: Unit #6 Basic Integration and Applications

AP CALCULUS Test #6: Unit #6 Basic Integration and Applications AP CALCULUS Test #6: Unit #6 Bsi Integrtion nd Applitions A GRAPHING CALCULATOR IS REQUIRED FOR SOME PROBLEMS OR PARTS OF PROBLEMS IN THIS PART OF THE EXAMINATION. () The ext numeril vlue of the orret

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

The Word Problem in Quandles

The Word Problem in Quandles The Word Prolem in Qundles Benjmin Fish Advisor: Ren Levitt April 5, 2013 1 1 Introdution A word over n lger A is finite sequene of elements of A, prentheses, nd opertions of A defined reursively: Given

More information

Graph States EPIT Mehdi Mhalla (Calgary, Canada) Simon Perdrix (Grenoble, France)

Graph States EPIT Mehdi Mhalla (Calgary, Canada) Simon Perdrix (Grenoble, France) Grph Sttes EPIT 2005 Mehdi Mhll (Clgry, Cnd) Simon Perdrix (Grenole, Frne) simon.perdrix@img.fr Grph Stte: Introdution A grph-sed representtion of the entnglement of some (lrge) quntum stte. Verties: quits

More information

TOPIC: LINEAR ALGEBRA MATRICES

TOPIC: LINEAR ALGEBRA MATRICES Interntionl Blurete LECTUE NOTES for FUTHE MATHEMATICS Dr TOPIC: LINEA ALGEBA MATICES. DEFINITION OF A MATIX MATIX OPEATIONS.. THE DETEMINANT deta THE INVESE A -... SYSTEMS OF LINEA EQUATIONS. 8. THE AUGMENTED

More information

Polynomials. Polynomials. Curriculum Ready ACMNA:

Polynomials. Polynomials. Curriculum Ready ACMNA: Polynomils Polynomils Curriulum Redy ACMNA: 66 www.mthletis.om Polynomils POLYNOMIALS A polynomil is mthemtil expression with one vrile whose powers re neither negtive nor frtions. The power in eh expression

More information

Learning Partially Observable Markov Models from First Passage Times

Learning Partially Observable Markov Models from First Passage Times Lerning Prtilly Oservle Mrkov s from First Pssge s Jérôme Cllut nd Pierre Dupont Europen Conferene on Mhine Lerning (ECML) 8 Septemer 7 Outline. FPT in models nd sequenes. Prtilly Oservle Mrkov s (POMMs).

More information

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows: Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

More information

Hyers-Ulam stability of Pielou logistic difference equation

Hyers-Ulam stability of Pielou logistic difference equation vilble online t wwwisr-publitionsom/jns J Nonliner Si ppl, 0 (207, 35 322 Reserh rtile Journl Homepge: wwwtjnsom - wwwisr-publitionsom/jns Hyers-Ulm stbility of Pielou logisti differene eqution Soon-Mo

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information