Skip to content

ColinHmrl/pathfinding-algorithm

Repository files navigation

Pathfinding algorithms

I've implemented 4 algorithms for pathfinding:

  • matrix_ant_colony_optimization : uses the aco algorithm to find the best eulerian path in a matrix. (usable as library)
  • matrix_genetic : uses a genetic algorithm to find the best eulerian path in a matrix. (usable as library)
  • 3d_coords_insertion : uses a insertion algorithm to find a good path between two points in a 3d grid.
  • 3d_coords_genetic : uses a genetic algorithm to find the shortest path between two points in a 3d grid.

opti aco

opti_aco permit to 'try' to find the bests parameters for the aco algorithm. It uses a grid of parameters to random search and to test on multiple datasets and compare the result with a inferior born calculed by a simplex algorithm.

3d coords genetic

How many generations would you want?
200
Current best is : 97.30700759856946 in 0 ms, at the 0th generation
Current best is : 88.3000779743256 in 1 ms, at the 1th generation
Current best is : 85.34555031703923 in 1 ms, at the 2th generation Current best is : 80.10933511367269 in 2 ms, at the 3th generation
Current best is : 78.07591702351908 in 7 ms, at the 13th generation
Current best is : 75.34024589175635 in 9 ms, at the 17th generation
Current best is : 75.03680560563042 in 13 ms, at the 24th generation
Current best is : 74.60510880338776 in 15 ms, at the 28th generation
Current best is : 74.30166851726182 in 24 ms, at the 45th generation
Best found is : 74.30166851726182 in 24 ms
The way is : [[9, 2, 4], [9, 5, 5], [9, 2, 7], [3, 0, 8], [5, 4, 6], [8, 6, 5], [7, 8, 4], [6, 5, 3], [5, 5, 2], [2, 6, 2], [2, 9, 4], [6, 9, 7], [7, 8, 8], [3, 0, 4], [2, 0, 4], [1, 3, 0], [2, 6, 1], [2, 8, 6], [2, 6, 9], [4, 3, 9]]
Total time : 110 ms
image

3d coords insertion

Best found is : 63.27414215108453 in 42 ms
The way is : [[0, 0, 0], [1, 3, 0], [2, 6, 1], [2, 6, 2], [2, 9, 4], [2, 8, 6], [2, 6, 9], [4, 3, 9], [5, 4, 6], [3, 0, 4], [2, 0, 4], [3, 0, 8], [9, 2, 7], [9, 2, 4], [5, 5, 2], [6, 5, 3], [9, 5, 5], [8, 6, 5], [7, 8, 4], [7, 8, 8], [6, 9, 7]]

image

About

3d pathfinding algos, genetique, insertion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages