SlideShare une entreprise Scribd logo
1  sur  59
Kaya Ota
1/26/2015-3/14/2015
Computer Science Department
San Jose State University
*
*
*This is made for preparation to the mid-term
for CS156 Spring2015 in SJSU
*May contain misunderstandings!
*
* what is AI?
*PEAS
*Problem-Solving Agent
*Informed and Uninformed Search
* Informed Search
*Bidirectional
*A* search
*Uninformed Search
*DFS with Problem-Solving Agent
*BFS with Problem-Solving Agent
*Uniform Cost Search
*
*Beyond Advanced Search
*Hill-Climbing
*(deterministic) Hill Climbing
*Stochastic Hill Climbing
*Random Hill Climbing
* Local Search
*Simulated Annealing
*Local Beam Search
*Genetic Algorithm
*Game and Adversarial Search
*Minmax Algorirhm
*Constraint Satisfaction
*CSP
*
*AI is to solve an existing problem without human hands!
*Acting like a human
*Do natural language processing: to communicate with human
languages
*Knowledge representation : to store what it hears
*Automated reasoning : to draw a conclusion based on stored info.
*Machine learning :to adapt new circumstance and uncertainty
*Thinking like a human
*Brings together Cognitive Science that include linguistics,
neuroscience, AI, philosophy, anthropology and psychology
*
*Acting Rationally
*Algorithms that allow an agent to act to achieve the best
outcome/best expected outcome possible for the agent. That is a
rational agent
*Thinking Rationally
*Might involve algorithms for reasoning about things expressed in
formal logic
Definition of a Rational Agent
For each possible percept sequence, the rational agent select an action
that is expected to maximize its performance measure, given the
evidence provided by the percept sequence and whatever build-in
knowledge it has.
*PEAS
*PEAS stands for Performance, Environment, Actuator, Sensors
*Performance : how well based on which perspective.
*How do we measure quality of an agent? How well an agent find a
solution.
*Environment : Conditions for limitations based on a situation
description of a situation where an agent is and based on the
description, we want to code.
*Actuator : something make an agent act
*Sensors :something needs to make a decision
*More general(abstract) ideas then task environment
Define this 4 factor is the first
step to make AI!
*
Sensors to
detect
something
Actuators
to
execute
an action
Actuators
to
execute
an action
*
*Defining a task environment means defining PEAS of Environment
*Task Environment Properties
*Fully Observable vs Partially Observable
* Fully={chess, 8puzzle…} partial = {taxi, soccer, rescue…}
*Single Agent vs Multi-Agent
* Singleton = {rescue, 8puzzle…} Multi ={tic-toc-toe, soccer, chess}
*Deterministic vs Stochastic
* Deterministic = { } Stochastic = { }
*Episodic vs Sequential
*Static vs Dynamic
* Static = {rescue, chess, 8puzzle…} Dynamic = {soccer, taxi…}
*Discrete vs Continuous
* Discrete = {8puzzle} Continuous = {soccer}
*Known vs Unknown
* Known ={ } unknown = { }
*
*Ways of measuring a search strategy
*Completeness = guaranteed to find a solution if there is one.
*Optimality = whether found solution is best, how good.
*Time Complexity = the speed of finding a solution
*Space Complexity = how much memory is required to execute the
strategy ( i.e. how deep the smallest goal state
in the search tree.)
*Depth First Search
*Breadth First Search
*Uniform Cost Search
*Bidirectional Search
*A*star search
*
*
*Heuristic Function is a function that ranks alternatives in search
algorithms at each branching step based on available info to
decide which branch to follow.
Greedy Best First Search : chooses for its next node to expand
the node of the smallest cost according to this heuristic.
*
A* search
non-Heuristic
Heuristic
Uniform-Cost Search
Greedy Algorithm
Greedy best first
Not Complete i.e.
sometimes cannot find a
solution even if there is one
*
*A* search is a function that is a combination of a heuristic
function and a cost function(= return cost from the root to
current)
Greedy Algorithm,
estimating the cost to a
solution
Cost to get the
current node
A* Search
*
*Define A* search f(n) = c(n) + h(n)
*where c(n) =cost to get current node
*And h(n) = heuristic function which returns the number of the
panel matched to the goal state
*7 2 5
3 4
1 8 6
7 2 5
3 4
1 8 6
7 2 5
3 4
1 8 6
7 2 5
3 8 4
1 6
7 5
3 2 4
1 8 6
d
o
w
n
l
e
f
t
c(n) = 1
h(n) = 2
1 2 3
4 5 6
7 8
c(n) = 1
h(n) = 2
c(n) = 1
h(n) = 1
c(n) = 1
h(n) = 1
Go on the next Go on the next
Because light blue and red take max value
from A* search.
*
7 2 5
3 4
1 8 6
7 2 5
3 4
1 8 6
c(n) = 1
h(n) = 2
c(n) = 1
h(n) = 2
2 5
7 3 4
1 8 6
c(n) = 1
h(n) = 2
7 2 5
1 3 4
8 6
c(n) = 1
h(n) = 2
7 2
3 4 5
1 8 6
c(n) = 1
h(n) = 2
7 2 5
3 4 6
1 8
c(n) = 1
h(n) = 3
1 2 3
4 5 6
7 8
And so on………Until we get the final state
*
*Because breadth first search is Uninformed search, the way of
processing does not refer the goal state i.e. not use additional
info
*7 2 5
3 4
1 8 6
7 2
3 4 5
1 8 6
7 2 5
3 4
1 8 6
7 2 5
3 8 4
1 6
7 5
3 2 4
1 8 6
d
o
w
n
l
e
f
t
7 2 5
1 3 4
8 6
7 2 5
3 8 4
1 6
7 5
3 2 4
1 8 6
7 5
3 2 4
1 8 6
7 2 5
3 8 4
1 6
2 5
7 3 4
1 8 6
7 2 5
3 4 6
1 8
7 2 5
3 4
1 8 6
*7 2 5
3 4
1 8 6
7 2
3 4 5
1 8 6
7 2 5
3 4
1 8 6
7 2 5
3 8 4
1 6
7 5
3 2 4
1 8 6
7 2 5
1 3 4
8 6
7 2 5
3 8 4
1 6
7 5
3 2 4
1 8 6
7 5
3 2 4
1 8 6
7 2 5
3 8 4
1 6
2 5
7 3 4
1 8 6
7 2 5
3 4
1 8 6
7 2 5
3 4 6
1 8
1 2 3
4 5 6
7 8
1 2 3
4 5
7 8 6
1 2 3
4 5 6
7 8
1 2 3
4 5 6
7 8
1 2 3
4 5 6
7 8
1 2 3
4 6
7 5 8
1 2
4 5 3
7 8 6
*
*Bidirectional is another informed search because it refers to
the goal state, as A* does so.
*
*
*Hill Climbing Algorithm is, to choose successors, look at the result
of evaluation function value of neighbor state, and pick one
neighbor. If the evaluate function returns the same value for more
then two neighbors, then it will pick one neighbor randomly.
*
*Stochastic Hill Climbing checks neighbors of the evaluation
function’s value, assign probabilities depending on the evaluation
function, then roll a die!(or get starts) to decide which branch to
choose.
*
*Random Hill Climbing with restart
1. Pick an initial state randomly
2. Run hill-climbing algorithm
i. If it can find solution, then done
ii. If it cannot find solution, then pick another initial state randomly and
go back to 2.
*
*
1. Begin with k-randomly generated states.
2. Generate k-successors of all generated states.
3. Pick k-best successors
4. Using the k-best successors, go back to 1.
*Step 1
Step 2
Step 3
Back to step1
*
*
*Adversarial Search problems: which is often called Games.
*Adversarial =対立する。
*Used in Multi-agent AND competitive environment
*Consider turn taking games, and have two players
*And zero sum with perfect information
*Perfect information means the game is deterministic and the
environment is visible to all players.
*Zero sum means if player1 gets payoff(+a), then the player2 gets
payoff(-a). It is possible for both players to get pay-off 0.
*
*Let S0 be the initial state of the game. i.e. How a game is set up.
*Player(S) returns a player who have a right to take an action in
state Si
*Action(S) returns the set of legal moves in a state.
*Result(S,A) the transition model which define the result of moves
*Terminal_Test(S) determine when the game is over
*Utility(S,P) defines the final numeric value
*Optimal Strategy: to choose the best choice for us as possible as
we can even if the opponents always pick the best case
*
*Procedure MinMax takes State S as an argument.
*Define it like below:
*This function returns Numerical value that depends on goodness
of the choice and seems it is the best
*Player Max likes to choose bigger number
*Player Min likes to choose smaller number
*Example of Tic-Toc-Toe
*Action(S0) = {Up, Right, Down, Left}
*S0
T0
U3U1U0
V1 V3
T1
U2
V0 V2
Min Max
We want to know:
Minmax(S0)
A0 A1
B0 B1 B2 B0
C0 C1 C2 C3
Action(S)
*S0
T0
U3U1U0
V1 V3
T1
U2
V0 V2
Min Max
We want to know:
Minmax(S0)
A0 A1
B0 B1 B2 B0
C0 C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
*S0
T0
U3U1U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0 B1 B2 B3
C0 C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
Max_val(U0)=
Max{Min_val(Result(U0,C0))}
= Max{Min_val(V0)}
Max_val(U2)=
Max{Min_val(Result(U2,C2))}
= Max{Min_val(V2)}
Max_val(U3)=
Max{Min_val(Result(U3,C3))}
= Max{Min_val(V3)}
Max_val(U1)=
Max{Min_val(Result(U1,C1))}
= Max{Min_val(V1)}
*S0
T0
U3U1U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0 B1 B2 B3
C0 C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1 2 0 -3
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0 B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
0 -3
Max_val(T0)=
min{Max_val(Result(T0,B0))
Max_val(Result(T0,B1))}
= min{Max_val(U0),Max_val(U1)}
=min{1,2} = 1
Max_val(T1)=
min{Max_val(Result(T1,B2))
Max_val(Result(T1,B3))}
= min{Max_val(U2),Max_val(U3)}
=min{0,-3} = -3
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
0 -3
1 -3
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
0 -3
1
-3
Minmax(S0)=
max{Min_val(Result(S0,A0))
Min_val(Result(S0,A1))}
= max{Min_val(T0),Min_val(T1)}
=…recursive…=max{1,-3} = 1
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
0 -3
1
-3
max{1,-3} = 1
So, the player Max should pick the way
that he can get 1.
i.e. Action = A0 seems reasonable choice
*
*Problem of Minmax algorithm
*take too much space and time
*We want to minimize the search of the best choice.
*So, Alpha Beta Pruning comes in!
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
Assume we calculated the left side
of subtree.
And so we know we will get 1 if we
take Action A0
Not
Calculate yet
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
We know Next we will take Max.
So, if ? Is less then 0, then it does
not need to evaluate the right side
of subtree.
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
So, we evaluate little more,
evaluate the right of the left
subtree. And we get 0 in result
0
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
So, we evaluate little more,
evaluate the right of the left
subtree. And we get 0 in result
0
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
Because we get 0 in result,
If ? > 0 then ? Is not selected because
we take min in this level.
Also, if ? < 1, then ? Is not selected as
decision of state S0
0
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
So, we can skip evaluation the right
of the left subtree
0
*S0
T0
U3U1
U0
V1 V3
T1
U2
V0 V2
Min Max
A0 A1
B0
B1 B2 B3
C0
C1 C2 C3
Action(S)
Min_val(V0)
=Utility(V0,Max)=1
Min_val(V1)
=Utility(V1,Max)=2
Min_val(V2)
=Utility(V2,Max)=0
Min_val(V3) =
Utility(V3,Max)=-3
1
2
1
?
So, we can skip evaluation the right
of the left subtree
0
*
*
*Constraint Satisfaction Problem, CSP, is defined as a set of
objects whose state must satisfy a number of constrains or
limitations.
*
*A variable is said to be a node consistent if the value in its
current domain satisfy all the variable’s unary constrains.
*Example:
Given Limitation {SA != Green} this is Node consistency
Given Domain {Red, Green, Blue}
Possible Value for SA {Red, Green, Blue} = {Red, Blue}
*
*A variable is arc constraint if the values in its current domain
satisfy all the variable’s binary constraints
*Example Variable A != Variable B
*
*A pair of variables are said to be path consistency with respect
to a third variable if for every assignment of the first two
variables consistent with their constrains, there is an assignment
to the third variable that satisfies the constrains of the third
variable with the first variable and the third variable with the
second variable
*
*Minimum-Remaining Value(MRV) heuristic
*Choose the variable from amongst those that have the fewest
“legal” values.
*It is also known as the most-constrained variable heuristic and the
fail-fast heuristic.
*Degree heuristic
*Choose the variable that is involved in the largest number on other
unassigned variables
*Less possibility to use backtracking
*
*Simple Map Coloring has
an arc consistency
* Adjacent Node can not be
the same color.
*E.g. SA != WA
*Domain = {Green, Blue,
light Blue(LB)}
WA
Q
SA
NT
NSW
V
*
Q 1
WA 3
NSW
3
V
2
NT
2
SA 2
Q 1
NSW
3
V
2
SA
2
WA
2
WA
2
Q 3
SA
5
NT
3
NSW
3
V 2
SA 1
V
2
WA
2
NSW
3
*
*In Austrian example, it might choose the vertex which
minimum degree. i.e. least constrain
*Because All variables={WA,SA,NT,Q,V,NSW} have its domains
={Green, Blue, Light Blue} = 3.
*The case it does not choose WA first, we need to back tracking
*This algorithm seems powerful when we have node
consistency or unary consistency.
*
Q 3
SA 5
NSW
3
V
2
NT
3
WA
2
Q 3
NSW
3
V
2
NT
3
WA
2
WA
2
Q 3
SA
5
NT
3
NSW
3
V 2
Pick 1st b/c it
has
*
*Degree Heuristic’s choice depends on the number of degree in
graph representation.
*So, it choose the vertex that has the most arc constraint.

