Command Line Program implementation of different Search algorithms in C.
Namely A*, Depth First Search and lastly Breadth First Search.
Recreating the List Data Structure to utilize for the algorithms.
git clone "https://github.com/CSjianbel/CLI-Pathfind-Algorithms.git"
make pathfind
./pathfind [Pathing] [Algorithm] [Board]
./pathfind [-a, -d] [-a, -d, -b] [structure.txt]
./pathfind -a -d src/Tests/test1.txt
./pathfind -d src/Tests/test2.txt
./pathfind src/Tests/test3.txt
-
Pathing
- -a Sets Pathing to Across Only
- -d Sets Pathing to Across & Diagonal
-
Algorithm
- -a Sets A* Search as the algorithm to be used
- -d Sets Depth First Search as the algorithm to be used
- -b Sets Breadth First search as the algorithm to be used
-
Board
- structure.txt must be a path to a board
-
Defaults
- The program is set to across and diagonal if the 2nd & 3rd command line argument is ommitted.
- The program is set to A* search if the 3rd command line argument is ommitted.
-
Note
- The Board is the only command line argument that is required when running the program.
- To be able to specify the algorithm then all 4 command line arguments must be provided.
Inside the src/Tests/ directory there exists test boards that may be utilized for testing.
Inside the src/Tests/Invalid directory there exists test boards that are deemed to be invalid by the program.
Here are a few guidelines in Creating a Board of your own...
Create a .txt file and fill it with the following characters:
- ['S', 's'] : Start Node
- ['E', 'e'] : End Node
- '#' : Wall
- '_' : Open Path
- The Start Node and End Node Characters must only appear once in the board to be a valid board.
- The Width of each row of the board must be symmetrical to be a valid board.
- If there are characters present in the board that are not mentioned above then it will be an invalid board.
- The Max Width of the Board is set to be 50, anything above that is considered invalid. This can be changed in src/pathfind.h.
S####
____#
###_E
S###X
_ASD
##E##
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
A Project by Jiankarlo A. Belarmino