Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Characterization of single-agent search algorithms with generalized
start andgoal nodes
Carlos Linares LópezCarlos Linares López
Asunción Gómez-PérezAsunción Gómez-Pérez
Laboratorio de Inteligencia ArtificialLaboratorio de Inteligencia Artificial
Departamento de Inteligencia ArtificialDepartamento de Inteligencia Artificial
Facultad de InformáticaFacultad de Informática
Universidad Politécnica de MadridUniversidad Politécnica de Madrid
June, 2001June, 2001
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Exposition (I)Exposition (I)■ The N-Puzzle problemThe N-Puzzle problem
■ Discrete domainDiscrete domain■ NP-hard (1986)NP-hard (1986)■ Irregular branching factor (1998)Irregular branching factor (1998)■ Size of the state space: 16!/2 (1994)Size of the state space: 16!/2 (1994)■ Heuristics:Heuristics:
– Manhattan distance (and others, 1966)Manhattan distance (and others, 1966)– Linear conflict (1992)Linear conflict (1992)
11108 9
74
65
132
13 14 1512
11 1 7 410 13 3 89 14 15
6 5 2 12
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Exposition (II)Exposition (II)■ Searching in graphsSearching in graphs
■ Continuous domainContinuous domain..■ Heuristic: euclidean distance.Heuristic: euclidean distance.
A
B
C D
E F
A
B
C D
E F
Infomation level: +0
Information level: +100
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
ObjectivesObjectives
Study of the behaviour of various one-agent search Study of the behaviour of various one-agent search algorithms in different domains, ...algorithms in different domains, ...
... under a computational environment which guarantees ... under a computational environment which guarantees the same conditions for all of them.the same conditions for all of them.
Consideration of the bidirectional approach Consideration of the bidirectional approach (pure/perimeter) to improve unidirectional algorithms.(pure/perimeter) to improve unidirectional algorithms.
Generalization of start and goal nodes: AND, OR, NOT.Generalization of start and goal nodes: AND, OR, NOT.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
HypothesesHypotheses
■ Graph:Graph:– Edge costs are constant.Edge costs are constant.– Positive information levels.Positive information levels.
■ Generalization:Generalization:– NOT is applied to other nodes than the start or goal node.NOT is applied to other nodes than the start or goal node.– AND is not applied to the start node.AND is not applied to the start node.– The logical formulas have to be in Skolem’s normal formThe logical formulas have to be in Skolem’s normal form
■ Heuristic functions:Heuristic functions:– Always return a numerical value (not states).Always return a numerical value (not states).
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (I)Research (I)
■ New perimeter search algorithms:New perimeter search algorithms:
■ New bidirectional search algorithms:New bidirectional search algorithms:
RBFS (1992)
DFBnB (1966)
DFBnBPS* RBFPS*
RBFS (1992)
BRBFS* IBRBFS*
s
n
t
t
s
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
RBFPSRBFPS**
RBFPS* (n,F(n),ηn, F)
IF f(n) > ηn THEN RETURN f(n)IF n ∈ F THEN EXIT RBFPS*
IF SCS(n)=∅ THEN RETURN +∞FOR ni ∈ SCS(n)
Compute P(ni, ηn) = {m ∈ F | g(ni) + h(ni,m)+h*(m)≤ ηn}IF P(ni, ηn) = ∅ THEN
RETURN f(n)IF f(n) < F(n) THEN F(ni) = max {F(n), f(ni)}ELSE F(ni) = f(ni)
Sort ni in ascending order of F(ni)IF |SCS(n)| = 1 THEN F(n2)=+ ∞WHILE (F(n1) ≤ ηn AND F(n1) < + ∞)
F(n1) = RBFPS * (n1, F(n1), min {ηn, F(n2)}, P(n1, ηn))Insert n1 in ascending order of F(ni)
RETURN F(n1)
RBFPS *(s, +∞, Pd) isan admissible algorithm
RBFPS *(s, +∞, Pd) is acomplete algorithm
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
DFBnBPSDFBnBPS**
DFBnBPS* (n, η, F)
IF n ∈ F THEN EXIT DFBnBPS *
IF SCS(n)=∅ THEN RETURN +∞FOR ni ∈ SCS(n)
Compute P(ni, η) = {m ∈ F | g(ni) + h(ni,m)+h*(m)≤ η}IF P(ni, η) = ∅ THEN
RETURN ηIF f(ni) < η
IF (ni ∈ F) η = f(ni)
ELSE DFBnBPS* (ni, η, F)ELSE RETURN η
DFBnBPS *(s, +∞, Pd) isan admissible algorithm
DFBnBPS *(s, +∞, Pd) isa complete algorithm
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
BRBFSBRBFS* * (I)(I)
BUSCAR (n,F(n),ηn, F)
IF f(n) > ηn THEN RETURN f(n)IF n ∈ F THEN EXIT BUSCARIF SCS(n)=∅ THEN RETURN +∞FOR ni ∈ SCS(n)
Compute P(ni, ηn) = {m ∈ F | g(ni) + h(ni,m)+h*(m)≤ ηn}IF P(ni, ηn) = ∅ THEN
Add ni to QIF f(n) < F(n) THEN F(ni) = max {F(n), f(ni)}ELSE F(ni) = f(ni)
Insert ni in ascending order of F(ni)IF |SCS(n)| = 1 THEN F(n2)=+ ∞WHILE (F(n1) ≤ ηn AND F(n1) < + ∞)
F(n1) = BUSCAR (n1, F(n1), min {ηn, F(n2)}, P(n1, ηn))Insert n1 in ascending order of F(ni)
RETURN F(n1)
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
BRBFSBRBFS* * (II)(II)
BRBFS* (s,t)
F={t}, Q=∅, Π=hs (s)WHILE (Π is not a solution)
Π = BUSCAR (s, Π, Π, F)Swap s and tF=Q, Q= ∅
RETURN Π
BRBFS *(s, t) is an admissiblealgorithm
BRBFS *(s, t) perform variousbestfirst searches
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
IBRBFSIBRBFS**
IBRBFS *(s, t) is an admissiblealgorithm
IBRBFS* (s,t)
Fs={s}, Ft={t}, Q=∅, Π=hs (s)WHILE (Π no sea solución)
DOTomar el siguiente nodo ni de Fs
Πi = BUSCAR (ni,F(ni), Π, Ft)WHILE (Πi no sea un camino solución)Fs={Q}, Q= ∅, Π=min{Πi}Intercambiar Fs y Ft
RETURN Π
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (II)Research (II)■ Generalization (I):Generalization (I):
■ NegationNegation
Purpose: NOT n Technique
■ Do not consider the generated NOT nodes.
n n
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (III)Research (III)■ Generalization (II):Generalization (II):
■ Generalization of the start nodeGeneralization of the start node– Disjunction:Disjunction:
s1 s2 sn
t
Purpose: (s1 or s2 or sn) Technique
■ Depth-first:– Brute force: Handle the stack as a
queue.– Heuristic search: Create a unique
fictitious node.
■ Breadth-first:– Insert at the end of the queue all the
successors of the expanded nodes.
■ Complexity overload:– Constant.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (IV)Research (IV)■ Generalization (III):Generalization (III):
■ Generalization of the goal state (I):Generalization of the goal state (I):
Purpose: (t1 and t2) or (t3 and t4) or (t5 and t6) Technique
s
t2t1 t4t3 t6t5
■ Define the goal state with the aid of a binary tree.
t2t1 t4t3 t6t5
Y
O
Y Y
O
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (V)Research (V)■ Generalization (IV):Generalization (IV):
■ Generalization of the goal state (II):Generalization of the goal state (II):– Disjunction:Disjunction:
Purpose: (t1 or t2 or tn)
t2 tn
s
t1
Technique
■ Reformulate the heuristic function.
t2 tnt1
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
■ Reformulate the heuristic function :
– Number of evaluations:
– Number of min/max operations:
Research (VI)Research (VI)■ Generalization (V):Generalization (V):
■ Generalization of the goal state (III):Generalization of the goal state (III):– Conjunction:Conjunction:
Purpose: (t1 and t2 and tn) Technique
t2 tn
s
t1
∑i=1
C
N i
∑i=1
C
N i−C
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Research (VII)Research (VII)■ Search Algorithms Library:Search Algorithms Library:
■ Components:Components:– Manager:Manager:
■ Unidirectional, bidirectional and perimeter search algorithms.Unidirectional, bidirectional and perimeter search algorithms.■ Generic definition of nodes.Generic definition of nodes.
– Perimeter handling and binary trees.Perimeter handling and binary trees.– Statistics handling (steps, triggers and limits).Statistics handling (steps, triggers and limits).
■ Provides mechanisms for:Provides mechanisms for:– Running tests under the same conditions (fair comparisons).Running tests under the same conditions (fair comparisons).– Programming any type of cost function (e.g., multiobjective search).Programming any type of cost function (e.g., multiobjective search).– Defining any domain.Defining any domain.
■ Design: UML. Design: UML. ■ Programming: C++ and STL.Programming: C++ and STL.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
SAL - ManagerSAL - Manager
Base classProvides general services
Unidirectional and Perimeter Search Algorithms
Bidirectional Search Algorithms
General solver
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
SAL - NodesSAL - Nodes
Basic definition of nodeInformation about nodes
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
SAL - PerimeterSAL - Perimeter
PerimeterSet of perimeter nodes
Perimeter implementationUnique location of the perimeter
Perimeter nodesalong with their information
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
SAL - Binary TreesSAL - Binary Trees
Binary treeProvide means for handlingany logical description of startand goal nodes.
General solver
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
SAL - StatisticsSAL - StatisticsManagerProvide access to thisgeneral services
Base definitionof stats
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Using SALUsing SAL
Basic definition of node
Specialized definition of nodeIt implements the domain
New cost type(Bidimensional)
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
TestsTests
■ Algorithms tested:Algorithms tested:– Unidirectional search: IDAUnidirectional search: IDA**, RBFS and DFBnB., RBFS and DFBnB.– Bidirectional search: BRBFSBidirectional search: BRBFS** and IBRBFS and IBRBFS*.*.
– Perimeter search: BIDAPerimeter search: BIDA**, RBFPS, RBFPS** and DFBnBPS and DFBnBPS*.*.
■ Contrast hypothesis over the mean for comparing the Contrast hypothesis over the mean for comparing the time spent or the number of nodes time spent or the number of nodes generated/expanded. generated/expanded.
■ Test sets:Test sets:– Richard Korf’s 100 test set.Richard Korf’s 100 test set.– 48 cases randomly generated in graphs with 6000, 13500, 48 cases randomly generated in graphs with 6000, 13500,
24000 and 37500 nodes with information levels: +0, +50 24000 and 37500 nodes with information levels: +0, +50 and +100.and +100.
■ Sun Ultra 5 (SunOS 5.8), 450 Mhz, 256 Mb RAM and Sun Ultra 5 (SunOS 5.8), 450 Mhz, 256 Mb RAM and 512Mb Swap.512Mb Swap.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
RBFS - 15-PuzzleRBFS - 15-Puzzle
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
IDAIDA** - 15-Puzzle - 15-Puzzle
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
BIDABIDA** - 15-Puzzle - 15-Puzzle
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
RBFPSRBFPS** - 15-Puzzle - 15-Puzzle
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
BRBFSBRBFS** - 15-Puzzle - 15-Puzzle
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
IDAIDA** - Graph - Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
RBFS - GraphRBFS - Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
DFBnB - GraphDFBnB - Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
BRBFSBRBFS** - Graph - Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
IBRBFSIBRBFS** - Graph - Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Theoretical considerations (I)Theoretical considerations (I)
■ Overall distribution (1998):Overall distribution (1998):
15Puzle Graph
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
■ Minimum number of edges:
h n , m
Theoretical considerations (II)Theoretical considerations (II)
■ Depth of the search tree, d (1988):Depth of the search tree, d (1988):
15Puzle Graph
■ Minimum number of edges:
3h n , m
2 idmax
■ The precisition of the heuristic distance matters.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Theoretical considerations Theoretical considerations (III)(III)
■ Variability of the cost function (1989):Variability of the cost function (1989):
15Puzle
■ Manhattan distance:
■ Cost of the edges:
■ Variability: {0, +2}
∣h n , t −h ni , t ∣=1, n i∈SCS n
c n , ni =1
Graph
■ Likelihood of selecting the closer node as a neighbor:
2γNπ
,γ=b
i2
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (I)Conclusions (I)■ RBFS(I):RBFS(I):
■ 15-Puzle: it does not generate less nodes than IDA15-Puzle: it does not generate less nodes than IDA**..■ Graph: it generates less nodes than IDAGraph: it generates less nodes than IDA**, the more , the more
nodes IDAnodes IDA** generates, the greater the difference is. generates, the greater the difference is.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (II)Conclusions (II)■ RBFS(II):RBFS(II):
■ The number of nodes generated or the time spent can The number of nodes generated or the time spent can be successfully explained by means of the number of F be successfully explained by means of the number of F updates.updates.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (III)Conclusions (III)■ Algorithms that use thresolds:Algorithms that use thresolds:
■ 15-Puzle: good performance, but DFBnB.15-Puzle: good performance, but DFBnB.■ Graph: Bad performance.Graph: Bad performance.
15Puzle Graph
IDA* (39) #h t #g
8201103,385 474,692 8201134,256Media
Varianza 4,984 1013 170337,376 1,264 1013
IDA* (20) #h t #g
452350,3 37,8 452934,65Media
Varianza 1,398 1013 11112,8 2,092 1011
RBFS (42) #h t #g
9009828,45 810,62 9009827,45Media
Varianza 5,348 1013 440157,21 1,364 1013
RBFS (21) #h t #g
478472,047 35,809 478471,047Media
Varianza 1,878 1012 8359,062 1,878 1012
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (IV)Conclusions (IV)■ Bidirectional search algorithms (I):Bidirectional search algorithms (I):
■ 15-Puzle: High memory-demanding. Far better in the 15-Puzle: High memory-demanding. Far better in the easiest instances and worse in the most difficult ones.easiest instances and worse in the most difficult ones.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (V)Conclusions (V)■ Bidirectional search algorithms(II):Bidirectional search algorithms(II):
■ Graph: Excellent performance in all cases:Graph: Excellent performance in all cases:– BRBFS* does not lead to a significance improvement BRBFS* does not lead to a significance improvement
(hypothesis contrast with significance level 0,05).(hypothesis contrast with significance level 0,05).– IBRBFS* solves 41 out of the 48 cases:IBRBFS* solves 41 out of the 48 cases:
■ It solves 95,23% more cases than RBFS.It solves 95,23% more cases than RBFS.■ It generates 99,14% less nodes than RBFS.It generates 99,14% less nodes than RBFS.■ It consumes 78,32% less time than RBFS.It consumes 78,32% less time than RBFS.■ It performs 99,14% less F updates than RBFS.It performs 99,14% less F updates than RBFS.■ It performs 45,43% less heuristic evaluations than RBFS.It performs 45,43% less heuristic evaluations than RBFS.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Conclusions (VI)Conclusions (VI)■ Perimeter search:Perimeter search:
■ 15-Puzle: Excellent performance, but DFBnBPS15-Puzle: Excellent performance, but DFBnBPS**..■ Graph: Very bad performance. Generation of useless Graph: Very bad performance. Generation of useless
perimeter nodes (1993).perimeter nodes (1993).
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Future work (I)Future work (I)■ Mathematical characterization:Mathematical characterization:
– Time spent and nodes generated (1985, 1998).Time spent and nodes generated (1985, 1998).– Estimation of the best perimeter depth (1994).Estimation of the best perimeter depth (1994).
■ Unidirectional search:Unidirectional search:– Research into new selective search algorithms (1998).Research into new selective search algorithms (1998).– Resolution of problems Resolution of problems type-NOTtype-NOT..
■ Bidirectional search:Bidirectional search:– Generalization of start and goal nodes Generalization of start and goal nodes multidirectional multidirectional
searchsearch– Parallel implementation.Parallel implementation.
■ Perimeter search:Perimeter search:– Lazy evaluation.Lazy evaluation.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Future work (II)Future work (II)■ Improvement of the heuristic estimation (1984, 1996, Improvement of the heuristic estimation (1984, 1996,
1997).1997).■ Time-dependent search:Time-dependent search:
– Edges can be traversed without spending time.Edges can be traversed without spending time.– Each edge consumes a different amount of time for being Each edge consumes a different amount of time for being
traversed.traversed.– It is possible to wait any amount of time before traversing It is possible to wait any amount of time before traversing
an edge.an edge.
June, 2001Characterization of singleagent search algorithms
with generalized start and goal nodes
Future work (III)Future work (III)■ Learning methods (1981, 1985).Learning methods (1981, 1985).■ Voice recognition (1983).Voice recognition (1983).■ Job scheduling (1983).Job scheduling (1983).■ Artificial vision (1983).Artificial vision (1983).■ Onthologies.Onthologies.■ Clustering.Clustering.■ Neural networks.Neural networks.■ Genetic algorithms.Genetic algorithms.
Search algorithms are reasoning models