Contenu connexe

Similaire à Midterm review for CS156

AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAsst.prof M.Gokilavani
 
Artificial Intelligence gaming techniques
Artificial Intelligence gaming techniquesArtificial Intelligence gaming techniques
Artificial Intelligence gaming techniquesSomnathMore3
 
Tic tac toe on c++ project
Tic tac toe on c++ projectTic tac toe on c++ project
Tic tac toe on c++ projectUtkarsh Aggarwal
 
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)Grace Yang
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.pptMIT,Imphal
 
98 374 Lesson 06-slides
98 374 Lesson 06-slides98 374 Lesson 06-slides
98 374 Lesson 06-slidesTracie King
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCEudayvanand
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station softwaredharmenderlodhi021
 
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptSanGeet25
 
Interpretation Module (Part 1 of 3)
Interpretation Module (Part 1 of 3)Interpretation Module (Part 1 of 3)
Interpretation Module (Part 1 of 3)csunklab
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxNayanChandak1
 
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...IJCSIS Research Publications
 
AI based Tic Tac Toe game using Minimax Algorithm
AI based Tic Tac Toe game using Minimax AlgorithmAI based Tic Tac Toe game using Minimax Algorithm
AI based Tic Tac Toe game using Minimax AlgorithmKiran Shahi
 
