This project visualizes the stepping stone algorithm to determine the most cost-effective path for distributing products based on a quantity and cost tables. The algorithm optimizes the distribution process by iteratively evaluating possible paths and adjusting the quantities to minimize costs.
To run the project, ensure you have Python installed on your system. Additionally, you need to have Pygame installed.
-
Clone the repository:
git clone https://github.com/sm-alejandr0/stepping_stone_algorithm
-
Install Pygame:
pip install -r requirements.txt
- Run the
main.py
file to launch the application. - The interface will display two tables: one for quantities and one for costs.
(you can edit these values in
constants.py
) - Left-click on a cell in the quantities table to edit its value.
- Press a to start the algorithm. It will calculate every possible path and the associated costs. Then it will update the table using the cheapest path until the minimum costs are reached.
- Right-click on a cell in the quantities table to mark it as the starting point for calculation. The algorithm will find the possible paths from this cell.
- The cost will be displayed in the console. If the costs are negative, the current path is cheaper.
- Press u to update the table. The new cost will be displayed on the console.
The stepping stone algorithm works by iteratively evaluating possible paths through the quantity table while considering the associated costs. It identifies the most cost-effective path by exploring all potential routes and adjusting quantities to minimize costs.
Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests to help improve the project.
This project is licensed under the MIT License.
The stepping stone algorithm was invented by Abraham Charnes and William W. Cooper.