• Sonuç bulunamadı

Yapay Zeka 802600715151

N/A
N/A
Protected

Academic year: 2021

Share "Yapay Zeka 802600715151"

Copied!
17
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Yapay Zeka 802600715151

Doç. Dr. Mehmet Serdar GÜZEL

Slides are mainly adapted from the following course page:

at http://ai.berkeley.edu created by Dan Klein and Pieter Abbeel for CS188

(2)

Lecturer

 Instructor: Assoc. Prof Dr. Mehmet S Güzel

Office hours: Tuesday, 1:30-2:30pm

Open door policy – don’t hesitate to stop by!

 Watch the course website

Assignments, lab tutorials, lecture notes

 slid e 2

(3)

Backtracking Algorithm

 Backtracking is an algorithmic-technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time (by time, here, is referred to the time elapsed till reaching any level of the search tree).

3

(4)

Backtracking Search

(5)

Improving Backtracking

 General-purpose ideas give huge gains in speed

 … but it’s all still NP-hard

 Filtering: Can we detect inevitable failure early?

 Ordering:

 Which variable should be assigned next? (MRV)

 In what order should its values be tried? (LCV)

 Structure: Can we exploit the problem structure?

(6)

Arc Consistency of an Entire CSP

 A simple form of propagation makes sure all arcs are simultaneously consistent:

 Arc consistency detects failure earlier than forward checking

 Important: If X loses a value, neighbors of X need to be rechecked!

 Must rerun after each assignment!

Remember: Delete from the tail!

WA SA NT Q

NSW

V

(7)

Limitations of Arc Consistency

 After enforcing arc consistency:

Can have one solution left

Can have multiple solutions left

Can have no solutions left (and not know it)

 Arc consistency still runs inside a backtracking search!

What went

wrong here?

(8)

K-Consistency

(9)

K-Consistency

 Increasing degrees of consistency

1-Consistency (Node Consistency): Each single node’s domain has a value which meets that node’s unary constraints

2-Consistency (Arc Consistency): For each pair of nodes, any consistent assignment to one can be extended to the other

K-Consistency: For each k nodes, any consistent assignment to k-1 can be extended to the k

th

node.

 Higher k more expensive to compute

 (You need to know the k=2 case: arc consistency)

(10)

Strong K-Consistency

Strong k-consistency: also k-1, k-2, … 1 consistent

Claim: strong n-consistency means we can solve without backtracking!

Why?

Choose any assignment to any variable

Choose a new variable

By 2-consistency, there is a choice consistent with the first

Choose a new variable

By 3-consistency, there is a choice consistent with the first 2

Lots of middle ground between arc consistency and n-consistency! (e.g. k=3, called

path consistency)

(11)

Structure

(12)

Problem Structure

 Extreme case: independent subproblems

 Example: Tasmania and mainland do not interact

 Independent subproblems are identifiable as connected components of constraint graph

 Suppose a graph of n variables can be broken into subproblems of only c variables:

 Worst-case solution cost is O((n/c)(d

c

)), linear in n

 E.g., n = 80, d = 2, c =20

 2

80

= 4 billion years at 10 million nodes/sec

 (4)(2

20

) = 0.4 seconds at 10 million nodes/sec

(13)

Tree-Structured CSPs

 Theorem: if the constraint graph has no loops, the CSP can be solved in O(n d

2

) time

 Compare to general CSPs, where worst-case time is O(d

n

)

 This property also applies to probabilistic reasoning (later): an example of the relation

between syntactic restrictions and the complexity of reasoning

(14)

Example: 8-Queens

 The eight queens problem is the problem of placing eight queens on an 8×8 chessboard such that none of them attack one another (no two are in the same row, column, or diagonal).

More generally, the n queens problem places n

queens on an n×n chessboard.

(15)

Local Search

(16)

Hill Climbing

 Simple, general idea:

 Start wherever

 Repeat: move to the best neighboring state

 If no neighbors better than current, quit

 What’s bad about this approach?

 Complete?

 Optimal?

 What’s good about it?

(17)

Hill Climbing Diagram

Referanslar

Benzer Belgeler

Theorem 1 states that a rule is rational if and only if it satisfies a standard property called contraction independence (also called independence of irrelevant alternatives in

In this painting, I transformed Vermeer's “Girl With a Pearl Earring” into an entrance point, where the abject circulates inside and outside. Different from the first conversion, I

The higher the learning rate (max. of 1.0) the faster the network is trained. However, the network has a better chance of being trained to a local minimum solution. A local minimum is

As  a  result  of  the  interviews  with  teachers,  one  of  the  most  important  and  striking  points  was  the  relation  between  regions  and  questions. 

Pac-Man is a registered trademark of Namco-Bandai Games, used here for educational purposes Demo1: pacman-l1.mp4

 State space graph: A mathematical representation of a search problem.  Nodes are (abstracted)

• It is called the depth-first search because it starts from the root node and follows each path to its greatest depth node before moving to the next path.. • DFS uses a stack

 Go: Human champions are now starting to be challenged by machines, though the best humans still beat the best machines.. In go, b