17
DM63 HEURISTICS FOR COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco Chiarandini Outline 1. Course Introduction 2. Combinatorial Problems 3. Computational Complexity 4. Solution Methods 5. Construction Heuristics for the Traveling Salesman Problem 6. Software Development DM63 – Heuristics for Combinatorial Optimization Problems 2 Outline 1. Course Introduction 2. Combinatorial Problems 3. Computational Complexity 4. Solution Methods 5. Construction Heuristics for the Traveling Salesman Problem 6. Software Development DM63 – Heuristics for Combinatorial Optimization Problems 3 Course Presentation Communication media Web-site http://www.imada.sdu.dk/ marco/DM63/ (The Blackboard is redirected to this URL address) Course mailing list (please register!) Personal email Schedule: Monday 14.00, Wednesday 14.00 (No lectures in week 41) Last lecture: Monday, November 5 Course content Evaluation: final project Implementation of metaheuristics and experimentation. Individual work on a commonly posed problem, The final report will be evaluated by an external examiner. DM63 – Heuristics for Combinatorial Optimization Problems 4

3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

DM63HEURISTICS FOR

COMBINATORIAL OPTIMIZATION PROBLEMS

Lecture 1

Combinatorial Optimization Problems

Marco Chiarandini

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 2

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 3

Course Presentation

I Communication mediaI Web-site http://www.imada.sdu.dk/∼marco/DM63/

(The Blackboard is redirected to this URL address)I Course mailing list (please register!)I Personal email

I Schedule: Monday 14.00, Wednesday 14.00(No lectures in week 41)Last lecture: Monday, November 5

I Course content

I Evaluation: final projectI Implementation of metaheuristics and experimentation.I Individual work on a commonly posed problem,I The final report will be evaluated by an external examiner.

DM63 – Heuristics for Combinatorial Optimization Problems 4

Page 2: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Course Presentation (2)

I LiteratureI Text BookI Articles and Chapters available from the websiteI ...but take notes in class!

I AssignmentsI GCP Contest

I Submit a program which accomplishes the required taskI Details on the Weekly Notes

I Class exercises

I Weekly notes and slides

I Students’ notes on lecture content

DM63 – Heuristics for Combinatorial Optimization Problems 5

Course Presentation (3)

Why participating to the implementation Contest?

I to prepare the work for the project

I algorithmic frameworkI experimental environment

I to address details that might be gone unsaid at the lecture(Computer Science is about implementation details!)

I to contribute to the part on experimental analysis

I for the challenge

DM63 – Heuristics for Combinatorial Optimization Problems 6

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 7

Combinatorial Problems

Combinatorial problems arise in many areasof Computer Science, Artificial Intelligenceand Operations Research:

I allocating register memory

I planning, scheduling, timetabling

I Internet data packet routing

I protein structure prediction

I combinatorial auctions winner determination

I portfolio selection

I ...

DM63 – Heuristics for Combinatorial Optimization Problems 8

Page 3: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Combinatorial Problems (2)

Simplified models are often used to formalize real life problems

I finding shortest/cheapest round trips (TSP)

I finding models of propositional formulae (SAT)

I coloring graphs (GCP)

I finding variable assignment which satisfy constraints (CSP)

I partitioning graphs or digraphs

I partitioning, packing, covering sets

I finding the order of arcs with minimal backward cost

I ...

DM63 – Heuristics for Combinatorial Optimization Problems 9

Combinatorial Problems (3)

Combinatorial problems are characterized by an input,i.e., a general description of conditions and parameters anda question (or task, or objective) definingthe properties of a solution.

They involve finding a grouping, ordering, or assignmentof a discrete, finite set of objects that satisfies given conditions.

Candidate solutions are combinations of objects or solution components thatneed not satisfy all given conditions.

Solutions are candidate solutions that satisfy all given conditions.

DM63 – Heuristics for Combinatorial Optimization Problems 10

Combinatorial Problems (4)

