Goal Programming and Heuristic Search - Semantic Scholar

5 downloads 0 Views 64KB Size Report
CLOSED: a list of nodes already expanded. GOALN: a list of goal nodes reached by efficient solution paths to the problem. COSTS: a list of cost vectors of all ...
Goal Programming and Heuristic Search L. Mandow and E. Millán. Dept. de Lenguajes y Ciencias de la Computación. Universidad de Málaga. Campus de Teatinos. MÁLAGA 29071. SPAIN. FAX: +34-5-2131397. E-mail: {lawrence, eva}@lcc.uma.es.

Abstract. The A* algorithm belongs to the class of best first graph-search algorithms and is frequently used to find minimum-cost paths. Recently, A* has been generalised to solve multiple-objective search problems, returning the set of non-dominated solution paths. This paper presents METAL-A*, an admissible heuristic search algorithm for search problems with lexicographic goals that returns the set of non-dominated paths that best achieves a set of lexicographic goals. Keywords. Lexicographic goals, heuristic search, goal programming

1 Introduction Most real world problems involve the achievement of multiple objectives or goals. In Artificial Intelligence, problem solving is frequently defined as search in a graph or state space. However, search procedures, most notably A* [3], are formulated in terms of just a single objective function. Recently, A* has been extended to support multiobjective search in trees [2] and graphs [4]. Although multiobjective approaches to decision making play an important role in multicriteria decision theory, most practical applications often come from goal-based methods. This paper describes a heuristic search procedure for lexicographic goals. We refer to this algorithm as METAL-A* which stands for METAs Lexicográficas A* (Spanish translation for lexicographic goals A*). This research is motivated by our desire to introduce more practical and realistic decision criteria in Artificial Intelligence problem-solving methods. The next section introduces notation and some details about search with several criteria. Then the algorithm is presented. Finally, an example is used to illustrate the algorithm with the help of a general technique that provides admissible heuristic functions for any finite graph.

2 Search with lexicographic goals The following notation is used: lower case letters stand for constants, real-valued functions and nodes; capital letters for sets and capital boldface for vectors. The search problem with lexicographic goal satisfaction can be defined in the following terms: Let G be a graph, s an initial node and Γ a set of goal nodes. Each arc in the graph (ni, nj) is labelled with a vector of positive costs

K(ni, nj) = (cost1(ni, nj), cost2(ni, nj),..., costq(ni, nj)), where costu(ni, nj) (u = 1,..., q) refers to the cost of the associated transition in space u. A path C within the graph G is a sequence of nodes (n1, n2,..., nm) such that for two consecutive nodes ni and ni+1 there is an arc between them. The problem consists in finding a path from the initial node to some goal node which satisfies a set of goals, one for each cost measure in the cost vector. Definition Let a type 1 search problem with (lexicographic) goal satisfaction be a problem which consists of finding a non-dominated solution path C that satisfies a set of lexicographic goals with just one goal for each priority level, i.e.: LEVEL 1: cost1(C) ≤ t1 LEVEL 2: cost2(C) ≤ t2 : ∀i ti ≥ 0 ♣ LEVEL q: costq(C) ≤ tq [1] shows how any search problem with lexicographic goals may be expressed in this form. METAL-A* has been designed to find just one or the set of nondominated solution paths to lexicographic goal satisfaction problems. A set of path evaluation functions is used to guide the search, one for each additive cost function. Definition Let G be a graph where an initial node s and a set of goal nodes Γ have been selected. The function F*(n) =(f1(n), f2(n), ..fq(n)) gives the cost of a efficient path that goes through node n from s to a goal node, where fi*(n) = gi*(n) + hi*(n),

i =1,2,...,q.

gi*(n) is the optimal cost in space i for a path from s to n; and hi*(n) is the optimal cost in space i from n to any goal node. fi*(n) is generally not known but can be approximated by a path evaluation cost function fi(n) of the type: fi(n) = gi(n) + hi(n)

i =1,2,...,q.

