Exact Minimum Lower Bound Algorithm for Traveling Salesman Problem

Similar documents
Ones Assignment Method for Solving Traveling Salesman Problem

Analysis of Algorithms

condition w i B i S maximum u i

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Analysis of Algorithms

Data Structures and Algorithms. Analysis of Algorithms

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

Homework 1 Solutions MA 522 Fall 2017

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis

Lecture 1: Introduction and Strassen s Algorithm

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8)

6.854J / J Advanced Algorithms Fall 2008

Big-O Analysis. Asymptotics

Counting the Number of Minimum Roman Dominating Functions of a Graph

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

How do we evaluate algorithms?

Big-O Analysis. Asymptotics

An Efficient Algorithm for Graph Bisection of Triangularizations

AN OPTIMIZATION NETWORK FOR MATRIX INVERSION

arxiv: v2 [cs.ds] 24 Mar 2018

Lecture 5. Counting Sort / Radix Sort

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions:

1.2 Binomial Coefficients and Subsets

CHAPTER IV: GRAPH THEORY. Section 1: Introduction to Graphs

University of Waterloo Department of Electrical and Computer Engineering ECE 250 Algorithms and Data Structures

An Improved Shuffled Frog-Leaping Algorithm for Knapsack Problem

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

Computational Geometry

A Polynomial Interval Shortest-Route Algorithm for Acyclic Network

An Efficient Algorithm for Graph Bisection of Triangularizations

Lecture 18. Optimization in n dimensions

The Graphs of Polynomial Functions

Administrative UNSUPERVISED LEARNING. Unsupervised learning. Supervised learning 11/25/13. Final project. No office hours today

Image Segmentation EEE 508

Strong Complementary Acyclic Domination of a Graph

Octahedral Graph Scaling

A SOFTWARE MODEL FOR THE MULTILAYER PERCEPTRON

CSE 417: Algorithms and Computational Complexity

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

Force Network Analysis using Complementary Energy

9 x and g(x) = 4. x. Find (x) 3.6. I. Combining Functions. A. From Equations. Example: Let f(x) = and its domain. Example: Let f(x) = and g(x) = x x 4

Σ P(i) ( depth T (K i ) + 1),

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Informed Search. Russell and Norvig Chap. 3

Pattern Recognition Systems Lab 1 Least Mean Squares

Solving Fuzzy Assignment Problem Using Fourier Elimination Method

CS 683: Advanced Design and Analysis of Algorithms

15-859E: Advanced Algorithms CMU, Spring 2015 Lecture #2: Randomized MST and MST Verification January 14, 2015

ECE4050 Data Structures and Algorithms. Lecture 6: Searching

Fuzzy Membership Function Optimization for System Identification Using an Extended Kalman Filter

Fuzzy Minimal Solution of Dual Fully Fuzzy Matrix Equations

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

Examples and Applications of Binary Search

A Generalized Set Theoretic Approach for Time and Space Complexity Analysis of Algorithms and Functions

New Results on Energy of Graphs of Small Order

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames

COMP Parallel Computing. PRAM (1): The PRAM model and complexity measures

Convergence results for conditional expectations

27 Refraction, Dispersion, Internal Reflection

Civil Engineering Computation

Major CSL Write your name and entry no on every sheet of the answer script. Time 2 Hrs Max Marks 70

prerequisites: 6.046, 6.041/2, ability to do proofs Randomized algorithms: make random choices during run. Main benefits:

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

Improved Random Graph Isomorphism

Counting Regions in the Plane and More 1

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n))

Analysis of Algorithms

Chapter 3 Classification of FFT Processor Algorithms

The number n of subintervals times the length h of subintervals gives length of interval (b-a).

Math Section 2.2 Polynomial Functions

Relationship between augmented eccentric connectivity index and some other graph invariants

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Recursion. Recursion. Mathematical induction: example. Recursion. The sum of the first n odd numbers is n 2 : Informal proof: Principle:

A Note on Chromatic Transversal Weak Domination in Graphs

Alpha Individual Solutions MAΘ National Convention 2013

Creating Exact Bezier Representations of CST Shapes. David D. Marshall. California Polytechnic State University, San Luis Obispo, CA , USA

LU Decomposition Method

The isoperimetric problem on the hypercube