The Traveling Salesman Problem

I Given: Directed, edge-weighted graph G (complete and with triangleinequality).

I Objective: Find a minimal-weight Hamiltonian cycle in G.

Note:

I solution component: segment consisting of two points that are visitedone directly after the other

I candidate solution: one of the (n− 1)! possible sequences of points tovisit one directly after the other.

I solution: Hamiltonian cycle of minimal length

DM63 – Heuristics for Combinatorial Optimization Problems 11

Decision problems

solutions = candidate solutions that satisfy given logical conditions

Two variants:

I Search variant: Find a solution for given problem instance(or determine that no solution exists)

I Existence variant: Determine whether solutionsfor given problem instance exists

DM63 – Heuristics for Combinatorial Optimization Problems 12

Page 4: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Optimization problems

I objective function f measures solution quality(often defined on all candidate solutions)

I find solution with optimal quality, i.e., minimize/maximize f

Variants of optimization problems:

I Search variant: Find a solution with optimalobjective function value for given problem instance

I Evaluation variant: Determine optimal objective functionvalue for given problem instance

DM63 – Heuristics for Combinatorial Optimization Problems 13

Remarks

I Every optimization problem has associated decision problems: Given aproblem instance and a fixed solution quality bound b, find a solutionwith objective function value ≤ b (for minimization problems) ordetermine that no such solution exists.

I Many optimization problems have an objective functionas well as logical conditions, constraints that solutions must satisfy.

I A candidate solution is called feasible (or valid) iff it satisfiesthe given logical conditions.

I Note: Logical conditions can always be captured byan objective function such that feasible candidate solutionscorrespond to solutions of an associated decision problemwith a specific bound.

DM63 – Heuristics for Combinatorial Optimization Problems 14

Combinatorial Problems (5)

General problem vs problem instance:

General problem Π:

I Given any set of points X, find a Hamiltonian cycle

I Solution: Algorithm that finds shortest Hamiltonian cycle for any X

Problem instantiation π = Π(I):I Given a specific set of points I, find a shortest Hamiltonian cycle

I Solution: Shortest Hamiltonian cycle for I

Problems can be formalized on sets of problem instances I

DM63 – Heuristics for Combinatorial Optimization Problems 15

The Traveling Salesman Problem

Types of TSP instances:

I Symmetric: For all edges uv of the given graph G, vu is also in G, andw(uv) = w(vu).Otherwise: asymmetric.

I Euclidean: Vertices = points in an Euclidean space,weight function = Euclidean distance metric.

I Geographic: Vertices = points on a sphere,weight function = geographic (great circle) distance.

DM63 – Heuristics for Combinatorial Optimization Problems 16

Page 5: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

TSP: Benchmark Instances

Instance classes

I Real-life applications (geographic, VLSI)

I Random Euclidean

I Random Clustered Euclidean

I Random Distance

Available at the TSPLIB (more than 100 instances upto 85.900 cities)and at the 8th DIMACS challenge

DM63 – Heuristics for Combinatorial Optimization Problems 17

TSP: Benchmark Instances, Examples

DM63 – Heuristics for Combinatorial Optimization Problems 18

The SAT Problem

General SAT Problem (search variant):

I Given: Formula F in propositional logic

I Objective: Find an assignment of truth values to variables in F thatrenders F true, or decide that no such assignment exists.

SAT: A simple example

I Given: Formula F := (x1 ∨ x2) ∧ (¬x1 ∨ ¬x2)I Objective: Find an assignment of truth values to variables x1, x2 that

renders F true, or decide that no such assignment exists.

MAX-SATWhich is the maximal number of clauses satisfiable in a propositional logicformula F?

DM63 – Heuristics for Combinatorial Optimization Problems 19

The SAT Problem

General SAT Problem (search variant):

I Given: Formula F in propositional logic

I Objective: Find an assignment of truth values to variables in F thatrenders F true, or decide that no such assignment exists.

