Efficiency Issues Neighborhoods and Landscapes Marco Chiarandini - - PowerPoint PPT Presentation

efficiency issues neighborhoods and landscapes
SMART_READER_LITE
LIVE PREVIEW

Efficiency Issues Neighborhoods and Landscapes Marco Chiarandini - - PowerPoint PPT Presentation

DM841 Discrete Optimization Lecture 12 Efficiency Issues Neighborhoods and Landscapes Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Efficient Local Search Examples Computational


slide-1
SLIDE 1

DM841 Discrete Optimization Lecture 12

Efficiency Issues Neighborhoods and Landscapes

Marco Chiarandini

Department of Mathematics & Computer Science University of Southern Denmark

slide-2
SLIDE 2

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

3

slide-3
SLIDE 3

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

4

slide-4
SLIDE 4

Efficient Local Search Examples Computational Complexity Search Space Properties

Summary: Local Search Algorithms

(as in [Hoos, Stützle, 2005])

For given problem instance π:

  • 1. search space Sπ
  • 2. evaluation function fπ : S → R
  • 3. neighborhood relation Nπ ⊆ Sπ × Sπ
  • 4. set of memory states Mπ
  • 5. initialization function init : ∅ → Sπ × Mπ)
  • 6. step function step : Sπ × Mπ → Sπ × Mπ
  • 7. termination predicate terminate : Sπ × Mπ → {⊤, ⊥}

5

slide-5
SLIDE 5

Efficient Local Search Examples Computational Complexity Search Space Properties

Efficiency and Effectiveness

After implementation and test of the above components, improvements in efficiency (ie, computation time) can be achieved by:

  • A. fast incremental evaluation (ie, delta evaluation)
  • B. neighborhood pruning
  • C. clever use of data structures

Improvements in effectiveness, ie, quality, can be achieved by:

  • D. application of a metaheuristic
  • E. definition of a larger neighborhood

6

slide-6
SLIDE 6

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

7

slide-7
SLIDE 7

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

8

slide-8
SLIDE 8

Efficient Local Search Examples Computational Complexity Search Space Properties

Single Machine Total Weighted Tardiness Problem

◮ Interchange: size

n

2

  • and O(|i − j|) evaluation each

◮ first-improvement: πj, πk

pπj ≤ pπk for improvements, wjTj +wkTk must decrease because jobs in πj, . . . , πk can only increase their tardiness. pπj ≥ pπk possible use of auxiliary data structure to speed up the com- putation

◮ best-improvement: πj, πk

pπj ≤ pπk for improvements, wjTj + wkTk must decrease at least as the best interchange found so far because jobs in πj, . . . , πk can only increase their tardiness. pπj ≥ pπk possible use of auxiliary data structure to speed up the com- putation

◮ Swap: size n − 1 and O(1) evaluation each ◮ Insert: size (n − 1)2 and O(|i − j|) evaluation each

But possible to speed up with systematic examination by means of swaps: an interchange is equivalent to |i − j| swaps hence overall examination takes O(n2)

9

slide-9
SLIDE 9

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

11

slide-10
SLIDE 10

Efficient Local Search Examples Computational Complexity Search Space Properties

TSP

Efficient implementations of 2-opt, 2H-opt and 3-opt local search.

  • A. Delta evaluation already in O(1)
  • B. Fixed radius search + DLB
  • C. Data structures

Details at black board and references [Bentley, 1992; Johnson and McGeoch,

2002; Applegate et al., 2006]

12

slide-11
SLIDE 11

Efficient Local Search Examples Computational Complexity Search Space Properties

Local Search for the Traveling Salesman Problem

◮ k-exchange heuristics

◮ 2-opt ◮ 2.5-opt ◮ Or-opt ◮ 3-opt

◮ complex neighborhoods

◮ Lin-Kernighan ◮ Helsgaun’s Lin-Kernighan ◮ Dynasearch ◮ ejection chains approach

Implementations exploit speed-up techniques

  • 1. neighborhood pruning: fixed radius nearest neighborhood search
  • 2. neighborhood lists: restrict exchanges to most interesting candidates
  • 3. don’t look bits: focus perturbative search to “interesting” part
  • 4. sophisticated data structures

