Search
Download provided codes lab09_som.zip and run the main script eval_som.py
eval_som.py
Slide 15 from the Lecture08:
Utilize 'alternate goal' concept for solving TSP with neighborhoods (TSPN). In each epoch, the neurons are adapted towards the goals which inhibits them. But, in the TSPN, the neurons are adapted to the closes point in the specific goal neighborhood. Therefore, this concept enables to find shorter solutions, see the right image and the following GIF with SOM evolution.
Click on the following image to see the SOM evolution in GIF.
update_goal_potition(…)
alternate goal
In contrast to a classical path planning (from A to B), we need to estimate all distances between the given points in the multi-goal path planning problem. It can be done by existing algorithm:
Notice that algorithms from the first two groups have to be called multiple times to get the full distance matrix.
Download prepared codes and configuration files lab09_pacman.zip. Then download and compile LKH solver (implementation of the Lin–Kernighan heuristic algorithm) as follows:
cd LKH ./install.sh cd -
Now, you should be able to run Packman example.
./eval_packman.py
The result should be similar to:
This scenario is prepared with a working example which finds the shortest tour (TSP solution) based on the Euclidean distance. However, the obstacles in the environment are not considered and, therefore, the final trajectory collides with the walls, see the image above.
Our task is to replace the Euclidean distance by the shortest feasible trajectory in the maze. Since the original Pac-man can move only in 4 direction, we also utilizes the same 4 moves during the planning phase and discard all diagonal moves. In the prepared codes, a naive implementation is provided using A* from previous lectures. The A* algorithm needs to be called $\mathcal(n^2)$ times which is the main drawback of this approach. You can simply run it by enabling the following line:
path = solver.plan_tour_obstacles(map, goals, "E4")