SAT: A simple example

I Given: Formula F := (x1 ∨ x2) ∧ (¬x1 ∨ ¬x2)I Objective: Find an assignment of truth values to variables x1, x2 that

renders F true, or decide that no such assignment exists.

MAX-SATWhich is the maximal number of clauses satisfiable in a propositional logicformula F?

DM63 – Heuristics for Combinatorial Optimization Problems 19

Page 6: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Definition:

I Formula in propositional logic: well-formed string that may containI propositional variables x1, x2, . . . , xn;I truth values > (‘true’), ⊥ (‘false’);I operators ¬ (‘not’), ∧ (‘and’), ∨ (‘or’);I parentheses (for operator nesting).

I Model (or satisfying assignment) of a formula F : Assignment of truthvalues to the variables in F under which F becomes true (under theusual interpretation of the logical operators)

I Formula F is satisfiable iff there exists at least one model of F ,unsatisfiable otherwise.

DM63 – Heuristics for Combinatorial Optimization Problems 20

Definition:

I Formula in propositional logic: well-formed string that may containI propositional variables x1, x2, . . . , xn;I truth values > (‘true’), ⊥ (‘false’);I operators ¬ (‘not’), ∧ (‘and’), ∨ (‘or’);I parentheses (for operator nesting).

I Model (or satisfying assignment) of a formula F : Assignment of truthvalues to the variables in F under which F becomes true (under theusual interpretation of the logical operators)

I Formula F is satisfiable iff there exists at least one model of F ,unsatisfiable otherwise.

DM63 – Heuristics for Combinatorial Optimization Problems 20

Definition:

I Formula in propositional logic: well-formed string that may containI propositional variables x1, x2, . . . , xn;I truth values > (‘true’), ⊥ (‘false’);I operators ¬ (‘not’), ∧ (‘and’), ∨ (‘or’);I parentheses (for operator nesting).

I Model (or satisfying assignment) of a formula F : Assignment of truthvalues to the variables in F under which F becomes true (under theusual interpretation of the logical operators)

I Formula F is satisfiable iff there exists at least one model of F ,unsatisfiable otherwise.

DM63 – Heuristics for Combinatorial Optimization Problems 20

Definition:

I A formula is in conjunctive normal form (CNF) iff it is of the form

m∧i=1

k(i)∨j=1

lij = (l11 ∨ . . . ∨ l1k(1)) . . . ∧ (lm1 ∨ . . . ∨ lmk(m))

where each literal lij is a propositional variable or its negation. Thedisjunctions (li1 ∨ . . . ∨ lik(i)) are called clauses.

I A formula is in k-CNF iff it is in CNF and all clauses contain exactly kliterals (i.e., for all i, k(i) = k).

I In many cases, the restriction of SAT to CNF formulaeis considered.

I The restriction of SAT to k-CNF formulae is called k-SAT.

I For every propositional formula, there is an equivalent formula in 3-CNF.

DM63 – Heuristics for Combinatorial Optimization Problems 21

Page 7: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Definition:

I A formula is in conjunctive normal form (CNF) iff it is of the form

m∧i=1

k(i)∨j=1

lij = (l11 ∨ . . . ∨ l1k(1)) . . . ∧ (lm1 ∨ . . . ∨ lmk(m))

where each literal lij is a propositional variable or its negation. Thedisjunctions (li1 ∨ . . . ∨ lik(i)) are called clauses.

I A formula is in k-CNF iff it is in CNF and all clauses contain exactly kliterals (i.e., for all i, k(i) = k).

I In many cases, the restriction of SAT to CNF formulaeis considered.

I The restriction of SAT to k-CNF formulae is called k-SAT.

I For every propositional formula, there is an equivalent formula in 3-CNF.

DM63 – Heuristics for Combinatorial Optimization Problems 21

Example:

F := ∧ (¬x2 ∨ x1)∧ (¬x1 ∨ ¬x2 ∨ ¬x3)∧ (x1 ∨ x2)∧ (¬x4 ∨ x3)∧ (¬x5 ∨ x3)

I F is in CNF.

I Is F satisfiable?

Yes, e.g., x1 := x2 := >, x3 := x4 := x5 := ⊥ is a model of F .

DM63 – Heuristics for Combinatorial Optimization Problems 22

Example:

F := ∧ (¬x2 ∨ x1)∧ (¬x1 ∨ ¬x2 ∨ ¬x3)∧ (x1 ∨ x2)∧ (¬x4 ∨ x3)∧ (¬x5 ∨ x3)

I F is in CNF.

I Is F satisfiable?Yes, e.g., x1 := x2 := >, x3 := x4 := x5 := ⊥ is a model of F .

DM63 – Heuristics for Combinatorial Optimization Problems 22

The Vertex Coloring Problem

Given: A graph G and a set of colors Γ.

A proper coloring is an assignment of one color to each vertex of the graphsuch that adjacent vertices receive different colors.

Decision version (k-coloring)Task: Find a proper coloring of G which uses at most k colors.

Optimization version (chromatic number)Task: Find a proper coloring of G which uses the minimal number of colors.

DM63 – Heuristics for Combinatorial Optimization Problems 23

Page 8: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 24

Computational Complexity

Fundamental question:

How hard is a given computational problem to solve?

Important concepts:

I Time complexity of a problem Π: Computation timerequired for solving a given instance π of Πusing the most efficient algorithm for Π.

I Worst-case time complexity: Time complexity in theworst case over all problem instances of a given size,typically measured as a function of instance size,neglecting constants and lower-order terms( O(...) upper, Θ(...) tight, Ω(...) lower).

DM63 – Heuristics for Combinatorial Optimization Problems 25

Computation Complexity

Equivalent NotionsConsider Decision Problems

I A problem Π is in P if ∃ algorithm A that finds a solution in polynomialtime.

I in NP if ∃ verification algorithm A(s, k) that verifies a binary certificate(whether it is a solution to the problem) in polynomial time.

I Polynomial time reduction formally shows that one problem Π1 is atleast as hard as another Π2, to within a polynomial factor. (there existsa polynomial time transformation) Π2 ≤P Π1 ⇒ Π2 is no more than apolynomial harder than Π1.

I Π1 is in NP-complete if

1. Π1 ∈ NP2. ∀Π2 ∈ NP Π2 ≤P Π1

I If Π1 satisfies property 2, but not necessarily property 1, we say that it isNP-hard:

DM63 – Heuristics for Combinatorial Optimization Problems 26

Important concepts (continued):

I NP: Class of problems that can be solved in polynomial time by anon-deterministic machine.

Note: non-deterministic 6= randomized; non-deterministic machines areidealized models of computation that havethe ability to make perfect guesses.

I NP-complete: Among the most difficult problems in NP; believed tohave at least exponential time-complexity for any realistic machine orprogramming model.

I NP-hard: At least as difficult as the most difficult problems in NP, butpossibly not in NP (i.e., may have even worse complexity thanNP-complete problems).

DM63 – Heuristics for Combinatorial Optimization Problems 27

Page 9: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Important concepts (continued):

I NP: Class of problems that can be solved in polynomial time by anon-deterministic machine.

Note: non-deterministic 6= randomized; non-deterministic machines areidealized models of computation that havethe ability to make perfect guesses.

I NP-complete: Among the most difficult problems in NP; believed tohave at least exponential time-complexity for any realistic machine orprogramming model.

I NP-hard: At least as difficult as the most difficult problems in NP, butpossibly not in NP (i.e., may have even worse complexity thanNP-complete problems).

DM63 – Heuristics for Combinatorial Optimization Problems 27

Important concepts (continued):

I NP: Class of problems that can be solved in polynomial time by anon-deterministic machine.

Note: non-deterministic 6= randomized; non-deterministic machines areidealized models of computation that havethe ability to make perfect guesses.