Super Vertex Magic and E-Super Vertex Magic. Total Labelling

Inductive Definition to Recursive Function

BOOLEAN MATHEMATICS: GENERAL THEORY

Elementary Educational Computer

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

A study on Interior Domination in Graphs

COMP 558 lecture 6 Sept. 27, 2010

The Adjacency Matrix and The nth Eigenvalue

On Infinite Groups that are Isomorphic to its Proper Infinite Subgroup. Jaymar Talledo Balihon. Abstract

Dynamic Programming and Curve Fitting Based Road Boundary Detection

INTERSECTION CORDIAL LABELING OF GRAPHS

A Note on Least-norm Solution of Global WireWarping

Redundancy Allocation for Series Parallel Systems with Multiple Constraints and Sensitivity Analysis

Reversible Realization of Quaternary Decoder, Multiplexer, and Demultiplexer Circuits

Transcription:

Exact Miimum Lower Boud Algorithm for Travelig Salesma Problem Mohamed Eleiche GeoTiba Systems mohamed.eleiche@gmail.com Abstract The miimum-travel-cost algorithm is a dyamic programmig algorithm to compute a exact ad determiistic lower boud for the geeral case of the travelig salesma problem (TSP). The algorithm is preseted with its mathematical proof ad asymptotic aalysis. It has a ( 2 ) complexity. A program is developed for the implemetatio of the algorithm ad successfully tested amog well kow TSP problems. Keywords Travelig Salesma Problem; Big O otatio; exact algorithm

. Itroductio The travelig salesma problem (TSP) is defied by a give fiite umber of () cities alog with the cost of travel betwee each pair of them. It is required to fid the tour with least cost to visit all of the cities ad returig to the startig poit. Each city has to be visited oce ad oly oce (Applegate, et al. 2006). The travel costs are asymmetric i the sese that travelig from city a to city b does ot cost the same as travelig from b to a. TSP is a prototype of hard combiatorial optimizatio problem where the possible solutios are (-)! ad is cosidered NP-hard ad NP-complete (Jugickel 2008), it is mathematically preseted as a full graph with () odes. The purpose of this research is to compute a miimum boud of the TSP i a exact algorithm for the geeral case of the problem which is asymmetrical data where cost(u, i) cost(i, u ). The mathematical ad asymptotic aalysis of the algorithm are preseted. 2. Data Structure The TSP is composed of () odes (V) ad ( 2 ) edges (E). A weighted complete directed graph G = (V, E), where V = {, 2,, }, ad E = {(u, v) u, v V} ad {cost(u, v) R} (Body ad Murty 976). 2. Iput The iput data, which is the cost array, is stored i array with the format [from-ode, toode, cost]. From-ode ad to-ode have iteger type, while cost type is real. The size of the iput array is (3 2 ) ad its structure is show i Table. The iput array is sorted by from-ode the to-ode i order to fast seek for miimum cost for each ode from both directio. Table Iput data structure From-Node To-Node Cost 2 2 2 2

2.2 Miimum Travel Array The Miimum-Travel-Array is the mai output of this algorithm. It is (5 ) i size. The first ad secod colums are for icidet cost, ad its icidet ode. Third is the ID of the ode. This colum is sorted i ascedig order for all the odes ID. The, the fourth ad fifth colums are the outgoig ode, ad its outgoig cost (Eleiche, Markus 200). The algorithm is based o creatig the Miimum Travel Array for the problem. It has the same structure as the followig Table 2. Table 2 Miimum Travel Array Icidet Cost Icidet Node (u) Node ID Outgoig Node (v) Outgoig Cost ICost u i v OutCost 3. Mai Idea The idea of this algorithm is to divide the problem ito two mai subproblems, icidet side ad outgoig side. The icidet side is where the ode (i) is the arrival destiatio from aother ode (u). The outgoig side is to depart from the ode (i) to aother ode (v), as show i Figure. Figure Icidet ad outgoig odes 3