where gi(n) is cost in space i of the best path known from s to n, and hi(n) is an admissible heuristic function, i.e. ∀n ∀i hi(n) ≤ hi*(n). ♣ A significant difference between A* and METAL-A* is the use of several cost evaluation functions (f1(n),..., fq(n)) for each path. Definition Let G(n) be the vector of cost (g1(n), g2(n), ..gq(n)) of an efficient path from s to n. Let H(n) be a vector (h1(n), h2(n), .. hq(n)) of an optimistic estimate of the cost of a path from n to some goal node. Let F(n) be a vector (f1(n), f2(n), .., fq(n)) of the estimated values of the cost of a path that goes through n from the initial node s to some goal node. ♣

1. CREATE an empty list of nodes OPEN and open the initial node s, an empty list of nodes CLOSED and an acyclic search graph SGRAPH with the initial node s. GOALN ← ∅ ;expanded goal nodes COSTS ← ∅ ;efficient cost vectors of known paths to goal nodes CONSTRAINTS ← ∅ ;achievement of previous priority levels pr-level ← 1 ;current priority level 2. NODE SELECTION. Include in CANDIDATES all pairs (n, F) from OPEN such that F is non-dominated by any cost vector in COSTS and satisfies the set of CONSTRAINTS. Select a pair (n1 F) from CANDIDATES with the best value for: fpr-level(n). If there are several such pairs, select one with non-dominated F, e.g. using the values fpr-level+1(n), fpr-level+2(n),..., f1(n),...,fpr-level-1(n) to break the tie. If several pairs still have equal vector F, choose arbitrarily preferring goal nodes. 3. BODY. 3.1. If CANDIDATES is empty, then go to 4 (TERMINATE). 3.2. If n1 is a goal node - COSTS ← eff( COSTS ∪ G-SET(n1)). - If an efficient path for pr-level has not been found yet, r then add “fpr-level(n) ≤ max (tpr-level, f* pr-level(n))” to CONSTRAINTS - While there are more priority levels left and fpr-level+1(n) ≤ tpr-level+1 * pr-level ← pr-level +1 * Add “fpr-level(n) ≤ tpr-level” to CONSTRAINTS - If there are more priority levels to satisfy then pr-level ← pr-level +1 else If only one solution path is needed, then go to 4 (TERMINATE). else close(n1) and add n1 to GOALN. 3.3. If n1 is not a goal node, - Close(n1) - For each node n2 successor of n1 (without cycles). If n2 is in SGRAPH, and new efficient paths to n2 have been found then * update SGRAPH, i.e. add the new efficient paths and delete dominated ones If n2 is closed, then open(n2), else update F-SET(n2) and OPEN. If n2 is a new node (is not in SGRAPH) * Open(n2) * Add n2 to SGRAPH with the new paths found. 3.4. Go back to 2 (NODE SELECTION) 4. TERMINATE, using SGRAPH, COSTS, GOALN and CONSTRAINTS to return the set of efficient solution paths to the goals problem (or n1, F and SGRAPH if only one efficient solution path is needed). Fig. 1. METAL-A*

3 Metal-A* algorithm The algorithm METAL-A* is shown in figure 1. It is an iterative procedure that explores and makes explicit a portion of a graph G. The basic operation is node expansion, i.e. the generation of all the successors of a node and updating of the data structures. The following data structures are used: SGRAPH: an acyclic search graph that records efficient paths found to nodes. OPEN: a list of paths in SGRAPH that can be further expanded. CANDIDATES: a list of paths in SGRAPH that may lead to efficient solutions to the problem. CLOSED: a list of nodes already expanded. GOALN: a list of goal nodes reached by efficient solution paths to the problem. COSTS: a list of cost vectors of all paths found to goal nodes (efficient of not). CONSTRAINTS: a set of constraints to ensure goal achievement. Definition Let G-SET(n) be the set of all non-dominated cost vectors G(n) corresponding to paths from the initial node s to node n included in SGRAPH. Let H-SET(n) be the set of all non-dominated estimated cost vectors H(n) from n to goal nodes. Let F-SET(n) be the set obtained adding each vector in G-SET(n) to each vector of H-SET(n), and removing the dominated ones, that is; F-SET(n) = eff( {G(n)+H(n)/ G(n) ∈ G-SET(n) and H(n) ∈ H-SET(n)}) where eff(A) gives the set of efficient vectors of the set A without repetitions. ♣ Some properties of METAL-A* are presented in [1] including a proof about the admissibility of the algorithm provided all heuristic functions are admissible, i.e. the algorithm terminates with the set of efficient solution paths to the lexicographic goals problem (or optionally, a single efficient solution path). This section describes some important features of METAL-A*. First, the use and structure of OPEN and CLOSED lists is discussed, then the procedure for goal satisfaction is described and finally, the node selection strategy is presented.

