1 MERLIN A polynomial solution for the Traveling Salesman Problem Dr. Joachim Mertz, 2005.

Slides:



Advertisements
Similar presentations
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Advertisements

Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Computational problems, algorithms, runtime, hardness
Applied Discrete Mathematics Week 12: Trees
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Math443/543 Mathematical Modeling and Optimization
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Maximum matching Max Flow Shortest paths Min Cost Flow Linear Programming Mixed Integer Linear Programming Worst case polynomial time by Local Search.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
2-Layer Crossing Minimisation Johan van Rooij. Overview Problem definitions NP-Hardness proof Heuristics & Performance Practical Computation One layer:
Linear Programming Applications
NP-complete and NP-hard problems. Decision problems vs. optimization problems The problems we are trying to solve are basically of two kinds. In decision.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
GRAPH Learning Outcomes Students should be able to:
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234 Lecture 1 -- (14-Jan-09) “Introduction”  Combinatorial Optimization.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Graph Theory Topics to be covered:
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Chapter 7 Transportation, Assignment & Transshipment Problems
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
P, NP, and Exponential Problems Should have had all this in CS 252 – Quick review Many problems have an exponential number of possibilities and we can.
Chapter 4 Linear Programming: The Simplex Method
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
§1.4 Algorithms and complexity For a given (optimization) problem, Questions: 1)how hard is the problem. 2)does there exist an efficient solution algorithm?
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Branch-and-Cut Valid inequality: an inequality satisfied by all feasible solutions Cut: a valid inequality that is not part of the current formulation.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CIRCUITS, PATHS, AND SCHEDULES Euler and Königsberg.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
LIMITATIONS OF ALGORITHM POWER
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Chapter 13 Backtracking Introduction The 3-coloring problem
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
IE 312 Review 1. The Process 2 Problem Model Conclusions Problem Formulation Analysis.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from P. Van Hentenryck’s course.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
More NP-Complete and NP-hard Problems
EMIS 8373: Integer Programming
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
The minimum cost flow problem
Traveling Salesman Problem
1.3 Modeling with exponentially many constr.
ICS 353: Design and Analysis of Algorithms
Integer Programming (정수계획법)
1.3 Modeling with exponentially many constr.
Integer Programming (정수계획법)
Presentation transcript:

1 MERLIN A polynomial solution for the Traveling Salesman Problem Dr. Joachim Mertz, 2005

2 Scope This presentation provides a concise overview about the MERLIN algorithm: –Introduction –Idea and basic features –Description of the optimization model –Detailed definition of variables and constraints –Conclusion For more detailed information please refer to [1]

3 The Traveling Salesman Problem Given: n cities/stations {0,…,n-1} Distances c ab ≥ 0 for each disjoint pair a,b of stations Task: Find a roundtrip of minimal total length visiting each of the n stations exactly once

4 The P=NP Question The Travelling Salesman Problem (TSP) is NP-complete NP-complete problems are known to require an exponential number of computational steps (e.g. 2 n or n!) on a deterministic machine. So far there is no algorithm which is able to solve a NP- complete problem by a polynomial number of steps (e.g. n 3 or n 5 ) NP-complete problems are considered as the ‘hardest’ problems within the class NP: If an algorithm would be able to solve any NP-complete problem by a polynomial number of steps, the class NP would collapse and would be part of the problem class P of problems solvable in polynomial time (P=NP)

5 MERLIN: Basic features MERLIN is based on linear programming A set of suitable variables and linear constraints defines an optimization model transforming the TSP into a linear programming problem Thus, the model parameters are used like real values though TSP is an integer optimisation problem The model requires only a polynomial number of variables and constraints

6 Description Linear Optimization Min Considering a set of linear constraints: a 11 x 1 + a 12 x a 1p x p  ( , =) b 1 ……. a m1x1 + a m2x a mp x p  ( , =) b m with

7 MERLIN Model: First definitions Input parameters: –n stations (0…n-1) –cost matrix C with the distances c ij  0 of the stations i,j (0  i,j  n-1, i  j). Graph Model (see figure next page): –Nodes labelled as (, ) = (i,k)  station i is at the k th position of the salesman roundtrip. –Edges labelled as (,, ) = (i,j,k)  The edges are represented by optimisation variables x i_j,k ( 0  x i_j,k  1) signalling the presence of a directed edge with start station i and end station j at position k in the graph. E.g. if variable x i_j,k =1 then the edge from station i to station j is at the k th position of the salesman’s roundtrip. W.l.o.g. we take station 0 as start and end station of the roundtrip (the salesman home office)

8 Graph model

