1 | <HTML> |
---|
2 | <!-- |
---|
3 | -- Copyright (c) 2004 Kris Beevers |
---|
4 | -- |
---|
5 | -- Permission to use, copy, modify, distribute and sell this software |
---|
6 | -- and its documentation for any purpose is hereby granted without fee, |
---|
7 | -- provided that the above copyright notice appears in all copies and |
---|
8 | -- that both that copyright notice and this permission notice appear |
---|
9 | -- in supporting documentation. We make no |
---|
10 | -- representations about the suitability of this software for any |
---|
11 | -- purpose. It is provided "as is" without express or implied warranty. |
---|
12 | --> |
---|
13 | <Head> |
---|
14 | <Title>Boost Graph Library: AStarHeuristic</Title> |
---|
15 | <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" |
---|
16 | ALINK="#ff0000"> |
---|
17 | <IMG SRC="../../../boost.png" |
---|
18 | ALT="C++ Boost" width="277" height="86"> |
---|
19 | |
---|
20 | <BR Clear> |
---|
21 | |
---|
22 | <H1>AStar Heuristic Concept</H1> |
---|
23 | |
---|
24 | This concept defines the interface for the heuristic function of an A* |
---|
25 | search, which is responsible for estimating the remaining cost from |
---|
26 | some vertex to a goal. The user can create a class that matches this |
---|
27 | interface, and then pass objects of the class into <a |
---|
28 | href="./astar_search.html"><tt>astar_search()</tt></a> to guide the |
---|
29 | order of vertex examination of the search. The heuristic instance |
---|
30 | must incorporate any necessary information about goal vertices in the |
---|
31 | graph. |
---|
32 | |
---|
33 | For further discussion of the use of heuristics in an A* search, see |
---|
34 | the documentation of <a |
---|
35 | href="./astar_search.html">astar_search()</a>. |
---|
36 | |
---|
37 | <h3>Refinement of</h3> |
---|
38 | |
---|
39 | <a href="http://www.sgi.com/tech/stl/UnaryFunction.html">Unary |
---|
40 | Function</a> (must take a single argument -- a graph vertex -- and |
---|
41 | return a cost value) and <a |
---|
42 | href="../../utility/CopyConstructible.html">Copy Constructible</a> |
---|
43 | (copying a heuristic should be a lightweight operation). |
---|
44 | |
---|
45 | |
---|
46 | <h3>Notation</h3> |
---|
47 | |
---|
48 | <Table> |
---|
49 | <TR> |
---|
50 | <TD><tt>H</tt></TD> |
---|
51 | <TD>A type that is a model of AStar Heuristic.</TD> |
---|
52 | </TR> |
---|
53 | |
---|
54 | <TR> |
---|
55 | <TD><tt>h</tt></TD> |
---|
56 | <TD>An object of type <tt>H</tt>.</TD> |
---|
57 | </TR> |
---|
58 | |
---|
59 | <TR> |
---|
60 | <TD><tt>G</tt></TD> |
---|
61 | <TD>A type that is a model of Graph.</TD> |
---|
62 | </TR> |
---|
63 | |
---|
64 | <TR> |
---|
65 | <TD><tt>g</tt></TD> |
---|
66 | <TD>An object of type <tt>G</tt>.</TD> |
---|
67 | </TR> |
---|
68 | |
---|
69 | <TR> |
---|
70 | <TD><tt>u</tt></TD> |
---|
71 | <TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD> |
---|
72 | </TR> |
---|
73 | |
---|
74 | <TR> |
---|
75 | <TD><tt>CostType</tt></TD> |
---|
76 | <TD>A type that can be used with the <tt>compare</tt> and |
---|
77 | <tt>combine</tt> functions passed to A*.</TD> |
---|
78 | </TR> |
---|
79 | |
---|
80 | <TR> |
---|
81 | <TD><tt>c</tt></TD> |
---|
82 | <TD>An object of type <tt>CostType</tt>.</TD> |
---|
83 | </TR> |
---|
84 | |
---|
85 | </table> |
---|
86 | |
---|
87 | <h3>Associated Types</h3> |
---|
88 | |
---|
89 | none |
---|
90 | <p> |
---|
91 | |
---|
92 | <h3>Valid Expressions</h3> |
---|
93 | |
---|
94 | <table border> |
---|
95 | <tr> |
---|
96 | <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> |
---|
97 | </tr> |
---|
98 | |
---|
99 | <tr> |
---|
100 | <td>Call Heuristic</td> |
---|
101 | <td><tt>CostType c = h(u)</tt></td> |
---|
102 | <td><tt>CostType</tt></td> |
---|
103 | <td> |
---|
104 | Called for the target of every out edge of a vertex being examined. |
---|
105 | </td> |
---|
106 | </tr> |
---|
107 | |
---|
108 | </table> |
---|
109 | |
---|
110 | <h3>Models</h3> |
---|
111 | |
---|
112 | <ul> |
---|
113 | <li><a href="./astar_heuristic.html"><tt>astar_heuristic</tt></a> |
---|
114 | </ul> |
---|
115 | |
---|
116 | <h3>Concept Checking Class</h3> |
---|
117 | |
---|
118 | <pre> |
---|
119 | template <class Heuristic, class Graph> |
---|
120 | struct AStarHeuristicConcept { |
---|
121 | void constraints() |
---|
122 | { |
---|
123 | function_requires< CopyConstructibleConcept<Heuristic> >(); |
---|
124 | h(u); |
---|
125 | } |
---|
126 | Heuristic h; |
---|
127 | typename graph_traits<Graph>::vertex_descriptor u; |
---|
128 | }; |
---|
129 | </pre> |
---|
130 | |
---|
131 | <br> |
---|
132 | <HR> |
---|
133 | <TABLE> |
---|
134 | <TR valign=top> |
---|
135 | <TD nowrap>Copyright © 2004</TD><TD> |
---|
136 | <A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>, |
---|
137 | Rensselaer Polytechnic Institute (<A |
---|
138 | HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>) |
---|
139 | </TD></TR></TABLE> |
---|
140 | |
---|
141 | </BODY> |
---|
142 | </HTML> |
---|