CS 758/858: Algorithms http://www.cs.unh.edu/~ruml/cs758 - - PowerPoint PPT Presentation

▶
cs 758 858 algorithms
SMART_READER_LITE
LIVE PREVIEW

CS 758/858: Algorithms http://www.cs.unh.edu/~ruml/cs758 - - PowerPoint PPT Presentation

CS 758/858: Algorithms http://www.cs.unh.edu/~ruml/cs758 Backtracking Local Search Wheeler Ruml (UNH) Class 25, CS 758 1 / 20 Backtracking Hardness Optimization Backtracking Depth-first Search DFS Order Problems


slide-1
SLIDE 1

CS 758/858: Algorithms

Backtracking Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 1 / 20

http://www.cs.unh.edu/~ruml/cs758

slide-2
SLIDE 2

Backtracking

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 2 / 20

slide-3
SLIDE 3

Hardness

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 3 / 20

NPC: SAT, vertex cover, clique, subset sum, . . . greedy: local choice is optimal DP: poly number of options to track search: exponential number of options, often combinations

slide-4
SLIDE 4

Combinatorial Optimization

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 4 / 20

decision 1 decision 2

  • ption 1

(1,1)

  • ption 1

(1,2)

  • ption 2

decision 2

  • ption 2

(2,1)

  • ption 1

(2,2)

  • ption 2

A tree representation of alternatives in a small combinatorial problem.

slide-5
SLIDE 5

Backtracking

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 5 / 20

depth-first search child ordering lower bounds branch-and-bound duplicate detection: transposition table

slide-6
SLIDE 6

Depth-first Search

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 6 / 20

DFS (node) 1 If is-leaf(node) 2 Visit(node) 3 else 4 For i from 0 to num-children 5 DFS(child(node, i))

slide-7
SLIDE 7

Depth-first Search Order

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 7 / 20

slide-8
SLIDE 8

Problems Are Hard

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 8 / 20

13,509 US cities (W. Cook)

slide-9
SLIDE 9

Problems Are Hard

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 9 / 20

. . . 13,506 . . . 13,507 . . . 13,508 . . . 13,505

slide-10
SLIDE 10

Problems Are Hard

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 10 / 20

(S. LaValle)

slide-11
SLIDE 11

Improved Discrepancy Search

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 11 / 20

ILDS (node, allowance, remaining) 1 If is-leaf(node) 2 Visit(node) 3 else 4 If allowance > 0 5 ILDS(child(node, 1), allowance − 1, remaining − 1) 6 If remaining > allowance 7 ILDS(child(node, 0), allowance, remaining − 1) start with ILDS(root, iteration, max-depth)

slide-12
SLIDE 12

Discrepancy Search Order

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 12 / 20

The second pass of ILDS visits all leaves with one discrepancy in their path from the root.

slide-13
SLIDE 13

Break

Backtracking ■ Hardness ■ Optimization ■ Backtracking ■ Depth-first Search ■ DFS Order ■ Problems ■ ILDS ■ ILDS Order ■ Break Local Search

Wheeler Ruml (UNH) Class 25, CS 758 – 13 / 20

■

asst 14

■

recitation: last year’s final

■

final exam: Wed Dec 12, 3:30-5:30pm, N101

slide-14
SLIDE 14

Local Search

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 14 / 20

slide-15
SLIDE 15

Local Search

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 15 / 20

1.6 2.3 3.9 2.1 1.5 2.6 4.4 6.2 A graph representing an improvement-based search.

slide-16
SLIDE 16

Local Search

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 16 / 20

hill climbing simulated annealing large neighborhood search genetic algorithms particle swarm optimization

slide-17
SLIDE 17

Max Cut

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 17 / 20

maximize weight of edges crossing the cut w(A, B) decision version is NP-complete simple local search: move vertex u from A to B iff

  • v=u∈A

wuv >

  • v∈B

wuv it’s possible to bound suboptimality of local minima under this neighborhood!

slide-18
SLIDE 18

Suboptimality of Local Search

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 18 / 20

for any u in A,

  • v=u∈A

wuv ≤

  • v∈B

wuv summing over all u in A, 2

  • (u,v)∈A

wuv ≤

  • u∈A,v∈B

wuv = w(A, B) same from perspective of B: 2

  • (u,v)∈B

wuv ≤

  • u∈A,v∈B

wuv = w(A, B) add: 2

  • (u,v)∈A

wuv + 2

  • (u,v)∈B

wuv ≤ 2w(A, B)

slide-19
SLIDE 19

Suboptimality of Local Search

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 19 / 20

divide by 2:

  • (u,v)∈A

wuv +

  • (u,v)∈B

wuv ≤ w(A, B) eg, more weight crossing than within partitions let W be sum of all weight in graph. add crossing weight to both sides: W ≤ 2w(A, B) W/2 ≤ w(A, B) note optimal is at most W

slide-20
SLIDE 20

EOLQs

Backtracking Local Search ■ Local Search ■ Local Search ■ Max Cut ■ Suboptimality ■ EOLQs

Wheeler Ruml (UNH) Class 25, CS 758 – 20 / 20

For example:

■

What’s still confusing?

■

What question didn’t you get to ask today?

■

What would you like to hear more about? Please write down your most pressing question about algorithms and put it in the box on your way out. Thanks!