PHP Classes

PHP Breadth First Search: Find the shortest path to visit warehouse bins

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-09-01 (29 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 26 This week: 1All time: 10,673 This week: 206Up
Version License PHP version Categories
sylvane-task 1.0.0The PHP License5Algorithms, PHP 5, Geography
Description Author

This package can find the shortest path to visit warehouse bins.

It can generate a graph with a given number of nodes and a list of edges that can have bins in a warehouse.

The package can find the shortest path to traverse all bins from a starting point and return to the same point.

A Python component can render the warehouse bins' path as an image.

Picture of Malik Naik
  Performance   Level  
Name: Malik Naik <contact>
Classes: 9 packages by
Country: India India
Innovation award
Innovation award
Nominee: 5x

Details

Sylvane Task

This is a task to find the shortest path by visiting all the bins in the warehouse and coming back to the start position in an optimal way.

Approach

  1. We are considering the aisle as the nodes in the graph and when we are at a certain aisle we can pick the item from the bin on either side of the aisle.
  2. The Modified Breadth-First Search is used to find the shortest path from all pairs of nodes in the graph.
  3. Starting with the start position this approach greedily picks the nearst node from the start position and then takes the path and then from there picks the next nearsest node until all the bins are visited.
  4. Finally, it returns back to the start position.

The graph of the warehouse is as follows: WareHouse Visualization

In the above graph, the green nodes are the aisles and are paths that can be traversed and the white nodes are the bins from which we can pick the items.

Execution

To test the working of this code. Clone this repository and then run the following command:

php main.php

Make sure you have PHP CLI installed before running the above command.

Visualization

To execute the visualization using Python you need to install the NetworkX and Matplotlib libraries. They can be installed by running the following command:

python -m pip install -r requirements.txt

Then, run the following command to generate the visualization of the Warehouse.

python visualization.py

Screenshots  
  • Warehouse.png
  Files folder image Files  
File Role Description
Accessible without login Plain text file bins.py Data Auxiliary data
Plain text file Graph.php Class Class source
Accessible without login Plain text file main.php Example Example script
Accessible without login Plain text file params.php Aux. Auxiliary script
Plain text file PathFinder.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file requirements.txt Doc. Documentation
Plain text file Sylvane.php Class Class source
Accessible without login Plain text file visualization.py Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:26
This week:1
All time:10,673
This week:206Up
For more information send a message to info at phpclasses dot org.