Constraint Satisfaction Problems: Local Search Alice Gao Lecture 7 - - PowerPoint PPT Presentation

constraint satisfaction problems local search
SMART_READER_LITE
LIVE PREVIEW

Constraint Satisfaction Problems: Local Search Alice Gao Lecture 7 - - PowerPoint PPT Presentation

1/19 Constraint Satisfaction Problems: Local Search Alice Gao Lecture 7 Based on work by K. Leyton-Brown, K. Larson, and P. van Beek 2/19 Outline Learning Goals Introduction to Local Search Local Search Algorithms Hill climbing


slide-1
SLIDE 1

1/19

Constraint Satisfaction Problems: Local Search

Alice Gao

Lecture 7 Based on work by K. Leyton-Brown, K. Larson, and P. van Beek

slide-2
SLIDE 2

2/19

Outline

Learning Goals Introduction to Local Search Local Search Algorithms Hill climbing Revisiting the Learning goals

slide-3
SLIDE 3

3/19

Learning Goals

By the end of the lecture, you should be able to

▶ Describe the advantages of local search over other search

algorithms.

▶ Formulate a real world problem as a local search problem

using complete-state formulations.

▶ Given a local search problem, verify whether a state is a local

  • ptimum.
slide-4
SLIDE 4

4/19

Why Use Local Search?

▶ Many search spaces are too big for systematic search. ▶ For CSPs, we only need to fjnd a goal node. The path to a

goal is irrelevant.

▶ Solution: local search

slide-5
SLIDE 5

5/19

What is local search?

▶ Keep track of a single node, which is a complete assignment

  • f values to variables.

▶ Move to a neighbour of the node based on how good the

neighbour is.

slide-6
SLIDE 6

6/19

When should we use local search?

▶ The state space is large or infjnite. ▶ Memory is limited. ▶ To solve pure optimization problems with a fjtness function

but no goal test.

slide-7
SLIDE 7

7/19

Local Search

For solving a CSP, a local search problem consists of a:

▶ A set of variables ▶ Domains for the variables ▶ Constraints on the joint values of the variables ▶ A node in the search space is

a complete assignment to all of the variables.

▶ A neighbour relation: which nodes do I explore next? ▶ A cost function: how good is each assignment? In which

direction should we go?

slide-8
SLIDE 8

8/19

Example: 4-Queens Problem

slide-9
SLIDE 9

9/19

Example: Traveling Salesperson Problem

slide-10
SLIDE 10

10/19

Learning Goals Introduction to Local Search Local Search Algorithms Hill climbing Revisiting the Learning goals

slide-11
SLIDE 11

11/19

Questions

The problem formulation:

▶ What is the neighbour relation? ▶ What is the cost function?

Executing the algorithm:

▶ Where do we start? ▶ Which neighbour do we move to? ▶ When do we stop?

Properties and performance of the algorithm:

▶ Given enough time, will the algorithm fjnd

the global optimum solution?

▶ How much memory does it require? ▶ How does the algorithm perform in practice?

slide-12
SLIDE 12

12/19

Hill climbing

▶ Where do we start?

Start with a random or good solution.

▶ Which neighbour do we move to?

Move to a neighbour with the lowest cost. Break ties

  • randomly. Greedy: does not look ahead beyond one step.

▶ When do we stop?

Stop when no neighbour has a lower cost.

▶ How much memory does it require?

Only need to remember the current node. No memory of where we’ve been.

slide-13
SLIDE 13

13/19

Hill climbing in one sentence

Climbing Mount Everest in a thick fog with amnesia

slide-14
SLIDE 14

14/19

CQ: Will hill climbing fjnd the global optimum?

CQ: Will hill climbing fjnd the global optimal solution given enough time? (A) Yes. Given enough time, hill climbing will fjnd the global optimal solution for every problem. (B) No. There are problems where hill climbing will NOT fjnd the global optimal solution.

slide-15
SLIDE 15

15/19

Dealing with plateaux

▶ Allow sideway moves to escape a shoulder. ▶ An infjnite loop when we are on a fmat local optimum. ▶ Limit the number of consecutive sideway moves.

Tabu search: keep a small list of recently visited states and forbid the algorithm to return to those states.

slide-16
SLIDE 16

16/19

CQ: Is this state a local optimum?

CQ: Consider the following state of the 4-queens problem. Consider successor function B: swap the row positions of two

  • queens. Is this state a local optimum?

Q Q Q Q (A) Yes (B) No (C) I don’t know.

slide-17
SLIDE 17

17/19

CQ: Is this state a local optimum?

CQ: Consider the following state of the 4-queens problem. Suppose that we use successor function A: move a single queen to another square in the same column. Is this state a local optimum? Q Q Q Q (A) Yes (B) No (C) I don’t know.

slide-18
SLIDE 18

18/19

Choosing the Neighbour Relation

How do we choose the neighbour relation?

▶ Small incremental change to the variable assignment

There’s a trade-ofg:

▶ bigger neighbourhoods: ▶ smaller neighbourhoods:

slide-19
SLIDE 19

19/19

Revisiting the Learning Goals

By the end of the lecture, you should be able to

▶ Describe the advantages of local search over other search

algorithms.

▶ Formulate a real world problem as a local search problem

using complete-state formulations.

▶ Given a local search problem, verify whether a state is a local

  • ptimum.