Implementation examples by Stützle: http://www.sls-book.net/implementations.html

13

slide-12
SLIDE 12

Efficient Local Search Examples Computational Complexity Search Space Properties

TSP data structures Tour representation:

◮ determine pos of v in π ◮ determine succ and prec ◮ check whether uk is visited between ui and uj ◮ execute a k-exchange (reversal)

Possible choices:

◮ |V | < 1.000 array for π and π−1 ◮ |V | < 1.000.000 two level tree ◮ |V | > 1.000.000 splay tree

Moreover static data structure:

◮ priority lists ◮ k-d trees

14

slide-13
SLIDE 13

Efficient Local Search Examples Computational Complexity Search Space Properties

Look at implementation of local search for TSP by T. Stützle: File: http://www.imada.sdu.dk/~marco/DM811/Resources/ls.c ✞ ☎

two_opt_b(tour); % best improvement, no speedup two_opt_f(tour); % first improvement, no speedup two_opt_best(tour); % first improvement including speed−ups (dlbs, fixed radius near neighbour searches, neughbourhood lists) two_opt_first(tour); % best improvement including speed−ups (dlbs, fixed radius near neighbour searches, neughbourhood lists) three_opt_first(tour); % first improvement

✝ ✆

15

slide-14
SLIDE 14

Efficient Local Search Examples Computational Complexity Search Space Properties

[Appelgate Bixby, Chvátal, Cook, 2006]

16

slide-15
SLIDE 15

Efficient Local Search Examples Computational Complexity Search Space Properties 17

slide-16
SLIDE 16

Efficient Local Search Examples Computational Complexity Search Space Properties

References

Applegate D.L., Bixby R.E., Chvátal V., and Cook W.J. (2006). The Traveling Salesman Problem: A Computational Study. Princeton University Press. Bentley J. (1992). Fast algorithms for geometric traveling salesman problems. ORSA Journal on Computing, 4(4), pp. 387–411. Johnson D.S. and McGeoch L.A. (2002). Experimental analysis of heuristics for the

  • STSP. In The Traveling Salesman Problem and Its Variations, edited by G. Gutin

and A. Punnen, pp. 369–443. Kluwer Academic Publishers, Boston, MA, USA.

19

slide-17
SLIDE 17

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

20

slide-18
SLIDE 18

Efficient Local Search Examples Computational Complexity Search Space Properties

Computational Complexity of LS

For a local search algorithm to be effective, search initialization and individual search steps should be efficiently computable. Complexity class PLS: class of problems for which a local search algorithm exists with polynomial time complexity for:

◮ search initialization ◮ any single search step, including computation of

evaluation function value For any problem in PLS . . .

◮ local optimality can be verified in polynomial time ◮ improving search steps can be computed in polynomial time ◮ but: finding local optima may require super-polynomial time

21

slide-19
SLIDE 19

Efficient Local Search Examples Computational Complexity Search Space Properties

Computational Complexity of LS

PLS-complete: Among the most difficult problems in PLS; if for any of these problems local optima can be found in polynomial time, the same would hold for all problems in PLS. Some complexity results:

◮ TSP with k-exchange neighborhood with k > 3

is PLS-complete.

◮ TSP with 2- or 3-exchange neighborhood is in PLS, but

PLS-completeness is unknown.

22

slide-20
SLIDE 20

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

23

slide-21
SLIDE 21

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

24

slide-22
SLIDE 22

Efficient Local Search Examples Computational Complexity Search Space Properties

Definitions

◮ Problem instance π ◮ Search space Sπ ◮ Neighborhood function N : S ⊆ 2S ◮ Evaluation function fπ : S → R

Definition: The search landscape L is the vertex-labeled neighborhood graph given by the triplet L = Sπ, Nπ, fπ.

25

slide-23
SLIDE 23

Efficient Local Search Examples Computational Complexity Search Space Properties

Search Landscape

