This program finds the optimal path from (0,0) to (n-1,n-1) on an n × n chessboard, maximizing the total value collected. It allows movement in all four directions without revisiting positions.
- Sal Mourad
- Simar Padda
- To run the program open the terminal and run
python src/gui_main.py- The UI will appear and prompt the user to enter in their desired n value to create the board
Note: Since the time complexity grows exponentially with larger n, we reccommend you limit the size of n to 5 or less to view the programs functionality without having to wait too long.
- Enter your desired n value and click
Okayto run the program. The UI should now show the optimal maximum path taken from start to finish as well as the maximum value accumulated along the way.
- To run the program open the terminal and run
python src/main.py- This should prompt you to enter in a value for n. Enter your desired value and click enter. The board will be printed out, as well as the path taken to achieve the maximum sum, and the maximum value collected.
Note: Since the time complexity grows exponentially with larger n, we reccommend you limit the size of n to 5 or less to view the programs functionality without having to wait too long.
- Open the terminal and run either of the following commands
python tests/test_3X3.py
python tests/test_4x4.py
python tests/test_5x5.py
python tests/test_6x6.py
python tests/test_10x10.py- Since this is a test case, the n value has been pre-defined (no action required)
- The UI should now show the optimal maximum path taken from start to finish as well as the maximum value accumulated along the way.
Note: The terminal will also output the following information:
- The manually determined Best Path and Maximum Value Collected
- The autogenerated Best Path and Maximum Value Collected
This is used to compare if the autogenerated result matches with what is expected for confirmation.