Lecture 2
Lecture 2
(ENG 504)
504)
Lecture 2
/
Email: [email protected] / [email protected]
Webpage: http://www.staff.zu.edu.eg/amhm/
Agenda
AI Paradigms.
Solving Problems by Search
Tree Search Algorithms
Local Search Algorithms
2013/2014
AI Paradigms
AI Paradigms
Signs of AI:
Learn or understand from experience.
Make sense out of ambiguous or contradictory messages.
Respond quickly and successfully to new situations.
Think and reason.
Use reasoning to solve problems.
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
AI Paradigms
Signs of AI:
Deal with perplexing situations.
Understand and infer in ordinary, rational ways.
Apply knowledge to manipulate the environment.
Recognize the relative importance of different elements in a situation.
Turing Test for Intelligence:
A computer can be considered to be smart only
when a human interviewer, conversing with
both an unseen human being and an unseen
computer, can not determine which is which
2013/2014
AI Paradigms
Search.
Inference .
2013/2014
Solving Problems by
Searching
Search
Many of the tasks underlying AI can be phrased in terms of a search for the
solution to the problem .
For example: in production systems, the need to search for a sequence of rule
applications that lead to the required action.
2013/2014
Search
Problem Space:
Initial state(s).
Goal state(s). (Intermediate states)
Actions or operations.
A solution: is a sequence of actions (path) that map an initial state to
a goal state.
Best solution: the shortest path from the initial state to the goal state.
All available (feasible) paths form a search tree.
Search
2013/2014
Example: 8-Puzzle
Goal state
Initial state
2013/2014
UnInformed Search
(brute force)
Informed Search
Breadth-first (BFS)
Greedy
Best first
Depth-first (DFS)
A*
Hill climbing
Uniform-cost (UCS)
Genetic algorithms
Iterative deepening (IDS)
Local Search
Simulated annealing
Bidirectional
Tabu search
2013/2014
UnInformed Search
Blind search
Informed Search
Heuristic search
(a guess about which is best, not exact)
likely to be best
2013/2014
I.
10
Local Search
2013/2014
11
2013/2014
12
2013/2014
13
Local minimum
cost
global minimum
*
State space
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
14
h=4
n=4
h= 3
h= 2
2013/2014
15
Informed Search
Breadth-first (BFS)
Greedy
Best first
Depth-first (DFS)
A*
Hill climbing
Uniform-cost (UCS)
Genetic algorithms
Iterative deepening (IDS)
Local Search
Simulated annealing
Bidirectional
Tabu search
2013/2014
16
2013/2014
17
Initial state
Solution: h= 0
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
18
Initial state
h=3
Solution: h= 0
h=4
2013/2014
19
2013/2014
20
Informed Search
Breadth-first (BFS)
Greedy
Best first
Depth-first (DFS)
A*
Hill climbing
Uniform-cost (UCS)
Genetic algorithms
Iterative deepening (IDS)
Local Search
Bidirectional
Tabu search
Simulated annealing
2013/2014
Genetic Algorithms
Genetic Algorithms
21
2013/2014
Genetic Algorithms
22
2013/2014
23
2.
2013/2014
Flow chart:
24
If necessary
2013/2014
25
2013/2014
Genetic Algorithms
26
Genetic Algorithms
2013/2014
27
First iteration:
individuals
fitness
A 0 1 0 1 0 1
B 1 1 1 1 0 1
C 0 1 1 0 1 1
D 1 0 1 1 0 0
001010
in mind of Peb
2013/2014
Genetic Algorithms
28
001010
in mind of Peb
Second iteration:
mating
New individuals
fitness
C 0 1 1 0 1 1
E 0 1 1 1 0 0 3
D 1 0 1 1 0 0
F 1 0 1 0 1 1 4
Promising father & mother
C 0 1 1 0 1 1
G 0 1 1 0 0 0 4
D 1 0 1 1 0 0
H 1 0 1 1 1 1 3
2013/2014
Genetic Algorithms
29
001010
in mind of Peb
third iteration:
mating
New individuals
fitness
F 1 0 1 0 1 1
H 1 1 1 0 0 0 3
G 0 1 1 0 0 0
0 0 1 0 1 1 5
Promising father & mother
F 1 0 1 0 1 1
G 0 1 1 0 0 0
K 0 1 1 0 1 1 4
1 0 1 0 0 0 4
2013/2014
Genetic Algorithms
30
001010
in mind of Peb
fourth iteration:
mating
New individuals
fitness
I 0 0 1 0 1 1
L 0 0 1 0 0 0 5
J 1 0 1 0 0 0
M 1 0 1 0 1 1 4
I 0 0 1 0 1 1
N 0 0 1 0 1 0 6
J 1 0 1 0 0 0
O 1 0 1 0 0 1 3
solution
End
Genetic Algorithms
2013/2014
31
In Example #2:
There was no need for mutation:
Mutation takes evolution out of a "dead end.
When the fitness or matching becomes worse.
Success is achieved after 16 questions, which is four times faster than
checking all the possible combinations (64 possible variants).
2013/2014
Genetic Algorithms
32
Termination of a GA:
A solution is found that satisfies minimum criteria.
Fixed number of generations reached.
Allocated budget (computation time/money) reached.
The highest ranking solution's fitness is reaching or has reached a plateau
such that successive iterations no longer produce better results.
Combinations of the above.
2013/2014
33
More GA variations:
Parallel and Distributed Genetic Algorithm (PGA and DGA)
2013/2014
34
Advantages
Limitations
No absolute assurance that a
genetic algorithm will find a global
optimum/minima
If it is hard to define a fitness
function then GA will not be
useful
parallel architectures
2013/2014
35
2013/2014
Materials
36
2013/2014
Required
37
2013/2014
Assignment #1
#1
38
Thanks
2013/2014