Transition Graph of Iterative Improvement Given L = Sπ, Nπ, fπ, the transition graph of iterative improvement is a directed acyclic subgraph obtained from L by deleting all arcs (i, j) for which it holds that the cost of solution j is worse than or equal to the cost of solution i. It can be defined for other algorithms as well and it plays a central role in the theoretical analysis of proofs of convergence.

26

slide-24
SLIDE 24

Efficient Local Search Examples Computational Complexity Search Space Properties

Ideal visualization of landscapes principles

◮ Simplified landscape

representation

◮ Tabu Search ◮ Guided Local Search ◮ Iterated Local Search ◮ Evolutionary Alg.

27

slide-25
SLIDE 25

Efficient Local Search Examples Computational Complexity Search Space Properties

Fundamental Properties

The behavior and performance of an LS algorithm on a given problem instance crucially depends on properties of the respective search landscape. Simple properties:

◮ search space size |S| ◮ reachability: solution j is reachable from solution i if neighborhood

graph has a path from i to j.

◮ strongly connected neighborhood graph:

for each pair i, j of solutions, j is reachable from i.

◮ weakly optimally connected neighborhood graph:

for each solution i, it contains a path from i to an optimal solution.

◮ distance between solutions ◮ neighborhood size (ie, degree of vertices in neigh. graph) ◮ cost of fully examining the neighborhood ◮ relation between different neighborhood functions

(if N1(s) ⊆ N2(s) forall s ∈ S then N2 dominates N1)

28

slide-26
SLIDE 26

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

29

slide-27
SLIDE 27

Efficient Local Search Examples Computational Complexity Search Space Properties

Neighborhood Operator

Goal: providing a formal description of neighborhood functions for the three main solution representations:

◮ Permutation

◮ linear permutation: Single Machine Total Weighted Tardiness Problem ◮ circular permutation: Traveling Salesman Problem

◮ Assignment: SAT, CSP ◮ Set, Partition: Max Independent Set

A neighborhood function N : S → 2S is also defined through an operator. An operator ∆ is a collection of operator functions δ : S → S such that s′ ∈ N(s) ⇐ ⇒ ∃δ ∈ ∆ | δ(s) = s′

30

slide-28
SLIDE 28

Efficient Local Search Examples Computational Complexity Search Space Properties

Permutations

Π(n) indicates the set all permutations of the numbers {1, 2, . . . , n} (1, 2 . . . , n) is the identity permutation ι. If π ∈ Π(n) and 1 ≤ i ≤ n then:

◮ πi is the element at position i ◮ posπ(i) is the position of element i

Alternatively, a permutation is a bijective function π(i) = πi The permutation product π · π′ is the composition (π · π′)i = π′(π(i)) For each π there exists a permutation such that π−1 · π = ι π−1(i) = posπ(i) ∆N ⊂ Π

31

slide-29
SLIDE 29

Efficient Local Search Examples Computational Complexity Search Space Properties

Linear Permutations

Swap operator ∆S = {δi

S|1 ≤ i ≤ n}

δi

S(π1 . . . πiπi+1 . . . πn) = (π1 . . . πi+1πi . . . πn)

Interchange operator ∆X = {δij

X|1 ≤ i < j ≤ n}

δij

X(π) = (π1 . . . πi−1πjπi+1 . . . πj−1πiπj+1 . . . πn)

(≡ set of all transpositions) Insert operator ∆I = {δij

I |1 ≤ i ≤ n, 1 ≤ j ≤ n, j = i}

δij

I (π) =

(π1 . . . πi−1πi+1 . . . πjπiπj+1 . . . πn) i < j (π1 . . . πjπiπj+1 . . . πi−1πi+1 . . . πn) i > j

32

slide-30
SLIDE 30

Efficient Local Search Examples Computational Complexity Search Space Properties

Circular Permutations

Reversal (2-edge-exchange) ∆R = {δij

R|1 ≤ i < j ≤ n}

δij

R(π) = (π1 . . . πi−1πj . . . πiπj+1 . . . πn)

Block moves (3-edge-exchange) ∆B = {δijk

B |1 ≤ i < j < k ≤ n}

δij

B(π) = (π1 . . . πi−1πj . . . πkπi . . . πj−1πk+1 . . . πn)

