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 green and the frontier is colored blue, 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 and use your mouse to change tile 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.
To be admissible, 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)
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 firstname.lastname@example.org or email@example.com to get the original source code.
Copyright © 2016 Mert Bora ALPER. All rights reserved.