<email> [email protected] </email>
Mamy dany labirynt:
#include <boost/graph/graph_utility.hpp>
#include <boost\graph\adjacency_list.hpp>
#include <boost\graph\properties.hpp>
#include <iostream>
#include <string>
using namespace boost;
// T_Labirynth type - models labirynth in form of a graph
typedef
boost::adjacency_list<
vecS, vecS,
undirectedS,
property< vertex_name_t, std::string >
> T_Labirynth;
// forwardig decl.
void create_my_labirytnh (T_Labirynth & lab);
int main(void)
{
T_Labirynth lab;
create_my_labirytnh(lab);
print_graph(lab);
return 0;
}
// function creating an exemplar labirynth
void create_my_labirytnh (T_Labirynth & lab)
{
property_map<T_Labirynth, vertex_name_t>::type
labirynth_tail_xy = get(vertex_name, lab);
typedef graph_traits<T_Labirynth>::vertex_descriptor Vertex;
Vertex u1 = add_vertex(lab); Vertex u2= add_vertex(lab); Vertex u3 = add_vertex(lab);
Vertex u4 = add_vertex(lab); Vertex u5= add_vertex(lab); Vertex u6= add_vertex(lab);
Vertex u7 = add_vertex(lab); Vertex u8 = add_vertex(lab); Vertex u9 = add_vertex(lab);
/* ------------> LABIRYNTH < -------------- */
labirynth_tail_xy[u1] = "[1,1]"; labirynth_tail_xy[u2] = "[1,2]"; labirynth_tail_xy[u3] = "[1,3]";
labirynth_tail_xy[u4] = "[2,1]"; labirynth_tail_xy[u5] = "[2,2]"; labirynth_tail_xy[u6] = "[2,3]";
labirynth_tail_xy[u7] = "[3,1]"; labirynth_tail_xy[u8] = "[3,2]"; labirynth_tail_xy[u9] = "[3,3]";
add_edge(u1,u4,lab);
add_edge(u4,u5,lab);
add_edge(u5,u2,lab);
add_edge(u2,u3,lab);
add_edge(u3,u6,lab);
add_edge(u6,u9,lab);
add_edge(u7,u8,lab);
/* -------------------------------------- */
return;
}
jak widać w postaci grafu. Chciałbym tu poruszyć temat heurystyk. Jak wam się wydaje, jakie ciekawe "strategie" chodzenia po labiryncie najpewniej doprowadza człowieka do wyjścia (najmniej łażenia bez efektu)?
Jakie labirynty istnieją/istniały w rzeczywistości, lub w grach. Szczególnie ci co lubią grac w gry może mają jakieś swoje sposoby.
<url>www.turek3j.aspnet.pl</url>
</url>