This application finds the optimum (i.e. the cheapest) path from green tile to the red tile, where vertices are respresented as tiles, using A* pathfinding algorithm with various user-selectable heuristics.
Explored tiles are colored in green and the frontier is colored in purple, both transparently.
The cost of moving from one tile to another (i.e. the weight of the edge) is found by calculating the arithmetic mean of the weights of the two tile; if movement is diagonal, the average is multiplied with . The blocked tiles (colored with black) are impossible to pass through. Choose a tile type from the menu on the right and move your mouse across the grid to change tiles' type.
Click on Start button to initialize the engine; you cannot alter the tiles afterwards until you Stop the engine. You can click on Finish button to see the result immediately, or move a few steps forward to observe the execution of the algorithm.
For admissibility, all of the heuristics assumes that all tiles have the default type.
Chebyshev, also known as diagonal, distance is a metric defined on a vector space where the distance between two
vectors is the greatest of their differences along any coordinate dimension.
https://en.wikipedia.org/wiki/Chebyshev_distance (accessed on 21-Jul-2016)
Euclidean distance, also known as "Pythagorean metric", is a metric where the distance between two vectors is the square root of the sum of square of the difference of their Cartesian coordinates.
Manhattan distance is a metric where the distance between two vectors is the
sum of the absolute differences of
their Cartesian coordinates.
https://en.wikipedia.org/wiki/Taxicab_geometry (accessed on 21-Jul-2016)
NOT ADMISSIBLE, since diagonal movements are allowed on our grid!
Octile distance is a metric used to calculate the distance where diagonal movement is also possible, with the cost of moving diagonally is times of moving between adjacent tiles. It is the sum of the cost of the shortest diagonal path starting from start tile until reaching the same column or row with the goal tile, and the cost of the remaining straight path.
This application is created as a support material for the Internal Assessment of Mert Bora ALPER in mathematics as a part of International Baccalaureate Diploma Programme.
Source code of this application is deliberately obfuscated to prevent any copyright claims. If you are from IBO,
please contact me at [email protected] or [email protected] to get the original source
code. See GitHub.
Copyright © 2016-2019 Mert Bora ALPER.
All rights reserved.
Licensed under ISC.