3.1 OPEN and CLOSED lists in multicriteria search In METAL-A* the list OPEN is formed by pairs of the form (n, F) , where F ∈ F-SET(n), i.e., any generated but not yet expanded node will appear in OPEN as many times as vectors F it has in F-SET(n). Thus each pair (n, F) represents a different path that can be further expanded in the graph. The operations OPEN(node) and CLOSE(node) are defined in the following way, - To open a node n1, add to OPEN a pair (n1, F) for each vector F in F-SET(n1).

- To close a node n1, delete all pairs (n1, ·) from OPEN and add node n1 to CLOSED. Note that in any iteration any node n1 may have one (or several, but not necessarily all) vector in F-SET(n1) corresponding to a possibly efficient solution path in G. Although the algorithm seeks to extend a single path at each iteration, the expansion of a node produces the expansion of all its associated paths. Note also that when new efficient paths to a node n are found, G-SET(n) changes, and therefore F-SET(n) has to be updated. These changes are reflected in OPEN too, meaning the addition of new paths and subtraction of dominated ones.

3.2 Goal satisfaction The solution of a type 1 problem involves the achievement of a set of goals according to their priority. METAL-A* uses the functions fi(n) to estimate the cost of paths in each space. Before trying to find paths that fulfil fi+1(n) ≤ ti+i we have to find paths that satisfy fi(n) ≤ ti. When using A* with a function f(n) and initial node s, the existence of a solution path with cost f*(s) ≤ t cannot be assured until an optimal path is found, since A* always uses an optimistic estimation of the cost of the paths. To satisfy lexicographic goals, METAL-A* tries to optimise each function fi(n) in turn. Once the optimal value for a function f*i(s) is found, there are several possibilities: - If f*i(s) ≤ ti, then the corresponding goal can be satisfied, and therefore any node n candidate for expansion should have fi(n) ≤ ti. - If f*i(s) > ti, then the corresponding goal cannot be satisfied, but at least the best value found can be preserved. Any node n expanded while searching for paths for level i+1 will have to satisfy fi(n) ≤ f*i(n). The satisfaction of the goal corresponding to level i+1 is constrained to search only those paths that preserve the achievement of goals from previous levels. The set CONSTRAINTS, used when the algorithm is searching priority level i+1, can be defined as the set of constraints of the form: fk(n) ≤ max(tk, f*k(s))

k=1, 2,..., i

3.3 Node selection strategy in METAL-A* Perhaps the most important feature in any best-first search algorithm is the way nodes are selected for expansion. This mechanism is used to determine which path to explore next taking the constraints into account. METAL-A* always expands the node n from the pair (n F) selected from CANDIDATES. The pairs (n, F) from OPEN that are CANDIDATES to lead to a solution must satisfy two conditions, - F satisfies the set of CONSTRAINTS, i.e., it preserves previous goal fulfilment. - F is non-dominated by any vector of COSTS, i.e., it represents a possibly efficient path to a goal node.