assign4assign4_part1bonnie.c This is a file system ben.docx
assign4assign4_part1bonnie.c  This is a file system ben.docxassign4assign4_part1bonnie.c  This is a file system ben.docx
assign4assign4_part1bonnie.c This is a file system ben.docxfestockton
 

Similaire à Midterm review for CS156 (20)

Capgemini 1
Capgemini 1Capgemini 1
Capgemini 1
 
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdfAI3391 Artificial Intelligence UNIT III Notes_merged.pdf
AI3391 Artificial Intelligence UNIT III Notes_merged.pdf
 
Artificial Intelligence gaming techniques
Artificial Intelligence gaming techniquesArtificial Intelligence gaming techniques
Artificial Intelligence gaming techniques
 
AI Lesson 07
AI Lesson 07AI Lesson 07
AI Lesson 07
 
Tic tac toe on c++ project
Tic tac toe on c++ projectTic tac toe on c++ project
Tic tac toe on c++ project
 
Deep RL.pdf
Deep RL.pdfDeep RL.pdf
Deep RL.pdf
 
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)
Win-Win Search: Dual-Agent Stochastic Game in Session Search (SIGIR 2014)
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.ppt
 
1.game
1.game1.game
1.game
 
98 374 Lesson 06-slides
98 374 Lesson 06-slides98 374 Lesson 06-slides
98 374 Lesson 06-slides
 
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
21CSC206T_UNIT3.pptx.pdf ARITIFICIAL INTELLIGENCE
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station software
 