9 Some other definitions a route is a consecutive sequence of n edges from start-node (0,0) to end-node (0,n), in which the n edges are represented by n variables x i0_j0,0... x in-1_jn-1,n-1 a route is consecutive when it is using exactly one edge per position (column) and the end-station of an edge at position k is identical with the start station of the following edge at position k+1 a route is called symmetric if it is Hamiltonian, i.e. including all stations 0…n-1, so each station is an end node of exactly one edge of the route We will have a general solution for the TSP if we are able to find always a unique symmetric and consecutive route with minimal cost from node (0,0) to node (0,n)

10 Linear Optimisation: Cost function Min Where at the first/last position only edges from/to station 0 are relevant, so all other edge-variables can be set to zero:

11 Linear Optimisation: Basic constraints Route has to be symmetric  each station is reached exactly once Route has to be consecutive  Sum of entry variables at each node (l,k) equals to the sum of the exit variables or (1) (2)

12 Example for a valid solution Route is consecutive Route is symmetric Variables x i_j,k are integer values (0 or 1) Problem: How can we enforce the 0/1 settings of the variables in a ‘real value environment’ like LP?  Seems not to be not possible but we have to ensure it, otherwise …

13 Examples for degenerated solutions … bad things are happening  non-integer solutions

14 Considerations non-integer solutions Non-integer solutions combine several sub-routes from start-node (0,0) to end-node (0,n), each with a weight below 1 but altogether with an overall weight of 1 There are two classes of non-integer solutions: –The bad ones: Combinations of sub-routes where at least two of them are ‘asymmetric’ i.e. having particular stations more than once in their sequence and leaving others instead. The particular sub- routes have to be complementary such that a skipped station of a sub-route is covered by the sequence of another sub-route  we will call this asymmetric solutions in the following –The good ones: Combinations of sub-routes of complete and valid solutions such that each sub-route is symmetric, i.e. including all stations 0…n- 1 once  we will call this symmetric solutions in the following The first ones have to be avoided, but we can live comfortably with the latter (see next page)

15 Example symmetric solution The example above causes no trouble because each sub-route is a valid and optimal solution for the particular TSP problem  pick one out e.g. by the following procedure: - set of one of the non-zero variables x i_j,0 at the first column to 1 - run the overall algorithm again - if still variables between 0 and 1 occur, set one of them to 1 a.s.o.  This procedure terminates in less than n steps

16 How to deal with the bad ones? Symmetric solutions are welcome so we only have to avoid asymmetric sub-routes  This can be done by two steps: 1. Separate the complementary sub-routes 2. Enforce the symmetry of each sub-route For that, we introduce a new mechanism, the mirror: –For each graph node (l,k) the mirror Y(l,k) provides an exact representation of the sub-route(s) crossing this node –A mirror Y(l,k) consists of about n 3 variables y (i,k) i_j,d each representing a variable x i_j,k of the original graph where i,j = start/end stations of the corresponding graph edge d = distance of the edge from node (l,k) in numbers of columns

17 Example for a mirror Y(1,3) = y (1,3) 1_5,0 =0.5, y (1,3) 5_3,1 =0.5, y (1,3) 3_0,2 =0.5, y (1,3) 0_5,3 =0.5, y (1,3) 5_4,4 =0.5, y (1,3) 4_1,5 =0.5 0, 0 1, 5 2, 5 3, 5 5, 5 1, 4 2, 4 3, 4 5, 4 1, 3 2, 3 3, 3 5, 3 1, 2 2, 2 3, 2 5, 2 1, 1 2, 1 3, 1 5, 1 4, 1 4, 2 4, 3 4, 4 4, 5 d=3 d=4 d=5 d=0 d=1 d=2

18 Constraints to build up mirrors (1) 1.A mirror Y(l,k) has to represent all sub-routes crossing node (l,k)  edges with d=0, i.e. starting at node (l,k), can be assigned directly to the corresponding mirror variables 2.There have to be edges within each row of mirror Y(l,k) with overall weight equal to the weight of node (l,k)

19 Constraints to build up mirrors (2) 3.The sub-routes in the mirror have to be consecutive 4.Each graph edge has to be represented by the combined mirrors of a particular column Annotation: Operator ‘+’ applied on variable indices means the modulo sum with basis n such that the result is always 0...n-1

20 Constraints to build up mirrors (3) 5.The sub-routes in the mirror have to be symmetric  all stations have to be reached That’s it!

21 Conclusion MERLINn uses - O(N 5 ) variables and - O(N 4 ) constraints to define a Linear Formulation of the Travelling Salesman Problem It is a general applicable approach for the TSP LP is known to be polynomial TSP solvable in a polynomial number of steps as well P=NP!

22 References [1] Mertz, J.: ‘The Dragon War’, Applied Mathematics and Computation, Vol. 186/1, 1 March 2007, pg [2] MERLIN-page with further information (validation results, LP-formulations, examples …) [3] Download of LP solver QSOpt