Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/AStarHeuristic.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 3.4 KB
RevLine 
[12]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
24This concept defines the interface for the heuristic function of an A*
25search, which is responsible for estimating the remaining cost from
26some vertex to a goal.  The user can create a class that matches this
27interface, and then pass objects of the class into <a
28href="./astar_search.html"><tt>astar_search()</tt></a> to guide the
29order of vertex examination of the search.  The heuristic instance
30must incorporate any necessary information about goal vertices in the
31graph.
32
33For further discussion of the use of heuristics in an A* search, see
34the documentation of <a
35href="./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
40Function</a> (must take a single argument -- a graph vertex -- and
41return a cost value) and <a
42href="../../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&lt;G&gt;::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
89none
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>
104Called 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 &lt;class Heuristic, class Graph&gt;
120  struct AStarHeuristicConcept {
121    void constraints()
122    {
123      function_requires&lt; CopyConstructibleConcept&lt;Heuristic&gt; &gt;();
124      h(u);
125    }
126    Heuristic h;
127    typename graph_traits&lt;Graph&gt;::vertex_descriptor u;
128  };
129</pre>
130
131<br>
132<HR>
133<TABLE>
134<TR valign=top>
135<TD nowrap>Copyright &copy 2004</TD><TD>
136<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
137Rensselaer Polytechnic Institute (<A
138HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
139</TD></TR></TABLE>
140
141</BODY>
142</HTML> 
Note: See TracBrowser for help on using the repository browser.