ch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.pptch_5 Game playing Min max and Alpha Beta pruning.ppt
ch_5 Game playing Min max and Alpha Beta pruning.ppt
 
Shoot-for-A-Star
Shoot-for-A-StarShoot-for-A-Star
Shoot-for-A-Star
 
Interpretation Module (Part 1 of 3)
Interpretation Module (Part 1 of 3)Interpretation Module (Part 1 of 3)
Interpretation Module (Part 1 of 3)
 
MINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptxMINI-MAX ALGORITHM.pptx
MINI-MAX ALGORITHM.pptx
 
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...
The Role of Shologuti in Artificial Intelligence Research: A Rural Game of Ba...
 
Sorting
SortingSorting
Sorting
 
AI based Tic Tac Toe game using Minimax Algorithm
AI based Tic Tac Toe game using Minimax AlgorithmAI based Tic Tac Toe game using Minimax Algorithm
AI based Tic Tac Toe game using Minimax Algorithm
 
assign4assign4_part1bonnie.c This is a file system ben.docx
assign4assign4_part1bonnie.c  This is a file system ben.docxassign4assign4_part1bonnie.c  This is a file system ben.docx
assign4assign4_part1bonnie.c This is a file system ben.docx
 

Plus de Kaya Ota

Solr 勉強会 20191028
Solr 勉強会 20191028Solr 勉強会 20191028
Solr 勉強会 20191028Kaya Ota
 