Short block move (Or-edge-exchange) ∆SB = {δij

SB|1 ≤ i < j ≤ n}

δij

SB(π) = (π1 . . . πi−1πjπj+1πj+2πi . . . πj−1πj+3 . . . πn)

33

slide-31
SLIDE 31

Efficient Local Search Examples Computational Complexity Search Space Properties

Assignments

An assignment can be represented as a mapping σ : {X1 . . . Xn} → {v : v ∈ D, |D| = k}: σ = {Xi = vi, Xj = vj, . . .} One-exchange operator ∆1E = {δil

1E|1 ≤ i ≤ n, 1 ≤ l ≤ k}

δil

1E

  • σ) =
  • σ′ : σ′(Xi) = vl and σ′(Xj) = σ(Xj) ∀j = i
  • Two-exchange operator

∆2E = {δij

2E|1 ≤ i < j ≤ n}

δij

2E(σ) =

  • σ′ : σ′(Xi) = σ(Xj), σ′(Xj) = σ(Xi) and σ′(Xl) = σ(Xl)∀l = i, j
  • 34
slide-32
SLIDE 32

Efficient Local Search Examples Computational Complexity Search Space Properties

Partitioning

An assignment can be represented as a partition of objects selected and not selected s : {X} → {C, C} (it can also be represented by a bit string) One-addition operator ∆1E = {δv

1E | v ∈ C}

δv

1E

  • s) =
  • s : C ′ = C ∪ v and C

′ = C \ v}

One-deletion operator ∆1E = {δv

1E | v ∈ C}

δv

1E

  • s) =
  • s : C ′ = C \ v and C

′ = C ∪ v}

Swap operator ∆1E = {δv

1E | v ∈ C, u ∈ C}

δv

1E

  • s) =
  • s : C ′ = C ∪ u \ v and C

′ = C ∪ v \ u}

35

slide-33
SLIDE 33

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

36

slide-34
SLIDE 34

Efficient Local Search Examples Computational Complexity Search Space Properties

Distances

Set of paths in L with s, s′ ∈ S: Φ(s, s′) = {(s1, . . . , sh) | s1 = s, sh = s′ ∀i : 1 ≤ i ≤ h − 1, si, si+1 ∈ EL} If φ = (s1, . . . , sh) ∈ Φ(s, s′) let |φ| = h be the length of the path; then the distance between any two solutions s, s′ is the length of shortest path between s and s′ in L: dN (s, s′) = min

φ∈Φ(s,s′) |Φ|

diam(L) = max{dN (s, s′) | s, s′ ∈ S} (= maximal distance between any two candidate solutions) (= worst-case lower bound for number of search steps required for reaching (optimal) solutions) Note: with permutations it is easy to see that: dN (π, π′) = dN (π−1 · π′, ι)

37

slide-35
SLIDE 35

Efficient Local Search Examples Computational Complexity Search Space Properties

Distances for Linear Permutation Representations

◮ Swap neighborhood operator

computable in O(n2) by the precedence based distance metric: dS(π, π′) = #{i, j|1 ≤ i < j ≤ n, posπ′(πj) < posπ′(πi)}. diam(GN ) = n(n − 1)/2

◮ Interchange neighborhood operator

Computable in O(n) + O(n) since dX(π, π′) = dX(π−1 · π′, ι) = n − c(π−1 · π′) c(π) is the number of disjoint cycles that decompose a permutation. diam(GNX ) = n − 1

◮ Insert neighborhood operator

Computable in O(n) + O(n log(n)) since dI(π, π′) = dI(π−1 · π′, ι) = n − |lis(π−1 · π′)| where lis(π) denotes the length of the longest increasing subsequence. diam(GNI ) = n − 1

38

slide-36
SLIDE 36

Efficient Local Search Examples Computational Complexity Search Space Properties

Distances for Circular Permutation Representations

◮ Reversal neighborhood operator

sorting by reversal is known to be NP-hard surrogate in TSP: bond distance

◮ Block moves neighborhood operator

unknown whether it is NP-hard but there does not exist a proved polynomial-time algorithm

39

slide-37
SLIDE 37

Efficient Local Search Examples Computational Complexity Search Space Properties

