Joural of mathematics ad computer sciece 0 (0), 58-65 Oes Assigmet Method for Solvig Travelig Salesma Problem Hadi Basirzadeh Departmet of Mathematics, Shahid Chamra Uiversity, Ahvaz, Ira Article history: Received April 0 Accepted May 0 Available olie May 0 basirzad@scu.ac.ir Abstract This paper presets a approach amely, oes assigmet method, for solvig the travelig salesma problem. We have previously used this method for the assigmet problem. We have slightly modified the procedure to get a tour of the travelig salesma problem. First we defie the distace matrix, the by usig determiat represetatio we obtai a reduced matrix which has at least oe i each row ad each colum. The by usig the ew method, we obtai a optimal solutio for travelig salesma problem by assigig oes to each row ad each colum. The ew method is based o creatig some oes i the distace matrix ad the try to fid a complete solutio to their oes. At the ed, this method is illustrated with some umerical examples. Keywords: Assigmet problem, Liear iteger programmig, travelig salesma problem.. Itroductio A importat topic, put forward immediately after the trasportatio problem, is the assigmet problem. This is particularly importat i the theory of decisio makig. The assigmet problem is oe of the earliest applicatio of liear iteger programmig problem. Differet methods have bee preseted for assigmet problem ad various articles have bee published o the subject. See [], [5] ad [7] for the history of these methods. Recetly, we itroduce a quick method to calculate the super efficiet poit i multi objective assigmet problems []. A cosiderable umber of methods has bee so far preseted for assigmet problem i which the Hugaria method is more coveiet method amog them. This iterative method is based o add or subtract a costat to every elemet of a row or colum of the cost matrix, i a miimizatio model ad create some zeros i the give cost matrix ad the try to fid a complete assigmet i terms of zeros. By a complete assigmet for a cost matrix, we mea a assigmet pla cotaiig exactly assiged idepedet zeros, oe i each row ad oe i each colum. The mai cocept of assigmet
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 problem is to fid the optimum allocatio of a umber of resources to a equal umber of demad poits. A assigmet pla is optimal if optimizes the total cost or effectiveess of doig all the jobs. Oe of the problems similar to that a assigmet problem is the travelig salesma problem (TSP). Historically the TSP deals with fidig the shortest tour i a -city situatio where each city is visited exactly oce. I this problem, travelig salesma wats to miimize the total distace traveled ( or time or moey) durig his visit of cities. d, i,,..., is the distace of i th ode to j th ode. Note that d whei j, i.e. we do ot produce the item i agai after i. The idividual set up costs ca be arraged i the form of a square matrix. A travelig salesma problem is to determie a set of elemets of this matrix, oe i each row ad oe i each colum, so as to miimize the sum of elemets determied above. Travelig salesma problem is similar to the assigmet problem, but here two extra restrictios are imposed. The first restrictio is that we ca ot select the elemet i the leadig diagoal as we do ot follows i agai by i. The secod restrictio is that we do ot produce a item agai util all the items are produced oce. The secod restrictio meas o city is visited twice util the tour of all the cities is completed. This paper attempts to propose a method, amely oes assigmet method, for solvig travelig salesma problem, which is differet from the precedig methods. This method is a heuristic method which we applied it for solvig assigmet problem, see []. Mathematically a travelig salesma problem ca be stated as follows: Optimize i j dx subject to x, i,..., j x, j,..., () i x 0 or, i,...,, j,.... The first ad sec od restrictio. Where d is the distace from city i to city j, ad x is to be some positive iteger or zero, ad the oly possible iteger is oe, so the coditio of x 0 or, is automatically satisfied. Associated to each travelig salesma problem there is a matrix called distace matrix [ d ] where d is the distace from city i to city j. I this paper we call it distace matrix, ad represet it as follows: () 3 d d d d d d d d d d d d 3 3 3 which is always a square matrix, thus each city ca be assiged to oly oe city. I fact ay solutio of this problem will cotai exactly m o-zero positive idividual allocatios. 59
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 A customary ad coveiet method, termed as "assigmet algorithm" has bee developed for such problems. This iterative method is kow as Hugaria assigmet method. It is based o add or subtract a costat to every elemet of a row or colum of the cost matrix i a miimizatio model, ad create some zeros i the give cost matrix ad the try to fid a complete assigmet i terms of zeros. I fact our aim is to create some oes i place of zeroes o distace matrix, ad try to assig them i our problem.. Our approach for solvig travelig salesma problem This sectio presets a method to solve the travelig salesma problem which is differet from the precedig method. We call it "oes assigmet method", because of makig assigmet i terms of oes. The ew method is based o creatig some oes i the distace matrix ad the try to fid a complete solutio i terms of oes. By a complete solutio we mea a assigmet pla cotaiig exactly m assiged idepedet oes, oe i each row ad oe i each colum. Now, cosider the distace matrix where d is the distace of i th city to j th city. 3 d d d3 d d d d3 d d d d3 d The ew algorithm is as follows: let (-) be a travelig salesma problem i which the objective fuctio ca be miimized or maximized. Step I a miimizatio (maximizatio) case, fid the miimum ( maximum) elemet of each row i the distace matrix (say a i ) ad write it o the right had side of the matrix. d d d d a d d d d a d d d d a 3 3 3 The divide each elemet of i th row of the matrix by a i. These operatios create at least oe oes i each rows. d a d a d a d a a d a d a d a d a a d a d a d a d a a 3 3 3 I term of oes for each row ad colum do assigmet, otherwise go to step. 60
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 Step Fid the miimum ( maximum) elemet of each colum i distace matrix ( say b j ), ad write it below j th colum. The divide each elemet of j th colum of the matrix by b j. These operatios create at least a oe i each colum. Make assigmet i terms of oes. If o feasible assigmet ca be achieved from step () ad () the go to step 3. d a b d a b d a b d a b a d a b d a b d a b d a b a d a b d a b d a b d a b a b b b b 3 3 3 3 3 3 3 Note: I a maximizatio case, the ed of step we have a fuzzy matrix, which all elemets are belog to 0,, ad the greatest elemet is oe [6]. Step 3 Draw the miimum umber of lies to cover all the oes of the matrix. If the umber of drowed lies less tha, the the complete solutio is ot possible, while if the umber of lies is exactly equal to, the the complete solutio is obtaied. Step If a complete solutio is ot possible i step 3, the select the smallest (largest) elemet (say those which do ot lie o ay of the lies i the above matrix. The divide by d ) out of d each elemet of the ucovered rows or colums, which d lies o it. This operatio create some ew oes to this row or colum. If still a complete optimal solutio is ot achieved i this ew matrix, the use step ad 3 iteratively. By repeatig the same procedure the optimal solutio will be obtaied. Priority plays a importat role i this method, whe we wat to assig the oes. Priority rule For maximizatio (miimizatio) travelig salesma problem, assig the oes o the rows which have greatest (smallest) elemet o the right had side, respectively. If a tour is ot reached, so do the assigmet that will make a tour. We ote that if a tour does ot occur, the assig the elemet immediately greater tha oe. Oe questio arise here, what to do with o square matrix? To make square, a o square matrix, we add oe artificial row or colum which all elemets are oe. Thus we solve the problem with the ew matrix, by usig the ew method. The matrix after performig the steps reduces to a matrix which has oes i each row ad each colum. So, the optimal solutio has bee reached.. Mathematical cocept of the subject 6
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 Oe of the operatios associated with matrices is calculatio of scalar value kow as the determiat of a square matrix [8]. Here we do ot wat calculate the determiat of a matrix, oly we wat to use the properties of the determiat operator, whe we use customary ad commo otatio, for the determiat of the matrix. Here we use the otatio A, for represetatio of the determiat of matrix A. Several basic properties of determiat are useful but oe of them useful for this method. This is factorizatio. Propositio : Whe (a o zero scalar) is a factor of a row (colum) of A, the it is also a factor of A. That is A. A Which A is the matrix A with factored out of a row or a colum of A. If A is a matrix ad i, i,,..., is a factor of i th row of A, the.... is also a factor of A. That is A. A..... A.... Similarly, if A is a matrix ad j, j,,..., is a factor of j th colum of A, the.... is also a factor of A. A. A.... A.... which A.... is the matrix A with j factored out of j th colum, j,,...,. Propositio : If A is a matrix ad is a factor of rows of A, ad is a factor of colums of A, the. is also a factor of A. That is, A. A. which A is the matrix A with factored out of a row ad factored out of a colum of A. Note : I fact, whe we apply the oes assigmet method to solve a assigmet problem, we use the above propositios to reduce the matrix of the problem ito a matrix which has eough oes i each rows ad each colums to assig them. Here we emphasis that the locatios of the oes are importat to assig, ad whe we wat to calculate the objective fuctio of the problem, we use the real values of the assiged elemets i iitial distace matrix. 3. Numerical examples The followig examples may be helpful to clarify the proposed method: Example : Cosider the followig travelig salesma problem. Desig a tour to five cities to the salesma such that miimize the total distace. Distace betwee cities is show i the followig matrix. 6
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 3 5 0 3 6 9 5 5 3 9 7 8 7 3 5 3 6 5 Fid the miimum elemet of each row i the distace matrix (say a i ) ad write it o the right had side of the matrix, as follows: 3 5 0 3 6 9 3 5 5 3 9 7 8 7 3 5 3 6 5 The divide each elemet of i th row of the matrix by a i.these operatios create some oes to each row, ad the matrix reduces to followig matrix. 3.3 3 3.5.5.5.75 7 3.5 3.5 Now fid the miimum elemet of each colum i distace matrix ( say b j ), ad divide each elemet of j th colum of the matrix by b j. This operatio create some oes to each row ad each colum. 3.3. 3 3.5.5..5 7 3.5 3.8 The miimum umber of lies required to pass through all oes is, ad the miimum elemet of the ucovered is.8 o 5th row, so divide each elemet of 5th row of the matrix by.8. 63
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65 3.3. 3 3.5.5..5 7 3.05 0.7. Now, miimum umber of lies required to pass through all the oes of the matrix is 5. So, the complete solutio is possible, ad we ca assig the oes, it is based o priority rule. Priority rule is assigig oe o the rows which have the smallest elemet o the right had side, respectively. The details of this program are as follows: City assigs to City 3 distace 3 City assigs to City 5 distace City 3 assigs to City distace 7 City assigs to City distace City 5 assigs to City distace 3 so the optimal assigmet has bee reached, ad the optimal path is,3, 3,,,,,5, 5, ad total distace accordig to this pla is 6. Example : Cosider the followig travelig salesma problem. Desig a tour to five cities to the salesma such that miimize the total distace. Distace betwee cities is show i the followig matrix. 3 5 0 6 3 5 3 3 6 6 7 5 7 9 8 Fid the miimum elemet of each row i the distace matrix (say a i ) ad divide each elemet of i th row of the matrix by matrix. a i. These operatios create oes to each rows, ad the matrix reduces to followig.75.5 3 3.5.5 3.5 3.5 3.5.75.8..7 7 Now the miimum elemet of secod colum is.8. Divide each elemet of secod colum by.8 ad the miimum elemet of th colum is.5. Divide each elemet of th colum by.5. These operatios create some oes o secod ad th colum, ad the reduced matrix is as follows: 6
Hadi Basirzadeh / J. Math. Computer Sci. 0 (0), 58-65.8.5 3.5 3.5.5 3.5.73.75.. 7 The miimum umber of lies required to pass through all the oes of the matrix is 5. So, the complete solutio is possible, ad we ca assig the oes, it is based o priority rule. Priority rule is assigig oe o the rows which have the smallest elemet o the right had side, respectively. The details of this program are as follows: City assigs to City 5 distace City assigs to City distace 3 City 3 assigs to City distace 3 City assigs to City 3 distace City 5 assigs to City distace 9. So the optimal path has bee reached, 35, ad total distace accordig to this pla is 3. Refereces: [] Hadi Basirzadeh, Oes assigmet method for solvig assigmet problems, Applied Mathematical Scieces, vol 6, o. 7, 37-355 (0). [] Hadi Basirzadeh, Vahid Morovati, Aabbas.Sayadi, A quick method to calculate the super-efficiet poit i multi-objective assigmet problems, TJMCS, vol 0, o. 3, 57-3 (0). [3] M. S. Bazarra, Joh J. Jarvis, Haif D. Sherali, Liear programmig ad etwork flows, (005). [] B. s. Goel, S. K. Mittal, Operatios Research, Fifth Ed, (98) 05-6. [5] Hamdy A. Taha, Operatios Research, a itroductio, 8th Ed. (007). [6] H. J. Zimmerma, Fuzzy set theory ad its Applicatios, third Ed., Kluwer Academic, Bosto, 996. [7] AshumaSahu, RudrajitTapador, Solvig the assigmet problem usig geetic algorithm ad simulated aealig, IJAM, (007). [8] Shayle R. Searle, Matrix algebra useful for statistics, Joh Wiley, (006). 65