For each subproblem, the miimum cost is determied for each ode (i). From the icidet side, the ode (u) with the miimum cost (ICost) to arrive to ode (i) is determied ad stored iside the mai array. From the outgoig side, the ode (v) with the miimum cost (OutCost) to depart from ode (i) is determied ad stored iside the mai array. ICost = E(u, i) such that E(u, i) = mi E([, ], i) OutCost = E(i, v) such that E(i, v) = mi E(i, [, ]) mi Travel Cost for ode (i) = micost = ICost + OutCost After the Miimum Travel Array is computed ad completed, each ode is aalyzed separately to esure if the ode (i) has the same ode as icidet ad outgoig ode. This is ot allowed by the defiitio of TSP, which states that each ode is visited oly oce (Eleiche 205). I case ode(u) = ode(v) for ode(i), the secod cost is computed from each side ad the miimum travel cost for the ode is computed, to prevet same ode to be i both sides for ode (i). 3. Prevet same ode I case where ode (u) = ode (v), same ode has the miimum cost to arrive to ode (i) ad to depart from it, aother computatio is required. The secod ode (u2), from icidet side, is selected such has it has secod miimum cost (ICost2) to arrive to ode (i), ad ode (v2) from outgoig side which has the secod miimum cost (OutCost2) to depart from ode (i), as show i Figure 2. It is worth to ote that although ode (u) = ode (v) = ode (a), however, ICost OutCost, as the problem is ot symmetrical. Figure 2 Secod miimum cost for Node (i) 4

ICost2 = E(u2, i) such that E(u2, i) = mi E([, ], i) && E(u2, i) E(u, i) OutCost2 = E(i, v2) such that E(i, v2) = mi E(i, [, ]) && E(v2, i) E(v, i) Let micost = Miimum travel cost for same ode case micost = mi[(icost + OutCost2), (ICost2 + OutCost), (ICost2 + OutCost2)] Case (): micost = (ICost + OutCost2) I this case, the Miimum-Travel-Array will be filled as follows [ICost, u,i,v2,outcost2]. Case (2): micost = (ICost2 + OutCost) I this case, the Miimum-Travel-Array will be filled as follows [ICost2, u2,i,v,outcost]. Case (3): micost = (ICost2 + OutCost2) I this case, the Miimum-Travel-Array will be filled as follows [ICost2, u2,i,v2,outcost2]. 4. Miimum boud Algorithm for TSP Iput: A weighted complete directed graph G = (V, E), where V = {, 2,, }, ad E = {(u, v) u, v V} ad {cost(u, v) R} such that { cost(u, v) 0} ad cost(u, v) cost(v, u) Output: The miimum travel cost array for each vertex ad the miimum lower boud for the cost to visit each vertex i V oly oce.. Class MiTravel{ICost, From_Node, Node_ID, To_Node, OutCost} 2. For each vertex i V 3. MiTravel[i,3] i 4. MiTravel[i,2] u of miimum cost of E = {(u, i) u V} 5. MiTravel[i,] miimum cost of E = {(u, i) u V} 6. MiTravel[i,4] v of miimum cost of E = {(i, v) v V} 7. MiTravel[i,5] miimum cost of E = {(i, v) v V} 8. if (MiTravel[i,2] == MiTravel[i,4] ) the Prevet(i) 9. TSPLowerBoud() 5

