1 | #define _SCL_SECURE_NO_WARNINGS
|
---|
2 |
|
---|
3 | #include <boost/graph/astar_search.hpp>
|
---|
4 | #include <boost/graph/grid_graph.hpp>
|
---|
5 |
|
---|
6 | using Grid = boost::grid_graph< 2 >;
|
---|
7 | using Vertex = boost::graph_traits< Grid >::vertex_descriptor;
|
---|
8 |
|
---|
9 | struct DijkstraHeuristic : boost::astar_heuristic< Grid, int >
|
---|
10 | {
|
---|
11 | int operator()( const Vertex& ) noexcept
|
---|
12 | {
|
---|
13 | return 0;
|
---|
14 | }
|
---|
15 | };
|
---|
16 |
|
---|
17 | int main( int, char** )
|
---|
18 | {
|
---|
19 | Grid grid{ { 30u, 1u } };
|
---|
20 | boost::static_property_map< int > weights{ 1 };
|
---|
21 | const Vertex start{ 0u, 0u };
|
---|
22 | boost::astar_search(
|
---|
23 | grid,
|
---|
24 | start,
|
---|
25 | DijkstraHeuristic{},
|
---|
26 | boost::weight_map( weights )
|
---|
27 | );
|
---|
28 | return 0;
|
---|
29 | }
|
---|