I NP-complete: Among the most difficult problems in NP; believed tohave at least exponential time-complexity for any realistic machine orprogramming model.

I NP-hard: At least as difficult as the most difficult problems in NP, butpossibly not in NP (i.e., may have even worse complexity thanNP-complete problems).

DM63 – Heuristics for Combinatorial Optimization Problems 27

Important concepts (continued):

I NP: Class of problems that can be solved in polynomial time by anon-deterministic machine.

Note: non-deterministic 6= randomized; non-deterministic machines areidealized models of computation that havethe ability to make perfect guesses.

I NP-complete: Among the most difficult problems in NP; believed tohave at least exponential time-complexity for any realistic machine orprogramming model.

I NP-hard: At least as difficult as the most difficult problems in NP, butpossibly not in NP (i.e., may have even worse complexity thanNP-complete problems).

DM63 – Heuristics for Combinatorial Optimization Problems 27

Many combinatorial problems are hardbut some problems can be solved efficiently

I Longest path problem is NP-hardbut not shortest path problem

I SAT for 3-CNF is NP-completebut not 2-CNF (linear time algorithm)

I TSP is NP-hard, the associated decision problem (for any solutionquality) is NP-completebut not the Euler tour problem

I TSP on Euclidean instances is NP-hardbut not where all vertices lie on a circle.

DM63 – Heuristics for Combinatorial Optimization Problems 28

Page 10: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Many combinatorial problems are hardbut some problems can be solved efficiently

I Longest path problem is NP-hardbut not shortest path problem

I SAT for 3-CNF is NP-completebut not 2-CNF (linear time algorithm)

I TSP is NP-hard, the associated decision problem (for any solutionquality) is NP-completebut not the Euler tour problem

I TSP on Euclidean instances is NP-hardbut not where all vertices lie on a circle.

DM63 – Heuristics for Combinatorial Optimization Problems 28

Many combinatorial problems are hardbut some problems can be solved efficiently

I Longest path problem is NP-hardbut not shortest path problem

I SAT for 3-CNF is NP-completebut not 2-CNF (linear time algorithm)

I TSP is NP-hard, the associated decision problem (for any solutionquality) is NP-completebut not the Euler tour problem

I TSP on Euclidean instances is NP-hardbut not where all vertices lie on a circle.

DM63 – Heuristics for Combinatorial Optimization Problems 28

Many combinatorial problems are hardbut some problems can be solved efficiently

I Longest path problem is NP-hardbut not shortest path problem

I SAT for 3-CNF is NP-completebut not 2-CNF (linear time algorithm)

I TSP is NP-hard, the associated decision problem (for any solutionquality) is NP-completebut not the Euler tour problem

I TSP on Euclidean instances is NP-hardbut not where all vertices lie on a circle.

DM63 – Heuristics for Combinatorial Optimization Problems 28

Application Scenarios

Practically solving hard combinatorial problems:

I Average-case vs worst-case complexity(e.g. Simplex Algorithm for linear optimization);

I Approximation of optimal solutions:sometimes possible in polynomial time (e.g., Euclidean TSP),but in many cases also intractable (e.g., general TSP);

I Randomized computation is often practically(and possibly theoretically) more efficient;

I Asymptotic bounds vs true complexity:constants matter!

DM63 – Heuristics for Combinatorial Optimization Problems 29

Page 11: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Application Scenarios

Practically solving hard combinatorial problems:

I Average-case vs worst-case complexity(e.g. Simplex Algorithm for linear optimization);

I Approximation of optimal solutions:sometimes possible in polynomial time (e.g., Euclidean TSP),but in many cases also intractable (e.g., general TSP);

I Randomized computation is often practically(and possibly theoretically) more efficient;

I Asymptotic bounds vs true complexity:constants matter!

DM63 – Heuristics for Combinatorial Optimization Problems 29

Application Scenarios

Practically solving hard combinatorial problems:

I Average-case vs worst-case complexity(e.g. Simplex Algorithm for linear optimization);

I Approximation of optimal solutions:sometimes possible in polynomial time (e.g., Euclidean TSP),but in many cases also intractable (e.g., general TSP);

I Randomized computation is often practically(and possibly theoretically) more efficient;

I Asymptotic bounds vs true complexity:constants matter!

DM63 – Heuristics for Combinatorial Optimization Problems 29

Application Scenarios

Practically solving hard combinatorial problems:

I Average-case vs worst-case complexity(e.g. Simplex Algorithm for linear optimization);

I Approximation of optimal solutions:sometimes possible in polynomial time (e.g., Euclidean TSP),but in many cases also intractable (e.g., general TSP);

I Randomized computation is often practically(and possibly theoretically) more efficient;

I Asymptotic bounds vs true complexity:constants matter!

DM63 – Heuristics for Combinatorial Optimization Problems 29

An online compendium on the computational complexityof optimization problems:http://www.nada.kth.se/∼viggo/problemlist/compendium.html

DM63 – Heuristics for Combinatorial Optimization Problems 30

Page 12: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 32

Methods and Algorithms

A Method is a general framework for the development of a solutionalgorithm. It is not problem-specific.

An Algorithmic model (or simply algorithm) is the instantiation of a methodon a specific problem Π.The level of instantiation may vary:

I minimally instantiated (few details, algorithm template)

I lowly instantiated (which data structure to use)

I highly instantiated (programming tricks that give speedups)

I maximally instantiated (details specific of a programming language andcomputer architecture)

A Program is the implementation of an algorithm.

DM63 – Heuristics for Combinatorial Optimization Problems 33

Solution Methods

I Exact methods:systematic enumerationcomplete: guaranteed to eventually find (optimal) solution,or to determine that no solution exists

I Search algorithmsI Dynamic programmingI Constraint programmingI Integer programming

I Approximate methods:incomplete: not guaranteed to find (optimal) solution,and unable to prove that no solution exists

I Integer programming relaxationsI Randomized backtrackingI Heuristic algorithms

I Approximation methodsworst-case solution guaranteehttp://www.nada.kth.se/∼viggo/problemlist/compendium.html

DM63 – Heuristics for Combinatorial Optimization Problems 34

Page 13: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Complete Search Paradigms

Tree search

I uninformed search: breadth first, depth first

I informed search: greedy best-first search, A∗ search, branch & bound

Example: branch & bound / A∗ search for TSPI Compute lower bound on length of completion of given

partial round trip.I Terminate search on branch if length of current partial

round trip + lower bound on length of completion exceedslength of shortest complete round trip found so far.

I Combination of constructive search and backtracking, i.e., revisiting ofchoice points after construction of completecandidate solutions.

I Performs systematic search over constructions.

I Complete, but visiting all candidate solutionsbecomes rapidly infeasible with growing size of problem instances.

DM63 – Heuristics for Combinatorial Optimization Problems 35

Complete Search Paradigms

Tree search

I uninformed search: breadth first, depth first

I informed search: greedy best-first search, A∗ search, branch & bound

Example: branch & bound / A∗ search for TSPI Compute lower bound on length of completion of given

partial round trip.I Terminate search on branch if length of current partial

round trip + lower bound on length of completion exceedslength of shortest complete round trip found so far.

I Combination of constructive search and backtracking, i.e., revisiting ofchoice points after construction of completecandidate solutions.

I Performs systematic search over constructions.

I Complete, but visiting all candidate solutionsbecomes rapidly infeasible with growing size of problem instances.

DM63 – Heuristics for Combinatorial Optimization Problems 35

Incomplete Search Paradigms

Heuristic: a common-sense rule (or set of rules) intended to increase theprobability of solving some problem

Construction rules (aka construction heuristics)They are closely related to search tree techniques but correspond to a singlepath from root to leaf

I search space = partial candidate solutions