Procedure Prevet(i). u2 u of secod miimum cost of E = {(u, i) u V} 2. ICost2 secod miimum cost of E = {(u2, i) u V} 3. v2 v of secod miimum cost of E = {(i, v) v V} 4. OutCost2 secod miimum cost of E = {(i, v2) v V} 5. C = MiTravel[i,] + OutCost2 6. C2 = ICost2 + MiTravel[i,5] 7. C3 = ICost2 + OutCost2 8. C = mi[c, C2, C3] 9. Case (): C = C 0. MiTravel[i,4] v2. MiTravel[i,5] OutCost2 2. Case (2): C = C2 3. MiTravel[i,2] u2 4. MiTravel[i,] ICost2 5. Case (3): C = C3 6. MiTravel[i,2] u2 7. MiTravel[i,] ICost2 8. MiTravel[i,4] v2 9. MiTravel[i,5] OutCost2 Procedure TSPLowerBoud. for i to 2. Sum_i = Sum_i + MiTravel [i,] 3. Sum_out = Sum_out + MiTravel [i,5] 4. If (Sum_i > Sum_out) 5. the TSPLowerBoud = Sum_i 6. else TSPLowerBoud = Sum_out 5. Proof The miimum icidet cost (Icost) is the least cost to arrive to ode (i), ad (OutCost) is the least cost to depart from it. It is ot possible to travel through ode (i) with a cost less tha micost = ICost + OutCost. The Miimum-Travel-Array presets miimum exact cost to travel each ode, ad by summatio of costs from both sides, exact miimum boud for the TSP is computed. Cosider that : (C = a), the: C = a = a + b b (where {(a, b) 0 ad a b } C = a = (a b) + b {(a b) 0 }, the 6

C b I the previous example, (C) is the required cost for the miimum cycle ad it is ukow, ad it equals to the quatity (a). The quatity (b) is the miimum travel cost for each vertex ad it is a kow quatity. It is evidet that both {(a, b) > 0 ad a b } by addid ad sudtractig (b) still the equatio is valid, ad still (a-b) is ukow but {(a b) 0 }. This meas that (C) must be greater tha (or equal) to (b). By applyig this cocept to the miimum travel cost ad assumig that the Miimum- Travel-Array i Table 2 represets the tour of least cost, the: C TSP = C TSP i = C TSP out C TSP = C TSP i = (C TSP i ICost) + ICost C TSP = C TSP out = (C TSP out OutCost) + OutCost I the last equatio, for each vertex (i), the miimum icidet cost (ICost) was added ad removed which will ot affect the value of the equatio. The, the value of the icidet cost to the vertex (i) from miimum cycle (C TSP i ) is represeted as the kow miimum icidet cost (ICost) i additio to aother quatity (C TSP i ICost). It is evidet that the quatity (C TSP i ) is ukow, while the other quatity (ICost) is well kow. C TSP ICost 0 ( kow quatity computed by algorithm) C TSP OutCost 0 ( kow quatity computed by algorithm) ICost, ICost > OutCost TSPLowerBoud = OutCost, OutCost ICost 7

Where C TSP is the cost of the required mimimum cycle (ukow) C TSP i is the cost to arrive to the vertex(i)from icidet directiofrom the mimimum cycle C TSP out is the cost to leave the vertex(i)from outgoig directio from the mimimum cycle ICost is the mimimum cost to arrive to the vertex (i) from icidet directio OutCost is the mimimum cost to depart from the vertex(i)from outgoig directio C TSP is ukow C TSP i, C TSP out are ukow for each vertex(i) ICost & OutCost are kow for each vertex(i) The, C TSP ICost ad C TSP OutCost The miimum boud for the geeral case of TSP is the higher from sum of icidet ad outgoig cost. It is evidet that the Miimum-Travel-Array does ot represet the required least tour for TSP, ad may odes will have travel cost higher tha their miimum-travel-cost withi the least tour. However, the Miimum-Travel-Array is importat characteristic for the TSP, ad provides exact miimum boud that the least cost will exceed. 6. Asymptotic Aalysis ad Algorithm Classificatio The Miimum Travel Cost Algorithm for the Travelig Salesma Problem has the followig characteristics: ) It divides the problem ito two separate subproblems: icidet side ad outgoig side, solvig each oe separately. 2) The algorithm is recursive, it computes the miimum icidet ad outgoig cost for each ode 3) It has iterative part, i which for each ode the miimum cost is computed for the whole problem 4) It memoizes the output for each step for further use. 8

From the above characteristics, the algorithm ca be classified as Dyamic Programmig (DP) algorithm (Bertsekas 2005). 6. Mai Fuctio asymptotic aalysis The mai fuctio fids the miimum cost for each side for the TSP. The highest cost is for the miimum cost which rus () time for each ode, makig it ( 2 ) for each side, as show i Table 3. If the iput array of data is ot sorted, the it will cost ( 3 ). The Prevet(i) fuctio is executed oly whe both icidet ad outgoig odes are the same. This ca ever happe i best coditio ad ca appear at each ode i worst coditio. Table 3 Asymptotic aalysis of mai fuctio Whole Each Problem Node Fuctio Complexity Yes Yes MiTravel[i,3] i Yes Yes MiTravel[i,2] u of miimum cost of E = {(u, i) u V} Yes Yes MiTravel[i,] miimum cost of E = {(u, i) u V} MiTravel[i,4] v of miimum cost of E Yes Yes = {(i, v) v V} MiTravel[i,5] miimum cost of E = Yes Yes {(i, v) v V} Yes Yes if (MiTravel[i,2] == MiTravel[i,4] ) May be May be Prevet(i) Worst coditio = 2 Best Coditio = 0 o o TSPLowerBoud() 2 2 6.2 Prevet(i) asymptotic aalysis This fuctio computes the secod miimum cost for each ode (Kavitha, et al. 2008). Similarly to mai fuctio, the miimum secod cost has cost of (-), as show i Table 4. 9