Privacy statement
Privacy statementPrivacy statement
Privacy statementKaya Ota
 
CS166 Final project
CS166 Final projectCS166 Final project
CS166 Final projectKaya Ota
 
Edited keeping happiness
Edited keeping happinessEdited keeping happiness
Edited keeping happinessKaya Ota
 
Database Management System Review
Database Management System ReviewDatabase Management System Review
Database Management System ReviewKaya Ota
 
javascript
javascript javascript
javascript Kaya Ota
 
Math178 hw7
Math178 hw7Math178 hw7
Math178 hw7Kaya Ota
 
CS152 Programming Paradigm
CS152 Programming Paradigm CS152 Programming Paradigm
CS152 Programming Paradigm Kaya Ota
 
Umap traversabilityin graph
Umap traversabilityin graphUmap traversabilityin graph
Umap traversabilityin graphKaya Ota
 
Price Distribution and Consumer Surplus
Price Distribution and Consumer Surplus Price Distribution and Consumer Surplus
Price Distribution and Consumer Surplus Kaya Ota
 
Jit complier
Jit complierJit complier
Jit complierKaya Ota
 
Methodologies of Software Engineering
Methodologies of Software EngineeringMethodologies of Software Engineering
Methodologies of Software EngineeringKaya Ota
 

Plus de Kaya Ota (12)

Solr 勉強会 20191028
Solr 勉強会 20191028Solr 勉強会 20191028
Solr 勉強会 20191028
 
Privacy statement
Privacy statementPrivacy statement
Privacy statement
 
CS166 Final project
CS166 Final projectCS166 Final project
CS166 Final project
 
Edited keeping happiness
Edited keeping happinessEdited keeping happiness
Edited keeping happiness
 
Database Management System Review
Database Management System ReviewDatabase Management System Review
Database Management System Review
 
javascript
javascript javascript
javascript
 
Math178 hw7
Math178 hw7Math178 hw7
Math178 hw7
 
CS152 Programming Paradigm
CS152 Programming Paradigm CS152 Programming Paradigm
CS152 Programming Paradigm
 
Umap traversabilityin graph
Umap traversabilityin graphUmap traversabilityin graph
Umap traversabilityin graph
 
Price Distribution and Consumer Surplus
Price Distribution and Consumer Surplus Price Distribution and Consumer Surplus
Price Distribution and Consumer Surplus
 
Jit complier
Jit complierJit complier
Jit complier
 
Methodologies of Software Engineering
Methodologies of Software EngineeringMethodologies of Software Engineering
Methodologies of Software Engineering
 

Dernier

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptxNikhil Raut
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsDILIPKUMARMONDAL6
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 

Dernier (20)

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teams
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 

