Ch5 State Space Search Methods Master
Ch5 State Space Search Methods Master
Expert Systems
State-Space
State-Space Search
Search Methods
Methods
B C D
E G
F
H
1- This tree is composed of 8 nodes.
2- Ǝ only one path between each 2 nodes (at most).
3- B is a child of A 4- C is the parent of H
5- E,F,G are called siblings 6- A is the root of the tree
7- A is the ancestor of E,F,G, and H and any child node…
8- E is the descendent of A
9- E,F,G,H,D are end-nodes.
15 20
12
D
28
B
26
16
This graph: 20
C
1- Contains 5 nodes.
2- contains 8 weighted links and directed links.
3- has a root node A
4- Ǝ 2 paths from A to B
a- A B directly with weight 20
b- A E B with sum weight 22
5- D C D is a cycle path (infinite).
I- Blind-search methods:
➪ called blind because in these search methods we
check all the generated states in an ordered fashion.
17
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
01/18/22 Search
Heuristic Search Methods:
19
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
More frequently, heuristics used greatly reduce search effort
at the expense of giving up the guarantee of finding a minimal
cost path on some problems.
20
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
If the averaged combination cost of search
method 1 is lower than the averaged
combination cost of search method 2, then
we say that search method 1 has more
heuristic power than method 2.
21
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
Evaluation Functions:
g^(n) is the length of the path in the search tree from S to node n,
and
2 8 3 1 2 3
w(n) = 4 8 4
7 1 4
6 5 7 6 5
23
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
With these needed provisions, the ordered-search algorithm then consists of the
following sequence of steps:
Put the start node s on a list called OPEN and compute f(s).
If OPEN is empty, exit with failure; otherwise continue.
Remove from OPEN that node whose f value is smallest and put it on a list
called CLOSED. Call this node n. (Resolve ties for minimal f values arbitrarily,
but always in favor of any goal node.)
If n is a goal node, exit with the solution path obtained by tracing back
through the pointers; otherwise continue.
Expand the node n, generating all of its successors. (If there are no
successors, go immediately to (2).) For each successor n, compute f(ni).
Associate with the successors not already on either OPEN or CLOSED the f
values just computed. Put these nodes on OPEN and direct pointers from them
back to n.
Associate with those successors that were already on OPEN or CLOSED the
smaller of the f values just computed and their previous f values. Put on OPEN
those successors on CLOSED whose f values were thus lowered, and redirect
to n the pointers from all nodes whose f values were lowered.
Go to (2).
24
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
25
Hence in summary;
26
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
The Importance of g^:
In some problems we need to find some path to a goal, not necessarily
the optimal path.
"During a search we do not care about the path already developed but what
lies ahead“
"Even when it is not essential to find the minimal cost path, g^ should be
included to make sure that some path will be found.“
27
This is particularly true if h^ is not a good estimator.
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
The choice of the evaluation function critically
determines the search results.
28
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
An Optimal Search Algorithm:
29
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
The Heuristic power of h^
31
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
32
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
33
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
• In this example h^ is not a lower bound on h.
• The path found happens to be minimal cost path
• but this is not always true.
• In general h^ focuses search towards the goal.
• Amount of effort that goes into the computation of h^ is also an
important consideration.
• Best h^ would be a function identical to h.
• This will result in minimum number of expansions.
• If h^ not lower bound on h is easier to compute than one that is.
Then the heuristic power of h^ is even higher.
• In some cases the heuristic power of h^ can be increased by
multiplying it by a positive constant greater than 1.
• If this constant value is very large then it will have the same
effect as setting g^=0.
• This will improve search efficiency but loose admissibility
characteristic.
34
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems
MEASURES OF PERFORMANCE:
35
Dr. Saleh Abu-soud Artificial Intelligence & Expert Systems