Distances for Assignment Representations

◮ Hamming Distance ◮ An assignment can be seen as a partition of n in k mutually exclusive

non-empty subsets One-exchange neighborhood operator The partition-distance d1E(P, P′) between two partitions P and P′ is the minimum number of elements that must be moved between subsets in P so that the resulting partition equals P′. The partition-distance can be computed in polynomial time by solving an assignment problem. Given the assignment matrix M where in each cell (i, j) it is |Si ∩ S′

j | with Si ∈ P and S′ j ∈ P′ and defined A(P, P′)

the assignment of maximal sum then it is d1E(P, P′) = n − A(P, P′)

40

slide-38
SLIDE 38

Efficient Local Search Examples Computational Complexity Search Space Properties

Example: Search space size and diameter for the TSP

◮ Search space size = (n − 1)!/2 ◮ Insert neighborhood

size = (n − 3)n diameter = n − 2

◮ 2-exchange neighborhood

size = n

2

  • = n · (n − 1)/2

diameter in [n/2, n − 2]

◮ 3-exchange neighborhood

size = n

3

  • = n · (n − 1) · (n − 2)/6

diameter in [n/3, n − 1]

41

slide-39
SLIDE 39

Efficient Local Search Examples Computational Complexity Search Space Properties

Example: Search space size and diameter for SAT SAT instance with n variables, 1-flip neighborhood: GN = n-dimensional hypercube; diameter of GN = n.

42

slide-40
SLIDE 40

Efficient Local Search Examples Computational Complexity Search Space Properties

Let N1 and N2 be two different neighborhood functions for the same instance (S, f , π) of a combinatorial optimization problem. If for all solutions s ∈ S we have N1(s) ⊆ N2(s) then we say that N2 dominates N1 Example: In TSP, 1-insert is dominated by 3-exchange. (1-insert corresponds to 3-exchange and there are 3-exchanges that are not 1-insert)

43

slide-41
SLIDE 41

Efficient Local Search Examples Computational Complexity Search Space Properties

Outline

  • 1. Efficient Local Search
  • 2. Examples

SMTWTP TSP

  • 3. Computational Complexity
  • 4. Search Space Properties

Introduction Neighborhoods Formalized Distances Landscape Characteristics

44

slide-42
SLIDE 42

Efficient Local Search Examples Computational Complexity Search Space Properties

Other Search Space Properties

◮ number of (optimal) solutions |S′|, solution density |S′|/|S| ◮ distribution of solutions within the neighborhood graph

45

slide-43
SLIDE 43

Efficient Local Search Examples Computational Complexity Search Space Properties

Phase Transition for 3-SAT

Random instances m clauses of n uniformly chosen variables

0.2 0.4 0.6 0.8 1 3 3.5 4 4.5 5 5.5 6

#cl/#var P(sat), P(unsat)

−4 −3 −2 −1 1

P(sat) P(unsat) kcnfs mean sc (all)

log mean search cost [CPU sec]

0.2 0.4 0.6 0.8

1

3 3.5 4 4.5 5 5.5 6

#cl/#var P(sat), P(unsat)

−4 −3 −2 −1 1

kcnfs mean sc (unsat) kcnfs mean sc (all) nov+ mean sc (sat) P(sat) P(unsat)

log mean search cost [CPU sec]

46

slide-44
SLIDE 44

Efficient Local Search Examples Computational Complexity Search Space Properties

Classification of search positions

SLMIN SLOPE LEDGE LMAX SLMAX LMIN IPLAT

position type > = < SLMIN (strict local min) + – – LMIN (local min) + + – IPLAT (interior plateau) – + – SLOPE + – + LEDGE + + + LMAX (local max) – + + SLMAX (strict local max) – – + “+” = present, “–” absent; table entries refer to neighbors with larger (“>”) , equal (“=”), and smaller (“<”) evaluation function values

47

slide-45
SLIDE 45

Efficient Local Search Examples Computational Complexity Search Space Properties

Other Search Space Properties

◮ plateux ◮ barrier and basins B4 B3 B1 B2 l2 l1 B4 B3 B1 B2

48