Table 4 Asymptotic aalysis for Prevet(i) fuctio Each Node Fuctio Complexity Yes u2 u of secod miimum cost of E = {(u, i) u V} Yes ICost2 secod miimum cost of E = {(u2, i) u V} - Yes v2 v of secod miimum cost of E = {(i, v) v V} Yes OutCost2 secod miimum cost of E = {(i, v2) v V} - 6.4 TSPLowerBoud() asymptotic aalysis This fuctio is simple ad compute the total value for the miimum-travel-cost as show i Table 5, by direct additio with cost of (). Table 5 Asymptotic aalysis for TSPLowerBoud() fuctio Each Node Fuctio Complexity Yes Sum_i = Sum_i + MiTravel [i,] Yes Sum_out = Sum_out + MiTravel [i,5] 6.5 Algorithm asymptotic aalysis The algorithm has a upper boud of O( 2 ) before arrivig to Prevet(i) fuctio. This fuctio ca be executed () times i worst coditio ad ever executed i best coditio. It has (-) complexity for each ode separately, leadig to complexity of ((-)) same O( 2 ) too. 7. Applicatio A C++ program was implemeted for this algorithm to test its validity amog some TSP problems with (best) kow solutios. The TSPLIB website (http://www.math.uwaterloo.ca/tsp/problem/outliks.html, December 205) provides sample TSP problems with best kow solutios i order to test the validity of proposed solutios for this iterestig problem. This research tested three problems which are 0

(br7, ry48p, ft53) as show i Table 6. (http://www.math.uwaterloo.ca/tsp/college/). The fourth problem is defied at Table 6 Applicatios of algorithm Problem Name Size () Best kow solutio Icidet Cost Outgoig Cost Miimum Cost br7 7 39 0 24 24 ry48p 48 4422 2987 964 2987 ft53 53 6905 3580 3989 3989 College 647 647 47,49,705 25,65,500 42,777,207 42,777,207 As show i Table 6, all the four tested problems had the computed lower boud less tha best-kow-solutio. This test prove practically the validity of the algorithm. 8. Coclusio This article preseted the Miimum-Travel-Cost Algorithm for computig a exact lower boud for the geeral case of Travelig-Salesma-Problem. It computes the miimum cost to arrive to each ode ad depart from it. The, it compute the total cost to arrive to all odes, ad depart from all odes. The highest from arrival ad departure costs is the lower boud for the problem. The mathematical proof for the algorithm was preseted. The algorithm is classified as dyamic programmig algorithm with complexity of O( 2 ). The algorithm was implemeted ito a program ad tested amog well kow cases for existig problems, ad the results were cosistet ad validate the algorithm. It does ot solve the Travelig-Salesma-Problem, however it provides a exact ad determiistic lower boud for the geeral case. Refereces Applegate, David, Robert Bixby, Vasek Chvátal, ad William Cook. The Travelig Salesma Problem: A Computatioal Study. Priceto Uiversity Press, 2006. Bertsekas, Dimitri. Dyamic Programmig ad Optimal Cotrol. Athea : Athea Scietific, 2005. Body, J, ad U Murty. Graph Theory with Applicatios. Lodo: Macmilla, 976.

Eleiche, Mohamed. "Applyig Miimum Travel Cost Approach o 43 Nodes Travellig Salesma Problem." Pure ad Applied Mathematics Joural 4, o. (205): 9-23. Eleiche, Mohamed, ad Bela Markus. "Applyig Miimum Travel Cost Approach O 7 Nodes Travellig Salesma Problem." Geomatikai Közleméyek XIII, o. 2 (200): 5-22. Jugickel, D. " Graphs, Networks, ad Algorithms." Spriger, 2008: 433-472. Kavitha, Telikepalli, Kurt Mehlhor, Dimitrios Michail, ad Katarzya Paluch. "A O(m2) Algorithm for Miimum Cycle Basis of Graphs." Algorithmica, 2008: 333 349. 2