9 Liner Progrmming in Dtse Akir Kwguchi nd Andrew Ngel Deprtment of Computer Science, The City College of New York. New York, New York United Sttes of Americ Keywords: liner progrmming, simple method, revised simple method, dtse, stored procedure. Astrct Liner progrmming is powerful optimiztion technique nd n importnt field in the res of science, engineering, nd usiness. Lrge-scle liner progrmming prolems rise in mny prcticl pplictions, nd solving these prolems requires n integrtion of dtnlysis nd dt-mnipultion cpilities. Dtse technology hs ecome centrl component of tody s informtion systems. Almost every type of orgniztion is now using dtse systems to store, mnipulte, nd retrieve dt. Nevertheless, little ttempt hs een mde to fcilitte generl liner progrmming solvers for dtse environments. Dozens of sophisticted tools nd softwre lirries tht implement liner progrmming models cn e found. ut, there is no dtse-emedded liner progrmming tool semlessly nd trnsprently utilized for dtse processing. The focus of the study in this chpter is to fill this technicl gp etween dt nlysis nd dt mnipultion, y solving lrge-scle liner progrmming prolems with pplictions uilt on the dtse environment. Specificlly, this chpter studies the representtion of the liner progrmming model in reltionl structures, s well s the computtionl method to solve the liner progrmming prolems. We hve developed set of redy to use stored procedures to solve generl liner progrmming prolems. A stored procedure is group of SQL sttements, precompiled nd physiclly stored within dtse, therey hving comple logic run inside the dtse. We show versions of procedures in the open-source ysql dtse nd commercil Orcle dtse system. The eperiments re performed with severl enchmrk prolems etrcted from the Netli lirry. Foundtions for nd preliminry eperimentl results of this study re presented. *. Introduction * This work hs een prtly supported y New York Stte Deprtment of Trnsporttion nd New York City Deprtment of Environment Protection.
34 New Developments in Rootics, Automtion nd Control Liner progrmming is powerful technique for deling with the prolem of llocting limited resources mong competing ctivities, s well s other prolems hving similr mthemticl formultion (Winston, 994, Richrd, 99, Wlsh, 985). It hs ecome n importnt field of optimiztion in the res of science nd engineering nd hs ecome stndrd tool of gret importnce for numerous usiness nd industril orgniztions. In prticulr, lrge-scle liner progrmming prolems rise in prcticl pplictions such s logistics for lrge spre-prts inventory, revenue mngement nd dynmic pricing, finnce, trnsporttion nd routing, network design, nd chip design (Hillier nd Lieermn, 2). While these prolems inevitly involve the nlysis of lrge mount of dt, there hs een reltively little work ddressing this in the dtse contet. Little serious ttempt hs een mde to fcilitte dt-driven nlysis with dt-oriented techniques. In tody s mrketplce, dozens of sophisticted tools nd softwre lirries tht implement liner progrmming models cn e found. Nevertheless, these products do not work with dtse systems semlessly. They rther require dditionl softwre lyers uilt on top of dtses to etrct nd trnsfer dt in the dtses. The focus of our study gthered here is to fill this technicl gp etween dt nlysis nd dt mnipultion y solving lrgescle liner progrmming prolems with pplictions uilt on the dtse environment. In mthemtics, liner progrmming prolems re optimiztion prolems in which the ojective function to chrcterize optimlity of prolem nd the constrints to epress specific conditions for tht prolem re ll liner (Hillier nd Lieermn, 2, Thoms H. Cormen nd Stein, 2). Two fmilies of solution methods, so-clled simple methods (Dntzig, 963) nd interior-point methods (Krmrkr, 984), re in wide use nd ville s computer progrms tody. oth methods progressively improve series of tril solutions y visiting edges of the fesile oundry or the points within the interior of the fesile region, until solution is reched tht stisfies the constrints nd cnnot e improved. In fct, it is known tht lrge prolem instnces render even the est of codes nerly unusle (Winston, 994). Furthermore, the progrm lirries ville tody re found outside the stndrd dtse environment, thus mndting the use of specil interfce to interct with these tools for liner progrmming computtions. This chpter gives detiled ccount of the methodology nd technicl issues relted to generl liner progrmming in the reltionl (or oject-reltionl) dtse environment. Our gol is to find suitle softwre pltform for solving optimiztion prolems on the etension of lrge mount of informtion orgnized nd structured in the reltionl dtses. In principle, whenever dt is ville in dtse, solving such prolems should e done in dtse wy, tht is, computtions should e closed in the world of the dtse. There is stndrd dtse lnguge, ANSI SQL, for the mnipultion of dt in the dtse, which hs grown to level comprle to most ordinry progrmming or scripting lnguges. Eliminting relince on commercil liner progrmming pckge, thus eliminting the overhed of dt trnsfer etween dtse nd pckge is wht we hope to chieve. There re lso the issues of trde-off. A sic nture of liner progrmming is collection of mtrices defining prolem nd sequence of lgeric opertions repetedly pplied to
Liner Progrmming in Dtse 34 these mtrices, hence giving perfect mtch for rry-sed progrmming in scientific computtions. In generl, the reltionl dtse is not designed for mtri opertions like solving liner progrmming prolems. Indeed, relizing mtri opertions on top of the stndrd reltionl (or oject-reltionl) structure is non-trivil. On the other hnd, t the hert of the dtse system is the ility to effectively mnge resources coupled with n efficient dt ccess mechnism. The response to user is mde y the est ville sequence of opertions, or so-clled optimized queries, on the ctul dt. When hndling etremely lrge mtrices, the system proly gives performnce dvntge over the unplnned or d hoc eecution of the progrm cusing n instile use of virtul memory (thus cusing thrshing) for the disposition of rrys. In this chpter, implementtion techniques nd key issues for this development re studied etensively. A model suitle to cpture the dynmics of liner progrmming computtions is incorported into the imed development, y wy of relizing set of procedurl interfces tht enles stndrd dtse lnguge to define prolems within dtse nd to derive optiml solutions for those prolems without requiring users to write detiled progrm sttements. Specificlly, we develop two sets of redy to use stored procedures to solve generl liner progrmming prolems. A stored procedure is group of SQL sttements, precompiled nd physiclly stored within dtse (Gulutzn nd Pelzer, 999, Gulutzn, 27). It forms logicl unit to encpsulte set of dtse opertions, defined with n ppliction progrm interfce to perform prticulr tsk, therey hving comple logic run inside the dtse. The ect implementtion of stored procedure vries from one dtse to nother, ut is supported y most mjor dtse vendors. To this end, we will show implementtions using ysql open-source dtse system nd freely ville Orcle Epress Edition selected from the commercil domin. Our choice of these populr dtse environments is to justify the fesiility of concepts nd to drw comprisons of their usility. The rest of this chpter is orgnized s follows: Section 2 defines the liner progrmming model nd introduces our pproch to epress the model in the reltionl dtse. Section 3 presents detils of developed simultion system nd eperimentl performnce studies. Section 4 discusses relted work, nd Section 5 concludes our work gthered in this chpter. 2. Fundmentls A liner progrmming prolem consists of collection of liner inequlities on numer of rel vriles nd fied liner function to mimize or minimize. In this section, we summrize the principle technicl issues in formulting the prolem nd some solution method in the reltionl dtse environment. 2. Liner Progrmming Principles Consider the mtri nottion epressed in the set of equtions () elow. The stndrd form of the liner progrmming prolem is to mimize n ojective function Z = c T, suject to the functionl constrints of A nd non-negtivity constrints of, with in this cse eing the n-dimensionl zero column vector. A coefficient mtri A nd column vectors c,, nd re defined in the ovious mnner such tht ech component of the column
New Developments in Rootics, Automtion nd Control 342 vector A is less thn or equl to the corresponding component of the column vector. ut ll forms of liner progrmming prolems rise in prctice, not just ones in the stndrd form, nd we must del with issues such s minimiztion ojectives, constrints of the form A or A =, vriles rnging in negtive vlues, nd so on. Adjustments cn e mde to trnsform every non-stndrd prolem into the stndrd form. So, we limit our discussion to the stndrd form of the prolem. = = = = = mn m m n n n n n c c c L L L 2 2 22 2 2 2 2 2 A c,,,, () The gol is to find n optiml solution, tht is, the most fvorle vlues of the ojective function mong fesile ones for which ll the constrints re stisfied. The simple method (Dntzig, 963) is n lgeric itertive procedure where ech round of computtion involves solving system of equtions to otin new tril solution for the optimlity test. The simple method relies on the mthemticl property tht the ojective function s mimum must occur on corner of the spce ounded y the constrints of the fesile region. To pply the simple method, liner progrmming prolems must e converted into soclled ugmented form, y introducing non-negtive slck vriles to replce non-equlities with equlities in the constrints. The prolem cn then e rewritten in the following form: [ ] = = = + + + I A c I A s 2 s T s s m n n n Z,,, (2) In equtions (2) ove,, column vector of slck vriles s, nd I is the m m identity mtri. Following the convention, the vriles set to zero y the simple method re clled nonsic vriles nd the others re clled sic vriles. If ll of the sic vriles re non-negtive, the solution is clled sic fesile solution. Two sic fesile solutions re djcent if ll ut one of their nonsic vriles re the sme. The spirit of the simple method utilizes rule for generting from ny given sic fesile solution new one differing from the old in respect of just one vrile. Thus, moving from the current sic fesile solution to n djcent one involves switching one vrile from nonsic to sic nd vice vers for one other vrile. This movement involves replcing one nonsic vrile (clled entering sic vrile) y new one (clled
Liner Progrmming in Dtse 343 leving sic vrile) nd identifying the new sic fesile solution. The simple lgorithm is summrized s follows: Simple ethod:. Initiliztion: trnsform the given prolem into n ugmented form, nd select originl vriles to e the nonsic vriles (i.e., = ), nd slck vrile to e the sic vriles (i.e., s = ). 2. Optimlity test: rewrite the ojective function y shifting ll the nonsic vriles to the right-hnd side, nd see if the sign of the coefficient of every nonsic vrile is positive, in which cse the solution is optiml. 3. Itertive Step: 3. Selecting n entering vrile: s the nonsic vrile whose coefficient is lrgest in the rewritten ojective function used in the optimlity test. 3.2 Selecting leving vrile: s the sic vrile tht reches zero first when the entering sic vrile is incresed, tht is, the sic vrile with the smllest upper ound. 3.3 Compute new sic fesile solution: y pplying the Guss-Jordn method of elimintion, nd pply the ove optimlity test. 2.2 Revised Simple ethod The computtion of the simple method cn e improved y reducing the numer of rithmetic opertions s well s the mount of round-off errors generted from these opertions (Hillier nd Lieermn, 2, Richrd, 99, Wlsh, 985). Notice tht n nonsic vriles from mong the n + m elements of [ T, s T] T re lwys set to zero. Thus, eliminting these n vriles y equting them to zero leves set of m equtions in m unknowns of the sic vriles. The spirit of the revised simple method (Hillier nd Lieermn, 2, Winston, 994) is to preserve only the pieces of informtion relevnt t ech itertion, which consists of the coefficients of the nonsic vriles in the ojective function, the coefficients of the entering sic vrile in the other equtions, nd the righthnd side of the equtions. Specificlly, consider the equtions (3) elow. The revised method ttempts to derive sic (squre) mtri of size m m y eliminting the columns corresponding to coefficients of nonsic vriles from [A, I] in equtions (2). Furthermore, let c T e the vector otined y eliminting the coefficients of nonsic vriles from [c T, T ] T nd reordering the elements to mtch the order of the sic vriles. Then, the vlues of the sic vriles ecome - nd Z = c T -. The equtions (2) ecome equivlent with equtions (3) fter ny itertion of the simple method. T c A c = 2 m A T 2 22 m 2 L L L c T m 2 m, mm Z T c = s (3)
344 New Developments in Rootics, Automtion nd Control This mens tht only - needs to e derived to e le to clculte ll the numers used in the simple method from the originl prmeters of A,, c providing efficiency nd numericl stility. 2.3 Reltionl Representtion A reltionl model provides single wy to represent dt s two-dimensionl tle or reltion. An n-ry reltion eing suset of the Crtesin product of n domins hs collection of rows clled tuples. Implementions of the simple nd revised simple methods must locte the ect position of the vlues for the equtions nd vriles of the liner progrmming prolem to solve. However, the position of the tuples in the tle is not relevnt in the reltionl model. y definition, tuple ordering nd mtri hndling re eyond the stndrd reltionl fetures, nd these re the most importnt issues tht need to e ddressed to implement the liner progrmming solver within the dtse using the simple method. We will eplore two distinct methods for representing mtrices in the reltionl model. Simple clcultions re most conveniently performed with the help of series of tles known s simple tleu (Dntzig, 963, Hillier nd Lieermn, 2). A simple tleu is tle tht contins ll the informtion necessry to move from one itertion to nother while performing the simple method. Let e column vector of m sic vriles otined y eliminting the nonsic vriles from nd s. Then, the initil tleu cn e epressed s, Z c A T I (4) The lgeric tretment sed on the revised simple method (Hillier nd Lieermn, 2, Willim H. Press nd Flnnery, 22) derives the vlues t ny itertion of the simple method s, Z T T c A c A c T c T (5) For the mtrices epressed (4) nd (5), the first two column elements do not need to e stored in persistent memory. Thus, the simple tleu cn e tle using the rest of the three column elements in the reltionl model. Creting tle instnces s simple tleu is perhps the most strighforwrd wy. Indeed, our ysql implementtion in the net section uses this representtion, in which liner progrmming prolem in the ugmented form (equtions (2)) cn e seen s reltion: tleu(id,,2, n, rhs)
Liner Progrmming in Dtse 345 A vrile of the constrints nd the ojective function ecomes n ttriute of the reltion, together with the right hnd side tht ecomes the rhs column on the tle. The id column serves s key tht cn uniquely determine every vrile of the constrints nd of the ojective function in the tuple. A constrint of the liner progrmming prolem in the ugmented form is identified y unique positive integer vlue rnging from to n in the id column, where n is the numer of constrints for the prolem plus the ojective function. Thus y pplying reltionl opertions, it is fesile to know the position of every constrint nd vrile for liner progrmming prolem, nd to proceed with the mtri opertions necessry to implement the simple lgorithm. See Figure for the tle instnce populted with simple emple. Fig.. Two representtions of the initil simple tleu in the reltionl dtse The min drwck of this design is fied structure of tle. An individul tle needs to e creted for ech prolem, nd the cost of defining (nd dropping) tle ecomes prt of the process implementing the simple method. The numer of tles in the dtse will increse s the collection of prolems to solve ccumultes. This my cuse dministrtive strin for dtse mngement. Sutle issues rise in the hndling of lrge-scle prolems. The tle mps to the full instnce of the mtri even if the prolem hs sprsely populted non-zero dt. Thousnds of zero vlues (or null vlues specific to dtse) held in tuple pile up significnt mount of spce. esides, tuple of lrge numer of non-zero vlues is prolemtic ecuse the physicl record holding such tuple my not fit into disk lock. Accessing spnned record over multiple disk locks is time-consuming. As n lterntive to the tle-s-tleu structure, element-y-element represention cn e considered. The simple tleu re decomposed to collection of vlues, ech of which is tuple consisting of tleu id, row position, column position, nd vlue in the specified position. This is to sy tht the tle no longer possesses the shpe of tleu ut hs the informtion to locte every element in the tleu. issing elements re zeros, thus spce efficient for sprse contents. A single tle cn gther ll the prolem instnces, in tht the elements in the specific tleu re found y the use of the tleu id. The size of the tuple is smll ecuse there re only four ttriutes in the tuple. In return, there is time
346 New Developments in Rootics, Automtion nd Control overhed for finding specific element in the tle. Our Orcle XE implementtion detiled in the net section utilizes this representtion. 3. System Development The vilility of rel-time dtses cple of ccepting nd solving liner progrmming prolems helps us emine the effectiveness nd prcticl usility in integrting liner progrmming tools into the dtse environment. Towrds this end, generl liner progrmming solver is developed on top of the de fcto stndrd dtse environment, with the comintion of PHP ppliction for the front-end nd ysql or Orcle ppliction for the ckend. Note tht the implementtion of this liner progrmming solver is strictly within the dtse technology, not relying on ny outside progrmming lnguge. Fig. 2. Architecture of the implemented liner progrmming solver The systems rchitecture is summrized in Figure 2. The PHP front-end enles the user to input the numer of vriles nd numer of constrints of the liner progrmming prolem to solve. With these vlues, it genertes dynmic We interfce to ccept the vlues of the ojective function nd the vlues of the constrining equtions. The We interfce lso llows the user to uplod file in PS (themticl Progrmming System) formt tht defines liner progrmming prolem. The PS file formt serves s stndrd for descriing nd rchiving liner progrmming nd mied integer progrmming prolems (Orgniztion, 27). A specil progrm is uilt to convert PS dt formt into SQL sttements for populting liner progrmming instnce. The min ojective of this development is to otin enchmrk performnces for lrge-scle liner progrmming prolems.
Liner Progrmming in Dtse 347 The ysql nd Orcle ck-ends perform itertive computtions y the use of set of stored procedures precompiled nd integrted into the dtse structure. The systems encpsulte n API for processing simple method tht requires the eecution of severl SQL queries to produce solution. The input nd output of the system re shown in Figure 3 in which ech tle of the right figure represents the tleu contining the vlues resulted from ech itertion of the simple method. The system presents successive trnsformtions nd optiml solution if it eists. Fig. 3. Simple method itertions nd optiml solution 3. Stored Procedure Implementtion ysql Stored procedures cn hve direct ccesses to the dt in the dtse, nd run their steps directly nd entirely within the dtse. The comple logic runs inside the dtse engine, thus fster in processing requests ecuse numerous contet switches nd gret del of network trffic cn e eliminted. The dtse system only needs to send the finl results ck to the user, doing wy with the overhed of communicting potentilly lrge mounts of interim dt ck nd forth (Gulutzn, 27, Gulutzn nd Pelzer, 999).
348 New Developments in Rootics, Automtion nd Control Nme m n Nonzeros Optiml vlue Time Stndrd devition ADLITTLE 57 97 465 2.254949636E+5 min. 25 2.78 sec. sec. AFIRO 28 32 88-464.753428596 35 sec..67 sec. LEND 75 83 52-3.8249846E+ min. 5 sec. 3.2 sec. RANDY 22 24 25.58598965E+3 2 min. 5 4.25 sec. 9 sec. Tle. ysql Eperimentl set nd mesured eecution time Stored procedures re supported y most DSs, ut there is fir mount of vrition in their synt nd cpilities even their internl effects re lmost invisile. Our development uses ysql version 5..22 t the time of this writing (s for ysql version 5, stored procedures re supported). The net code listing is the stored procedure used to crete the tle to store the liner progrmming prolem to e solved y the ppliction (Perez, 27). The first prt of the stored procedure consists of the prototype of the function nd the declrtion of the vriles to e used in the procedure. DELIITER $$ DROP PROCEDURE IF EXISTS lpsolver. cretetle $$ CREATE PROCEDURE lpsolver. cretetle (constrints INT, vriles INT) EGIN DECLARE i INT; DECLARE jitertor VARCHAR(5); DECLARE sttement VARCHAR(); DROP TALE IF EXISTS tleu; ecuse of the dynmic nture of the clcultions for solving liner progrmming prolems, our stored procedure relies on the etensive use of prepred SQL sttements. In the net code lock, the SQL sttement to crete tle is generted on the fly, sed on the numer of vriles nd constrints of the prolem to solve. The generted procedure is then pssed to the dtse for eecution. SET sttement = CREATE TALE tleu(id INT(5) PRIARY KEY, ; SET i = ; tle_loop:loop IF i > constrints + vriles + THEN LEAVE tle_loop; END IF; SET jitertor = CONCAT( j,i); SET sttement = CONCAT(sttement, jitertor); SET sttement = CONCAT(sttement, DOULE DEFAULT ); IF i <= constrints + vriles THEN SET sttement = CONCAT(sttement,, );
Liner Progrmming in Dtse 349 END IF; SET i = i + ; END LOOP tle_loop; SET sttement = CONCAT(sttement, ) ); SET @sql_cll = sttement; PREPARE s FRO @sql_cll; EXECUTE s; DEALLOCATE PREPARE s; END $$ DELIITER; 3.2 Eperimentl Results ysql To see the effectiveness of the implementtion, vrious liner progrmming prolems were selected from commonly ville Netli liner progrmming lirry (Orgniztion, 27). As one cse, see Tle for sufficiently lrge prolem set. The vlues m nd n indicte the size, m n, of the coefficient mtri A in equtions (), or equivlently, m is the numer of constrints nd n is the numer of decision vriles. All eperiments were performed y n Intel 586 sed stndlone mchine with.2 GHz CPU nd 52 memory tht ws running ysql 5..22. The dt vlues were etrcted from Netli PS files to populte the prolems into the dtse prior to run the simple method. The time mesured does not include this dt preprtion process, ut only the eecution of the stored procedure to produce solution. The time listed in Tle is the verge of ten eecutions of ech prolem. The results re sed on the implementtion of the revised simple method contined in the stored procedures. One limiting fctor is the fct tht ysql llows to hve up to columns on tle. Given tht this implementtion is sed on mpping of simple tleu into dtse reltion, the numer of vriles plus the numer of constrints cnnot eceed the numer of columns llowed for ysql tle. This prohiited us from testing the prolems in the Netli lirry tht eceed the column size of. Finlly, we oserved one prolem when trying to find optiml solutions for lrger prolems with higher numers of columns, vriles nd zero elements. The computtion never cme to n end, indicting tht the prolem hd ecome unounded, which cn e ttriuted to the tleu ecoming illconditioned s consequence of trunction errors resulted from repeted mtri opertions (Kwguchi nd Perez, 27). 3.3 Stored Procedure Implementtion in Orcle XE A Liner Progrmming Solver ws implemented in Orcle XE stored procedures with simple we interfce uilt in PHP. Orcle XE is free version of the Orcle dtse system suject to some restrictions. Notly, Orcle XE will only utilize single processor, nd totl user dt is limited to 4 G. Still, stored procedures re entirely supported, s well s dvnced indeing techniques, mking Orcle XE n ttrctive lterntive. The we interfce shown in Figure 4 provides for cretion, editing, nd disply of lrge mtrices, nd llows the user to perform elementry mtri opertions. The Liner
35 New Developments in Rootics, Automtion nd Control Progrmming menu provides options for uploding nd prsing stndrd PS files, for solving the prolem utomticlly, nd for viewing performnce dt. The Work Tleu option is shown, nd provides n interfce where the user cn view the tleu, or ny portion of it. They cn choose n element to pivot on, or y clicking the suggest utton, the column nd row selected y the simple method is high-lighted nd displyed. This ws useful for deugging, ut lso serves s good eductionl tool since student cn go through the lgorithm step y step. Fig. 4. We interfce showing tleu with net itertion highlighted The dt model ws lso chnged in this implementtion to ddress the limittion of m numer of columns llowed in tle. Rther thn creting tle with enough columns to contin the simple tleu, mtri is represented y two tles, one descriing the properties, nd one contining the row position, column position, nd vlue of ech element. This hs the dded enefit of simplifying mtri opertions. Since the tles descried elow hold ny mtrices stored in the system, cretion, deletion, nd ltertion of mtrices relies only on INSERT, DELETE, nd UPDATE sttements, with no need for on the fly tle cretion or procedure compiltion. mtri_property(mtri_id, nme, row_size, column_size) mtri_vlues(mtri_id, row_position, column_position, vlue) Although llowing for n indefinite numer of columns in stored mtri, this model introduces prolem in dt look up. In the ysql implementtion, since ech row of the
Liner Progrmming in Dtse 35 mtri ws tuple in the reltion, once row is retrieved y the dtse, every element in the row is either in min memory or efficiently uffered since the tuple is stored contiguously on disk. ut in the Orcle implementtion, getting ech element in row could require new disk red. Fortuntely, Orcle XE supports Hsh Inde for fst retrievl of tuples tht shre common hsh vlue. Since in the Orcle model, ny two elements in the sme row shre the sme mtri_id nd row_position, we cn uild such n inde. In the Orcle XE environment, this is chieved y first creting hsh cluster (equivlent to hsh uckets), then creting the tle tht is designted to e stored in the cluster ccording to hsh of t lest one of its ttriutes. CREATE CLUSTER tri_inde (mtid NUER, rowpos NUER) SIZE 52 SINGLE TALE HASHKEYS ; CREATE TALE "VALUE" ( "ATID" NUER NOT NULL ENALE, "ROWPOS" NUER NOT NULL ENALE, "COLPOS" NUER NOT NULL ENALE, "CELL_VALUE" NUER(26,4) NOT NULL ENALE, CONSTRAINT "VALUE_UK" UNIQUE ("ATID", "ROWPOS", "COLPOS") ENALE, CONSTRAINT "VALUE_FK" FOREIGN KEY ("ATID") REFERENCES "PROPERTY" ("ATID") ON DELETE CASCADE ENALE ) CLUSTER "tri_inde" ("ATID", "ROWPOS"); To ctully enefit from this inde, it is necessry to mke use of Cursors in the stored procedures tht operte on the mtrices. Cursors re fetured in mny dtse systems, nd provide n interfce to declre comple SELECT sttements nd iterte over the results. y declring cursors, rther thn using SELECT sttement inside FOR loop, the query optimizer is etter le to tke dvntge of the hsh inde nd retrieve entire rows of the mtri with miniml disk I/O. Implementing the solver in this wy resulted in more thn 5% performnce increse, prticulrly s prolem size ws incresed. Nme m n Non zeros Optiml Vlue (clculted) Std. Err. Itertions Avg. Time (sec) ISRAEL 75 43 2358-89664.462.4% 38 784.4 LOTFI 54 39 86-25.2647426.% 23 79.9 9.8 AFIRO 28 33 88-464.753429.%.4.52 SC5 6 4 28-52.2262.% 77.9. SC25 26 24 552-52.2262.% 257 72.2 2.9 ADLITTLE 57 98 465 225494.9384.% 46 38..73 LEND 75 84 52-3.8223945.324% 8 4.2.63 RANDY 22 25 25 557.65823 63.2764% 659 433.8 7. Tle 2. Orcle Eperimentl set nd mesured eecution time Std. Dev
352 New Developments in Rootics, Automtion nd Control 3.4 Eperimentl Results Orcle XE As efore, set of liner progrmming prolems ws selected from the Netli lirry (Orgniztion, 27). The results re presented in Tle 2, where gin, m is the numer of constrints nd n is the numer of decision vriles. The stndrd error is clculted sed on the optiml vlue our solver returned compred to the optiml vlues pulished y Netli.The Orcle eperiments were run on n Intel D865GV ord with 3 GHz Pentium 4 CPU nd 2 G memory running Orcle XE g. Other prmeters nd timing of the eperiment re s descried in 3.2. While the model used in the Orcle implementtion does llow for storge nd simple mnipultion of mtrices lrger thn, it did not solve ll the prolems eperienced in the ysql version. Trunction nd rounding errors creted devince from the pulished optiml vlue, hence the inclusion of stndrd error in Tle 2. For lrger prolems, this sometimes degenerted to n ill-conditioned stte, s with the ysql implementtion nd the lgorithm my not finish or my report incorrect results s with RANDY. Rounding errors were sometimes more of n issue in the Orcle implementtion ecuse it uses the ig vrint of the Simple method when deling with prolems in non-stndrd form. riefly, this involves introducing rtificil vriles to mke ech constrint fesile for the sic solution nd penlizing those rtificil vriles with lrge coefficient in the ojective function, this penlty eing the ig. While this method is esy to implement, it requires more itertions, which introduces more potentil for rounding/trunction errors. 4. Relted Work A vst mount of effort for the estlishment of theory nd prctice is oserved tody. Certin specil cses of liner progrmming, such s network flow prolems nd multicommodity flow prolems re considered importnt enough to hve generted much reserch on specilized lgorithms for their solution (Winston, 994, Thoms H. Cormen nd Stein, 2, Hillier nd Lieermn, 2). A numer of lgorithms for other types of optimiztion prolems work y solving liner progrmming prolems s su-prolems. Historiclly, ides from liner progrmming hve inspired mny of the centrl concepts of optimiztion theory, such s dulity, decomposition, nd the importnce of conveity nd its generliztions (Hillier nd Lieermn, 2). There re pproches considered to fit liner progrmming model, such s integer progrmming nd nonliner progrmming (Alender, 998, Richrd, 99, Hillier nd Lieermn, 2). ut, our reserch focuses on the re of itertive methods for solving liner systems. Some of the most significnt contriutions nd the chin of contriutions uilding on ech other re summrized in (Sd nd vn der Vorst, 2), especilly survey of the trnsition from simple methods to interior-point methods is presented in (Wng, 99). In terms of implementtion techniques, the work of (orgn, 976, Shmir, 987) provided us with introductory sources for reference. There re online mterils such s (Optimiztion Technology Center nd Lortory, 27, Orgniztion, 27) to help us understnd the detils nd pln for eperimentl design.
Liner Progrmming in Dtse 353 The contents of this chpter re etended from the work gthered in (Kwguchi nd Perez, 27), in which the eperimentl performnce of ysql implementtion is shown. A more detiled implementtion of ysql stored procedures cn e found in (Perez, 27). 5. Conclusion The suject of this reserch is to respond lck of dtse tools for solving liner progrmming prolem defined within dtse. We descried the im nd pproch for integrting liner progrmming method into tody s dtse system, with our gol in mind to estlish semless nd trnsprent interfce etween them. As demonstrted, this is fesile y the use of stored procedures, the emerging dtse progrmming stndrd tht llows for comple logic to e emedded s n API in the dtse, thus simplifying dt mngement nd enhncing overll performnce. As summry, contriutions of the discussions presented in this chpter re threefold: First, we present detiled ccount on the methodology nd technicl issues to integrte generl liner progrmming method into reltionl dtses. Second, we present the development s forms of stored procedures for tody s representtive dtse systems. Third, we present n eperimentl performnce study sed on comprehensive system tht implements ll these concepts. Our implementtion of generl liner progrmming solvers is on top of the PHP, ysql, nd Orcle softwre lyers. The eperiments with severl enchmrk prolems etrcted from Netli lirry showed its correct optiml solutions nd sic performnce mesures. However, due to the methods used, rounding errors were still n issue for lrge prolems despite the system hving the cpcity to work with lrge mtrices. We thus pln to continue this reserch in severl directions. Although the Orcle system cn work with lrge mtrices, oth implementtions hve too much rounding error to solve liner progrmming prolems tht would e considered lrge y commercil stndrds. This should e ddressed y the implementtion of more roust method. Overll, the code must e optimized to reduce the eecution time, which could lso e improved y tuning the size nd numer of hsh uckets in the inde. We will perform more eperiments to collect dditionl performnce mesures. Non-liner nd other optimiztion methods should lso e eplored. 6. References Alender, S. (998). Theory of Liner nd Integer Progrmming. John Wiley & Sons, New York, NY. Dntzig, G.. (963). Liner Progrmming nd Etensions. Princeton University Press, Princeton, N.J. Gulutzn, P. (27). ysql 5. New Fetures: Stored Procedures. ysql A, http://www.mysql.com. Gulutzn, P. nd Pelzer, T. (999). SQL-99 Complete, Relly. CP ooks. Hillier, F. S. nd Lieermn, G. J. (2). Introduction to Opertions Reserch. cgrw-hill, 8th edition. Krmrkr, N. K. (984). A new polynomil-time lgorithm for liner progrmming nd etensions. Comintoric, 4:373 395.
354 New Developments in Rootics, Automtion nd Control Kwguchi, A. nd Perez, A. J. (27). Liner progrmming for dtse environment. ICINCO-ICSO 27: 86-9 orgn, S. S. (976). A comprison of simple method lgorithms. ster s thesis, University of Florid. Optimiztion Technology Center, N. U. nd Lortory, A. N. (27). The liner progrmming frequently sked questions. Orgniztion, T. N. (27). The netli repository t utk nd ornl. Perez, A. J. (27). Liner progrmming for dtse environment. ster s thesis, City College of New York. Richrd,. D. (99). Introduction To Liner Progrmming: Applictions nd Etensions. rcel Dekker, New York, NY. Sd, Y. nd vn der Vorst, H. (2). Itertive solution of liner systems in the 2-th century. JCA. Shmir, R. (987). The efficiency of the simple method: survey. nge. Sci., 33(3):3 334. Thoms H. Cormen, Chrles E. Leiserson, R. L. R. nd Stein, C. (2). Introduction to Algorithms, Chpter29: Liner Progrmming. IT Press nd cgrw-hill, 2nd edition. Wlsh, G. R. (985). An Introduction to Liner Progrmming. John Wiley & Sons, New York, NY. Wng, X. (99). From simple methods to interior-point methods: A rief survey on liner progrmming lgorithms. Willim H. Press, Sul A. Teukolsky, W. T. V. nd Flnnery,. P. (22). Numericl Recipes in C++: The Art of Scientific Computing. Cmridge University. Winston, W. L. (994). Opertions Reserch, Applictions nd Algorithms. Duury Press.
New Developments in Rootics Automtion nd Control Edited y Aleksndr Lzinic ISN 978-953-769-2-6 Hrd cover, 45 pges Pulisher InTech Pulished online, Octoer, 28 Pulished in print edition Octoer, 28 This ook represents the contriutions of the top reserchers in the field of rootics, utomtion nd control nd will serve s vlule tool for professionls in these interdisciplinry fields. It consists of 25 chpter tht introduce oth sic reserch nd dvnced developments covering the topics such s kinemtics, dynmic nlysis, ccurcy, optimiztion design, modelling, simultion nd control. Without dout, the ook covers gret del of recent reserch, nd s such it works s vlule source for reserchers interested in the involved sujects. How to reference In order to correctly reference this scholrly work, feel free to copy nd pste the following: Akir Kwguchi nd Andrew Ngel (28). Liner Progrmming in Dtse, New Developments in Rootics Automtion nd Control, Aleksndr Lzinic (Ed.), ISN: 978-953-769-2-6, InTech, Aville from: http:///ooks/new_developments_in_rootics_utomtion_nd_control/liner_progrmmi ng_in_dtse InTech Europe University Cmpus STeP Ri Slvk Krutzek 83/A 5 Rijek, Croti Phone: +385 (5) 77 447 F: +385 (5) 686 66 InTech Chin Unit 45, Office lock, Hotel Equtoril Shnghi No.65, Yn An Rod (West), Shnghi, 24, Chin Phone: +86-2-6248982 F: +86-2-6248982