Solvng Route Plannng Usng Euler Path ransform Y-Chong Zeng Insttute of Informaton Scence Academa Snca awan ychongzeng@s.snca.edu.tw Abstract hs paper presents a method to solve route plannng problem n maze game and waste collecton usng Euler path transform the core technque s med-nteger lnear programmng (MILP). here are three ssues are consdered n the transformaton ncludng the drecton of edge the lmted number of edge and the user-defned startng and endng vertces. he eperment results show that the proposed method s capable of fndng the optmal result for route plannng. Inde erms Euler path route plannng med-nteger lnear programmng I. INRODUCION In 73 the great mathematcan Leonhard Euler publshed a paper to solve the problem of seven brdges of Köngsberg and he translated t nto the graph theory problem []. Recently research workers study Euler path problem t apples on varous felds.e. DNA sequence algnment mnmal de Brun sequence constructon route plannng mage processng etc. For Euleran drected graph wth an arc-labelng Matamala and Moreno proposed the algorthm to construct the mnmal Euleran tral and mnmal de Brun sequence []. Zhang and Waterman used Euler path approach n order to avod the epensve computaton of multple sequence algnment for a large number of DNA sequence [3]. he computatonal tme and the amount of memory sze for Zhang and Waterman s approach become appromately lnear to sze of sequence analyzed. Qan and Yasuhara studed the drawng order recoverng of handwrtten mage to fnd the smoothest path covered all edges of graph [4]. he drecton contet was eploted to calculate the smoothness between the edges and the smoothest path can be found by solvng the optmal Euler path problem. Furthermore Euler path transform can solve the route plannng and the route plannng has varous calls such as the sweepng problem [] the waste collecton plannng [] the perodc vehcle routng problem [7] etc. he obectve of route plannng s to fnd the proper route n a graph. In [] Shh and Ln proposed a multple crtera optmzaton approach whch employs nteger programmng to solve the problem of route plannng for waste collecton. Integer programmng s one knd of lnear programmng whch s defned as the problem of mamzng or mnmzng a lnear functon subected to lnear constrants [8]. In ths paper the proposed method utlzes med-nteger lnear programmng (MILP) to estmate the number of passed edge n order to mplement Euler path transform. hen the proposed method s appled to two real world cases: waste collecton and maze game. he rest of ths paper s organzed as follows: Secton II descrbes the defntons of Euler crcut and Euler path. Sectons III and VI ntroduce the problem descrpton and the proposed method respectvely. he eperment results are shown n Secton V and the conclusons are made n Secton VI. II. EULER CIRCUI AND EULER PAH Euler s well-known theorem s descrbed: f a graph has an Euler crcut then every verte of the graph has even degree []. hs theorem s further eactly descrbed: f every verte of a nonempty graph has even degree and the graph s connected then the graph has an Euler crcut. Hence the graph of Euler crcut must satsfy two condtons: () the graph s nonempty and () all vertces of the graph have the even degrees. he nonempty graph means that a smple path ests to connect any two dstnct vertces of the graph. For the second condton the degree means the number of edge connected to a verte. On the other hand every verte of the graph s connected wth even number of edges.
he Euler path s a sequence of adacent edges from two dfferent vertces (for eample verte v k and verte v l and k l) whch the sequence starts at v k and ends at v l. he corollary s descrbed: there s an Euler path from v k to v l f and only f the graph s connected and those two vertces have odd degrees and the rest of the vertces have even degrees []. Hence the graph of Euler path must satsfy three condtons: () the graph s nonempty () two vertces have odd degrees and (3) the other vertces have even degrees. herefore the dfference between Euler crcut and Euler path s that two vertces have odd degrees. Removng one edge n a graph of Euler crcut the graph wll become an Euler path. III. PROBLEM DESCRIPION he obectve of ths paper s to fnd the optmal route by Euler path transform. he proposed method estmates the number of every edge whch wll be passed through and then our method s appled to two real world cases: waste collecton and maze game. For waste collecton the vehcle drves through the selected streets under the constrant of lowest ol consumpton whch assocates wth the sum of edge length. One-way street and two-way street correspond to drectonal edge and non-drectonal edge respectvely therefore edge drecton must be consdered n case. For maze game the entrance and the et correspond to the startng verte and the endng verte respectvely and those two vertces are set ntally. After mplementng Euler path transform on maze game the resultant of maze game s the lnkage of the edges whch are only passed one tme. IV. PROPOSED MEHOD he nonempty graph s composed of vertces and edges and we defne two types of edges namely non-drectonal edge and drectonal edge. Furthermore the drectonal edges are classfed nto two terms depended on verte namely the mported edge and the eported edge. An eample s shown n Fg.(a) the drectonal edge e 4 connects two vertces v and v 3. he edge e 4 s eported at v 3 thus t s called the eported edge at v 3. On the contrary the edge e 4 s mported at v thus t s called the mported edge at v. In ths study we emphasze on the general form that the graph s composed of both non-drectonal and drectonal edges. An eample s shown n Fg.(a). Euler path transform s conducted va three phases ncludng pseudo edge settng number estmaton of passed edge and edge drecton determnaton. he detal of every phase s descrbed below. A. Pseudo Edge Settng As aforementoned n Secton II the dfference between Euler crcut and Euler path s that two vertces of a graph have odd degrees and the others vertces have even degrees n Euler path. Hence these two vertces are connected wth odd numbers of edges. All edges n the graph of Euler crcut have even degrees. Once we remove one edge n the graph of Euler crcut the graph wll become Euler path because two vertces between the removed edge have odd degrees. Under ths crcumstance we ntally set a pseudo edge between the two specfed vertces as shown n Fg.(a) and the pseudo edge s only passed one tme. After estmatng the number of edge whch s passed through the graph wll become Euler crcut. Subsequently the pseudo edge s removed and then the Euler path s obtaned. It s worth to notce that the drecton of pseudo edge determnes the startng and endng ponts n Euler path. For eample Fg.(a) shows that two vertces v and v 3 are set as the startng verte and the endng verte respectvely. hen we must assgn the drecton of the pseudo edge e ps whch starts from v 3 to v. B. Number Estmaton of Passed Edge Assume that a graph s composed of M edges and N vertces. he varables and n () denote the numbers of the -th non-drectonal edge and the -th drectonal edge whch wll be passed respectvely. he varable A represents the total number of the non-drectonal edge at verte v and B s the dfference of the total number of eported edge subtracts that of mported edge at verte v. For nstance the frst verte v has A 3 and B as shown n Fg.(a). he equatons are defned as follows:
( ) }. {... and } { } { } { subect to mnmze + + + + N q p d B q Α p c M M M () where c s the length of the -th edge. p represents the relatonshp between the non-drectonal edge e and verte v. Smlarly q represents the relatonshp between the drectonal edge e and verte v. d s a non-negatve nteger to ensure that the verte v has even degree. If the -th non-drectonal edge connects the -th verte the varable s set to p ; otherwse p. If the -th drectonal edge connects the -th verte the varable s set to ether q for eported edge or q for mported edge; otherwse q. Once -th edge s the pseudo edge both of p and q are set to zero. o analyze () t s the form of med-nteger lnear programmng; hence the above equatons can be smplfed U L eq eq subect to mnmze b A c () where L and U represent the lower-bound column vector and upper-bound column vector of respectvely. For the eample of Fg.(a) the graph s composed of 4 vertces and 7 edges whch are 4 non-drectonal edges drectonal edges and pseudo edge and the parameters are set as follows: (a) Fg.. Number Estmaton of Passed Edge: Pseudo edge e ps connects two vertces v and v 3 and Euler path wll start at v and end at v 3. (a) Orgnal graph and the gray lne between v and v 4 represents e wll be passed through once agan. [ ]. eq 4 7 7 A d d d K K K (3) [ ] [ ] [ ] [ ] U L eq 3 c b
(a) (c) Fg.. Edge Drecton Determnaton: (a) Intal drectons of the graph the correct drectons of the resultant graph and (c) one of the possble routes. Med-nteger lnear programmng s utlzed to solve (3) we estmate the soluton of whch s [ ]. For t means that only the non-drectonal edge e needs to be passed once agan whch s represented as a gray lne n Fg.. Hence e s passed twce totally. C. Edge Drecton Determnaton he begnnng of edge drecton determnaton s to ntalze the drecton to all non-drectonal edges. o assgn the ntal drecton we assume that the edge e connects two vertces v k and v l and the drecton of the edge starts from v k and v l where k < l. he ntal drecton of Fg. s llustrated n Fg.(a). Let r represent the drecton of the -th edge at the -th verte and ϕ be the modfcaton coeffcent of the -th edge. If r t mples the -th edge s mported at the -th verte. On the contrary f r t mples the -th edge s eported at the -th verte. In addton ϕ means that the drecton of -th edge needs to be reversed; otherwse we mantan the drecton of the -th edge as ϕ. Usng med-nteger lnear programmng ϕ s solved and the edge drecton s determned. he equatons are defned as follows: mamum subect to M ' M ' φ {} ( φ ) and { K N } φ r + B (4)
(a) (c) Fg.3. Route Plannng for Waste Collecton: (a) Red lnes represent the selected streets where the vehcle drves; ntal graph; and (c) the fnal route s found by usng the proposed method. where M' denotes the total number edge of the resultant graph B' s the dfference of the total number of eported edge subtracts that of mported edge at verte v. Consequently Fg.(a) only needs to reverse the drecton of e 3 and the resultant s shown n Fg.. In Fg.(c) t llustrates one of possble route. V. EXPERIMEN RESULS he frst eperment s to fnd the optmal route for vehcle n waste collecton. Fg.3(a) shows that the selected streets llustrated by red lnes. he graph s composed of vertces and 3 non-drectonal edges as dsplayed n Fg.3 and ths graph s transformed to Euler path. he path
(a) Fg.4. Maze Game [9]: (a) Maze and Maze have the same entrances but the ets are dfferent to each other. starts at the top-left corner (v ) and ends at the bottom-left corner (v ). he fnal route plannng s shown n Fg.3(c) and the computng tme s.8 sec. en edges pass twce ncludng e 3 e e e 4 e e 7 e e 4 e 7 and e 9. he path s lsted below v (e )v (e 3 )v 7 (e )v 9 (e 4 )v (e 8 )v (e 4 )v (e 3 ) v 4 (e 7 )v (e )v 7 (e 3 )v (e )v 3 (e )v 8 (e )v 9 (e 4 )v (e 9 ) v 3 (e )v 8 (e )v (e 4 )v (e )v (e 7 )v 4 (e )v 9 (e 9 ) v (e )v 7 (e )v (e 7 )v 4 (e )v (e 9 )v (e 7 )v 7 (e ) v 3 (e )v 8 (e 8 )v 9 (e 9 )v (e 3 )v (e 7 )v 7 (e )v (e 3 ) v 8 (e )v 3 (e 4 )v 4 (e )v (e 8 )v. () In second eperment two mazes are tested. hose two mazes shown n Fgs.4(a) and have the same entrances but the ets are dfferent to each other. he graph of the maze s composed of 4 edges and 43 vertces. he Euler path and fnal route of Fg.4(a) are shown n Fgs.(a) and respectvely. he process tme s. second. Smlarly the Euler path and fnal route of Fg.4 are shown n Fgs.(a) and respectvely. he process tme s 3.3 second. For both Fg.(a) and Fg.(a) the green lne represents the edge has been passed twce or more tmes; the red lne s the fnal desred resultant. Furthermore the resultants of four test mazes and are shown n Fg.7. VI. CONCLUSIONS We propose a method to transform graph to Euler path by usng med-nteger lnear programmng. he user can self-defne the startng verte and the endng verte n the graph. he proposed method solves the problem of route plannng n order to two applcatons: the maze game and the waste collecton. he eperment results demonstrate the effectveness of our method. All programs are eecuted n MALAB software usng a.ghz Pentum-M processor. REFERENCES [] Susanna S. Epp Dscrete mathematcs wth applcatons Wadsworth Calforna 99. [] Y. Zhang and S. Waterman An Euleran path approach to local multple algnment for DNA sequences PNAS vol. no. pp.8-9 Feb.. [3] M. Matamala and E. Moreno Mnmal Euleran tral n a labeled dgraph ech. Report DIM-CMM Unversdad de Chle August 4. [4] Y. Qao and M. Yasuhara Recoverng drawng order from offlne handwrtten mage usng drecton contet and optmal Euler path ICASSP vol. pp.7-78.
[] A. ucker A new applcable proof of the Euler crcut theorem he Amercan Mathematcal Monthly vol.83 no.8 pp.38-4 Oct. 97. [] L.-H. Shh and Y.-. Ln Multcrtera optmzaton for nfectous medcal waste collecton system plannng Practce Perodcal of Hazardous oc and Radoactve Waste Management ASCE vol. 7 no. pp.78-8 3. [7] A. Mngozz he mult-depot perodc vehcle routng problem SARA LNAI 37 (a) Fg.. Resultant of Maze Game: (a) Euler path and fnal route of Fg.4(a). he green lne represents the edge has been passed twce or more tmes; the red lne s the fnal desred resultant. (a) Fg.. Resultant of Maze Game: (a) Euler path and fnal route of Fg.4. he green lne represents the edge has been passed twce or more tmes; the red lne s the fnal desred resultant.
pp.347-3. [8]. S. Ferguson Lnear programmng a concse ntroducton http://www.math.ucla.edu/~tom/lp.pdf. [9] he Maze Generator http://www.bllsgames.com/mazegenerator/ [] BlackDog s Anmal Mazes http://blackdog4kds.com/games/maze/anmal/ nde.html Fg.7. Resultants of four tested mazes [].