I search step = extension with one or more solution components

Construction Heuristic (CH):

s := ∅While s is not a complete solution:|| choose a solution component cb add the solution component to s

DM63 – Heuristics for Combinatorial Optimization Problems 36

Incomplete Search Paradigms

Heuristic: a common-sense rule (or set of rules) intended to increase theprobability of solving some problem

Construction rules (aka construction heuristics)They are closely related to search tree techniques but correspond to a singlepath from root to leaf

I search space = partial candidate solutions

I search step = extension with one or more solution components

Construction Heuristic (CH):

s := ∅While s is not a complete solution:|| choose a solution component cb add the solution component to s

DM63 – Heuristics for Combinatorial Optimization Problems 36

Page 14: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Incomplete Search Paradigms

An important class of Construction Heuristics are greedy algorithms.

I Strategy: always make the choice which is the best at the moment.

I They are not generally guaranteed to find globally optimal solutions(but sometimes they do: Minimum Spanning Tree, Single SourceShortest Path, etc.)

DM63 – Heuristics for Combinatorial Optimization Problems 37

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 38

Complete Algorithms and Lower Bounds

I Branch & cut algorithms (Concorde: http://www.tsp.gatech.edu/)I cutting planes + branchingI use LP-relaxation for lower bounding schemesI effective heuristics for upper bounds

Solution times with ConcordeInstance No. nodes CPU time (secs)

att532 7 109.52rat783 1 37.88pcb1173 19 468.27fl1577 7 6705.04d2105 169 11179253.91pr2392 1 116.86rl5934 205 588936.85usa13509 9539 ca. 4 yearsd15112 164569 ca. 22 yearss24978 167263 84.8 CPU years

I Lower bounds: (within less than one percent of optimum for randomEuclidean, up to two percent for TSPLIB instances)

DM63 – Heuristics for Combinatorial Optimization Problems 39

Construction Heuristics

Construction heuristics specific for TSP

I Heuristics that Grow FragmentsI Nearest neighborhood heuristicsI Double-Ended Nearest Neighbor heuristicI Multiple Fragment heuristic (aka, greedy heuristic)

I Heuristics that Grow ToursI Nearest AdditionI Farthest AdditionI Random Addition

I Clarke-Wright savings heuristic

I Nearest InsertionI Farthest InsertionI Random Insertion

I Heuristics based on TreesI Minimum span tree heuristicI Christofides’ heuristicsI Fast recursive partitioning heuristic

DM63 – Heuristics for Combinatorial Optimization Problems 40

Page 15: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 41

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 42

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 43

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 44

Page 16: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 45

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 46

Construction Heuristics for TSP

DM63 – Heuristics for Combinatorial Optimization Problems 47

Outline

1. Course Introduction

2. Combinatorial Problems

3. Computational Complexity

4. Solution Methods

5. Construction Heuristics for the Traveling Salesman Problem

6. Software Development

DM63 – Heuristics for Combinatorial Optimization Problems 48

Page 17: 3. Computational Complexity Combinatorial Optimization ...marco/DM63/Slides/dm63-lec1.pdf · COMBINATORIAL OPTIMIZATION PROBLEMS Lecture 1 Combinatorial Optimization Problems Marco

Software Development: Extreme Programming & Scrum

PlanningRelease planning creates the schedule // Make frequent small releases //The project is divided into iterations

DesigningSimplicity // No functionality is added early // Refactor: eliminate unusedfunctionality and redundancy

CodingCode must be written to agreed standards // Code the unit test first // Allproduction code is pair programmed // Leave optimization till last // Noovertime

TestingAll code must have unit tests // All code must pass all unit tests before itcan be released // When a bug is found tests are created

DM63 – Heuristics for Combinatorial Optimization Problems 49

Software Framework for LS Methods

From EasyLocal++ by Schaerf and Di Gaspero (2003).DM63 – Heuristics for Combinatorial Optimization Problems 50