Midterm review for CS156

  • 1. Kaya Ota 1/26/2015-3/14/2015 Computer Science Department San Jose State University *
  • 2. * *This is made for preparation to the mid-term for CS156 Spring2015 in SJSU *May contain misunderstandings!
  • 3. * * what is AI? *PEAS *Problem-Solving Agent *Informed and Uninformed Search * Informed Search *Bidirectional *A* search *Uninformed Search *DFS with Problem-Solving Agent *BFS with Problem-Solving Agent *Uniform Cost Search
  • 4. * *Beyond Advanced Search *Hill-Climbing *(deterministic) Hill Climbing *Stochastic Hill Climbing *Random Hill Climbing * Local Search *Simulated Annealing *Local Beam Search *Genetic Algorithm *Game and Adversarial Search *Minmax Algorirhm *Constraint Satisfaction *CSP
  • 5. * *AI is to solve an existing problem without human hands! *Acting like a human *Do natural language processing: to communicate with human languages *Knowledge representation : to store what it hears *Automated reasoning : to draw a conclusion based on stored info. *Machine learning :to adapt new circumstance and uncertainty *Thinking like a human *Brings together Cognitive Science that include linguistics, neuroscience, AI, philosophy, anthropology and psychology
  • 6. * *Acting Rationally *Algorithms that allow an agent to act to achieve the best outcome/best expected outcome possible for the agent. That is a rational agent *Thinking Rationally *Might involve algorithms for reasoning about things expressed in formal logic Definition of a Rational Agent For each possible percept sequence, the rational agent select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and whatever build-in knowledge it has.
  • 7. *PEAS *PEAS stands for Performance, Environment, Actuator, Sensors *Performance : how well based on which perspective. *How do we measure quality of an agent? How well an agent find a solution. *Environment : Conditions for limitations based on a situation description of a situation where an agent is and based on the description, we want to code. *Actuator : something make an agent act *Sensors :something needs to make a decision *More general(abstract) ideas then task environment Define this 4 factor is the first step to make AI!
  • 9. * *Defining a task environment means defining PEAS of Environment *Task Environment Properties *Fully Observable vs Partially Observable * Fully={chess, 8puzzle…} partial = {taxi, soccer, rescue…} *Single Agent vs Multi-Agent * Singleton = {rescue, 8puzzle…} Multi ={tic-toc-toe, soccer, chess} *Deterministic vs Stochastic * Deterministic = { } Stochastic = { } *Episodic vs Sequential *Static vs Dynamic * Static = {rescue, chess, 8puzzle…} Dynamic = {soccer, taxi…} *Discrete vs Continuous * Discrete = {8puzzle} Continuous = {soccer} *Known vs Unknown * Known ={ } unknown = { }
  • 10. * *Ways of measuring a search strategy *Completeness = guaranteed to find a solution if there is one. *Optimality = whether found solution is best, how good. *Time Complexity = the speed of finding a solution *Space Complexity = how much memory is required to execute the strategy ( i.e. how deep the smallest goal state in the search tree.)
  • 11. *Depth First Search *Breadth First Search *Uniform Cost Search *Bidirectional Search *A*star search *
  • 12. * *Heuristic Function is a function that ranks alternatives in search algorithms at each branching step based on available info to decide which branch to follow. Greedy Best First Search : chooses for its next node to expand the node of the smallest cost according to this heuristic.
  • 13. * A* search non-Heuristic Heuristic Uniform-Cost Search Greedy Algorithm Greedy best first Not Complete i.e. sometimes cannot find a solution even if there is one
  • 14. * *A* search is a function that is a combination of a heuristic function and a cost function(= return cost from the root to current) Greedy Algorithm, estimating the cost to a solution Cost to get the current node A* Search
  • 15. * *Define A* search f(n) = c(n) + h(n) *where c(n) =cost to get current node *And h(n) = heuristic function which returns the number of the panel matched to the goal state
  • 16. *7 2 5 3 4 1 8 6 7 2 5 3 4 1 8 6 7 2 5 3 4 1 8 6 7 2 5 3 8 4 1 6 7 5 3 2 4 1 8 6 d o w n l e f t c(n) = 1 h(n) = 2 1 2 3 4 5 6 7 8 c(n) = 1 h(n) = 2 c(n) = 1 h(n) = 1 c(n) = 1 h(n) = 1 Go on the next Go on the next Because light blue and red take max value from A* search.
  • 17. * 7 2 5 3 4 1 8 6 7 2 5 3 4 1 8 6 c(n) = 1 h(n) = 2 c(n) = 1 h(n) = 2 2 5 7 3 4 1 8 6 c(n) = 1 h(n) = 2 7 2 5 1 3 4 8 6 c(n) = 1 h(n) = 2 7 2 3 4 5 1 8 6 c(n) = 1 h(n) = 2 7 2 5 3 4 6 1 8 c(n) = 1 h(n) = 3 1 2 3 4 5 6 7 8 And so on………Until we get the final state
  • 18. * *Because breadth first search is Uninformed search, the way of processing does not refer the goal state i.e. not use additional info
  • 19. *7 2 5 3 4 1 8 6 7 2 3 4 5 1 8 6 7 2 5 3 4 1 8 6 7 2 5 3 8 4 1 6 7 5 3 2 4 1 8 6 d o w n l e f t 7 2 5 1 3 4 8 6 7 2 5 3 8 4 1 6 7 5 3 2 4 1 8 6 7 5 3 2 4 1 8 6 7 2 5 3 8 4 1 6 2 5 7 3 4 1 8 6 7 2 5 3 4 6 1 8 7 2 5 3 4 1 8 6
  • 20. *7 2 5 3 4 1 8 6 7 2 3 4 5 1 8 6 7 2 5 3 4 1 8 6 7 2 5 3 8 4 1 6 7 5 3 2 4 1 8 6 7 2 5 1 3 4 8 6 7 2 5 3 8 4 1 6 7 5 3 2 4 1 8 6 7 5 3 2 4 1 8 6 7 2 5 3 8 4 1 6 2 5 7 3 4 1 8 6 7 2 5 3 4 1 8 6 7 2 5 3 4 6 1 8 1 2 3 4 5 6 7 8 1 2 3 4 5 7 8 6 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 6 7 5 8 1 2 4 5 3 7 8 6
  • 21. * *Bidirectional is another informed search because it refers to the goal state, as A* does so.
  • 22. *
  • 23. * *Hill Climbing Algorithm is, to choose successors, look at the result of evaluation function value of neighbor state, and pick one neighbor. If the evaluate function returns the same value for more then two neighbors, then it will pick one neighbor randomly.
  • 24. * *Stochastic Hill Climbing checks neighbors of the evaluation function’s value, assign probabilities depending on the evaluation function, then roll a die!(or get starts) to decide which branch to choose.
  • 25. * *Random Hill Climbing with restart 1. Pick an initial state randomly 2. Run hill-climbing algorithm i. If it can find solution, then done ii. If it cannot find solution, then pick another initial state randomly and go back to 2.
  • 26. *
  • 27. * 1. Begin with k-randomly generated states. 2. Generate k-successors of all generated states. 3. Pick k-best successors 4. Using the k-best successors, go back to 1.
  • 28. *Step 1 Step 2 Step 3 Back to step1
  • 29. *
  • 30. * *Adversarial Search problems: which is often called Games. *Adversarial =対立する。 *Used in Multi-agent AND competitive environment *Consider turn taking games, and have two players *And zero sum with perfect information *Perfect information means the game is deterministic and the environment is visible to all players. *Zero sum means if player1 gets payoff(+a), then the player2 gets payoff(-a). It is possible for both players to get pay-off 0.
  • 31. * *Let S0 be the initial state of the game. i.e. How a game is set up. *Player(S) returns a player who have a right to take an action in state Si *Action(S) returns the set of legal moves in a state. *Result(S,A) the transition model which define the result of moves *Terminal_Test(S) determine when the game is over *Utility(S,P) defines the final numeric value *Optimal Strategy: to choose the best choice for us as possible as we can even if the opponents always pick the best case
  • 32. * *Procedure MinMax takes State S as an argument. *Define it like below: *This function returns Numerical value that depends on goodness of the choice and seems it is the best *Player Max likes to choose bigger number *Player Min likes to choose smaller number *Example of Tic-Toc-Toe *Action(S0) = {Up, Right, Down, Left}
  • 33. *S0 T0 U3U1U0 V1 V3 T1 U2 V0 V2 Min Max We want to know: Minmax(S0) A0 A1 B0 B1 B2 B0 C0 C1 C2 C3 Action(S)
  • 34. *S0 T0 U3U1U0 V1 V3 T1 U2 V0 V2 Min Max We want to know: Minmax(S0) A0 A1 B0 B1 B2 B0 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3
  • 35. *S0 T0 U3U1U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 Max_val(U0)= Max{Min_val(Result(U0,C0))} = Max{Min_val(V0)} Max_val(U2)= Max{Min_val(Result(U2,C2))} = Max{Min_val(V2)} Max_val(U3)= Max{Min_val(Result(U3,C3))} = Max{Min_val(V3)} Max_val(U1)= Max{Min_val(Result(U1,C1))} = Max{Min_val(V1)}
  • 36. *S0 T0 U3U1U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 0 -3
  • 37. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 0 -3 Max_val(T0)= min{Max_val(Result(T0,B0)) Max_val(Result(T0,B1))} = min{Max_val(U0),Max_val(U1)} =min{1,2} = 1 Max_val(T1)= min{Max_val(Result(T1,B2)) Max_val(Result(T1,B3))} = min{Max_val(U2),Max_val(U3)} =min{0,-3} = -3
  • 38. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 0 -3 1 -3
  • 39. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 0 -3 1 -3 Minmax(S0)= max{Min_val(Result(S0,A0)) Min_val(Result(S0,A1))} = max{Min_val(T0),Min_val(T1)} =…recursive…=max{1,-3} = 1
  • 40. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 0 -3 1 -3 max{1,-3} = 1 So, the player Max should pick the way that he can get 1. i.e. Action = A0 seems reasonable choice
  • 41. * *Problem of Minmax algorithm *take too much space and time *We want to minimize the search of the best choice. *So, Alpha Beta Pruning comes in!
  • 42. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? Assume we calculated the left side of subtree. And so we know we will get 1 if we take Action A0 Not Calculate yet
  • 43. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? We know Next we will take Max. So, if ? Is less then 0, then it does not need to evaluate the right side of subtree.
  • 44. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? So, we evaluate little more, evaluate the right of the left subtree. And we get 0 in result 0
  • 45. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? So, we evaluate little more, evaluate the right of the left subtree. And we get 0 in result 0
  • 46. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? Because we get 0 in result, If ? > 0 then ? Is not selected because we take min in this level. Also, if ? < 1, then ? Is not selected as decision of state S0 0
  • 47. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? So, we can skip evaluation the right of the left subtree 0
  • 48. *S0 T0 U3U1 U0 V1 V3 T1 U2 V0 V2 Min Max A0 A1 B0 B1 B2 B3 C0 C1 C2 C3 Action(S) Min_val(V0) =Utility(V0,Max)=1 Min_val(V1) =Utility(V1,Max)=2 Min_val(V2) =Utility(V2,Max)=0 Min_val(V3) = Utility(V3,Max)=-3 1 2 1 ? So, we can skip evaluation the right of the left subtree 0
  • 49. *
  • 50. * *Constraint Satisfaction Problem, CSP, is defined as a set of objects whose state must satisfy a number of constrains or limitations.
  • 51. * *A variable is said to be a node consistent if the value in its current domain satisfy all the variable’s unary constrains. *Example: Given Limitation {SA != Green} this is Node consistency Given Domain {Red, Green, Blue} Possible Value for SA {Red, Green, Blue} = {Red, Blue}
  • 52. * *A variable is arc constraint if the values in its current domain satisfy all the variable’s binary constraints *Example Variable A != Variable B
  • 53. * *A pair of variables are said to be path consistency with respect to a third variable if for every assignment of the first two variables consistent with their constrains, there is an assignment to the third variable that satisfies the constrains of the third variable with the first variable and the third variable with the second variable
  • 54. * *Minimum-Remaining Value(MRV) heuristic *Choose the variable from amongst those that have the fewest “legal” values. *It is also known as the most-constrained variable heuristic and the fail-fast heuristic. *Degree heuristic *Choose the variable that is involved in the largest number on other unassigned variables *Less possibility to use backtracking
  • 55. * *Simple Map Coloring has an arc consistency * Adjacent Node can not be the same color. *E.g. SA != WA *Domain = {Green, Blue, light Blue(LB)} WA Q SA NT NSW V
  • 56. * Q 1 WA 3 NSW 3 V 2 NT 2 SA 2 Q 1 NSW 3 V 2 SA 2 WA 2 WA 2 Q 3 SA 5 NT 3 NSW 3 V 2 SA 1 V 2 WA 2 NSW 3
  • 57. * *In Austrian example, it might choose the vertex which minimum degree. i.e. least constrain *Because All variables={WA,SA,NT,Q,V,NSW} have its domains ={Green, Blue, Light Blue} = 3. *The case it does not choose WA first, we need to back tracking *This algorithm seems powerful when we have node consistency or unary consistency.
  • 58. * Q 3 SA 5 NSW 3 V 2 NT 3 WA 2 Q 3 NSW 3 V 2 NT 3 WA 2 WA 2 Q 3 SA 5 NT 3 NSW 3 V 2 Pick 1st b/c it has
  • 59. * *Degree Heuristic’s choice depends on the number of degree in graph representation. *So, it choose the vertex that has the most arc constraint.