If the current priority level is i, then the pair (n, F) selected from CANDIDATES is such that the i-th component of vector F, fi(n), has the best value among all the vectors F in CANDIDATES. It is possible that several nodes have the same (smallest) value for that component. In this case the values fi+1(n), fi+2(n),..., fq(n), f1(n),..., fi-1(n) are used to break the tie. Thus, a path with non-dominated vector F from CANDIDATES is selected. Note that in general lexicographic problems with several goals in each priority level, fi(n) measures the deviation from a satisfactory solution in a weighted goal model. However, the achievement of the goal fi(n) ≤ 0 does not guarantee an efficient solution to the weighted goals problem, and non-dominance has to be ensured over an extended vector F, including all original goals from that weighted goal model. [1] discusses this simple extension in more detail. At termination the efficient solution paths can be found in the search graph, selecting from COSTS those vectors that satisfy the goal set of CONSTRAINTS and tracing back in SGRAPH, from the nodes stored in GOALN, paths with those costs.

4 Using Euclidean distance as a heuristic function Any graph can be reduced to an Euclidean space in such a way that preserves the maximum information possible, i.e., the graph is minimally collapsed. Then this Euclidean distance between nodes in the collapsed graph can be used as an admissible heuristic for the original graph. The problem of collapsing the graph can be modelled as a quadratic programming problem. E.g., the coordinate xi for each node i in a unidimensional Euclidean space is given by the model: Max.

∑ (xi - x j )2

i, j∈ E

subject to xi - xj ≤ cij,

for all (i, j) ∈ E

where E is the set of arcs in the graph and cij the cost associated with each arc (i,j). Note that any feasible solution to the model can be used to obtain a heuristic. The better the solution, the more informed the heuristic will be.

5 Example This section shows how the algorithm METAL-A* and the graph reduction technique presented above can be applied to a hypothetical search problem. Let us consider that the graph in figure 2 represents a structured environment for a mobile robot on a forbidden planet, i.e. nodes stand for significant locations and arcs denote navigation is possible between nodes. Each arc is labelled with a cost vector (c1, c2) where c1 is the cost in fuel units of navigating through the arc, and c2 the time in minutes needed for navigation.. Robby, the robot, is currently working at location S and three refuelling stations are located at γ1, γ2 and γ3. Robby is given a break and decides to pick up some fuel. Currently he has 4 fuel units and according to his scheduled work load

should not take more that 6 minutes to get to the fuel station. Which path should Robby take? (3,1)

1

4

(2,1)

γ1

(1,1)

(2,2)

(3,1)

5 (1,2) (4,2)

(1,4)

s

γ2

2 (3,2)

(1,2)

6

(3,3)

(2,1)

3

(2,1)

(2,3)

γ3 7

(1,3)

Fig. 2. Example.

Let the goals be: PR. LEVEL 1: cost1(C) ≤ 4

PR. LEVEL 2: cost2(C) ≤ 6

For convenience, we may think of the problem as composed of two different graphs, with the same nodes and arcs, but with different scalar costs associated with each arc. The graphs corresponding to each space have been collapsed using the model in section 4. The results obtained are shown in figure 3. The Euclidean distance according to these coordinates will be used as a heuristic for both spaces. It can be shown that the set of efficient paths to goal nodes for this problem is, (s 3 7 γ3) : cost (4, 6) (s 1 5 γ1) : cost (6, 4)

0

1

2

3

s 2 4 γ3

3 5 7 γ2

γ1

1 6

(s 3 6 γ2) : cost (5, 5) (s 1 4 γ1) : cost (8, 3)

4

5

(Collapsed Graph 1)

(s 2 5 γ1) : cost (3, 7)

0

1

2

s

1 γ1

3 4 5 6

3

4

5

2 γ2

γ3

(Collapsed Graph 2)

Fig. 3. Coordinates of nodes for the collapsed graphs.

Let f1(n), f2(n) be the evaluation functions used by METAL-A* for cost1(C) and cost2(C). The sets OPEN, CLOSED, COSTS, CONSTRAINTS and the priority level and node selected for expansion are shown for each iteration in table 1. All vectors F of nodes in OPEN shown underlined are not in CANDIDATES.

It. 0 1

2

3

4

5

6

7

8

9

