Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 1.69 KB

README.md

File metadata and controls

18 lines (12 loc) · 1.69 KB

vlog7_shortestpath

It was the flow of water that inspires my to write this algorithm. Water naturally flows finding the shortest path, because it requires the least energy. Hence I decided to create a shortest path algorithm inspired by the flow of water.

As usual, the data is presented in a 2 dimensional matrix, however simulating waterflow inside pipe using 2D matrix will result in something like highly inefficient BFS. Therefore a more efficient data structure is needed, and it is 1 Dimensional matrix. This results in a very efficient algorithm to find distance from one point to another on weighted directional graph.

Please note that this algorithm is originally made by me. You may use only for studying purposes only including doing assignment, impressing your classmates, lecturer or even in competitive programming.

However I strongly discourage the use of this algorithm in production even though for all the tests I conducted with this algorithm produces the same result as Floyd-Warshall's algorithm. The correctness of this algorithm has not yet been proven.

The main source code is contained in project3.dpr

The source code was written in Pascal, it is a simple, powerful and high performance programming language with speed comparable to C++. However I used Delphi 10.1 Berlin to compile and run as Turbo Pascal no longer works in Windows 10 x64.
Therefore the source code was in .dpr extension, but it can also be read using notepad. Download Delphi Community edition for free here: https://www.embarcadero.com/products/delphi/product-editions It is fully functional and can be used for both studying or writing commercial application.

Video is available here: https://youtu.be/WfwI-jA4_dA