OPEN node :F-SET(node) S :(2 1)(1 4)(0 5) 3 :(1 4)(2 3) 2 :(1 5)(2 4) 1 :(4 1) 7 :(3 5)(4 4) 6 :(4 4) 2 :(1 5)(2 4) 1 :(4 1) 5 :(2 8)(3 7) 7 :(3 5)(4 4) 6 :(4 4) 1 :(4 1) γ2:(6 8) γ1:(3 7) 7 :(3 5)(4 4) 6 :(4 4) 1 :(4 1) γ3:(4 6) γ2:(6 8) γ1:(3 7) 6 :(4 4) 1 :(4 1) γ1:(3 7) γ3:(4 6) γ2:(6 8) 6 :(4 4) 1 :(4 1) 5 :(2 8)(3 7)(5 5)(6 4) 4 :(6 5)(7 4)(8 3) γ3:(4 6) γ2:(6 8) γ1:(3 7) 6 :(4 4) γ2:(5 5) γ1:(3 7) 5 :(2 8)(3 7)(5 5)(6 4) 4 :(6 5)(7 4)(8 3) γ3:(4 6) γ2:(5 5) γ1:(3 7) 5 :(2 8)(3 7)(5 5)(6 4) 4 :(6 5)(7 4)(8 3)

CLOSED

Constr.

Costs

∅ S

Pr. level 1 1

∅ ∅



3S

1





2

23S

1





5

523 S

1





7

752 3S

1





γ1

75 23S

2

f1(n) ≤ 4

(3 7)

1

172 3S

2

f1(n) ≤ 4

(3 7)

6

617 23S

2

f1(n) ≤ 4

(3 7)

γ3

γ3 6 1 7 23S

2

f1(n) ≤ 4 f2(n) ≤ 6

(3 7) (4 6)

-

Table 1. Trace of METAL-A*

Sel. Node S 3

Initially, the heuristic function h1(n) takes METAL-A* to the path s-2-5-γ1 (only 6 nodes are expanded instead of 9 if h1(n) = 0 were used). Satisfaction of the first goal is enforced through the set CONSTRAINTS, and h2(n) guides the search to satisfy the second goal. Although the best paths for f2(n) lead to γ1 and then γ2, the algorithm quickly turns to γ3, since paths to γ1 and γ2 do not satisfy the first goal. Finally, the efficient solution path S-3-7-γ3 is found. After the corresponding constraint is added to CONSTRAINTS the algorithm finds there is no open node that can possibly lead to a solution (CANDIDATES is empty) and terminates. The solution paths can be traced from COSTS, GOALN and SGRAPH. In this problem there is only one efficient solution path: S-3-7-γ3 to the lexicographic goals problem. Note that although a non-dominated path was found to γ1 it was later discarded as a solution to the problem, since it did not satisfy the time goal.

6 Conclusions Previous work in the field of heuristic search has laid the foundations of search for non-dominated paths in graphs with multiple objectives. Although non-dominance of solution paths is used as a decision criteria, many Pareto-optimal solutions may exist. Most practical applications include goals to further establish the desired properties of a solution. We have devised and implemented a new algorithm, METAL-A*, that extends the search paradigm to find solution paths for a set of goals, and proved its admissibility, i.e. the algorithm terminates with the set of non-dominated solution paths to lexicographic goals problems. The algorithm is also admissible if we want to terminate with the first non-dominated solution path found. An algorithm like METAL-A* has great potential for applications in Artificial Intelligence problems, since search is widely used as a problem solving paradigm. The application of METAL-A* to problems like design and robot path planning is the subject of our current research.

REFERENCES 1. Mandow, L. Búsqueda Heurística con Satisfacción de Metas. Tech. Rep. Dpto. Lenguajes y Ciencias Computación. University of Málaga, 1997. 2. Navinchandra, D. Exploration and Innovation in Design: Towards a computational model. Springer-Verlag, New York, 1991. 3. Pearl, J. Heuristics. Addison-Wesley, Reading, Mass. 1984. 4. Stewart, B. and White, C.C. Multiobjective A*, Journal of the ACM, Vol 38, No 4, October 1991, pp 775-814.