# Improving the Efficiency of Modern Warehouses Using Smart Battery Placement
## 3 The Proposed System
### Calculating Sub-Areas  
The first stage of the proposed methodology for efficient battery placement is to identify the areas of high and low activity (traffic). In modern warehousing operations, efficiency is often determined by how well we can pinpoint and serve areas of high activity and frequent UGV navigation. With this understanding, it is important to discern these hotspots within the warehouse environment. By assimilating real-time operational data, such as navigation paths, the goal is to accurately identify the most frequented cells within the warehouse matrix. Utilizing the AP clustering algorithm allows us to delineate distinct sub-areas within the larger warehouse matrix. These sub-areas, which are demarcated based on UGV traffic intensity, become the cornerstone of our battery allocation strategy. The AP algorithm, as illustrated in Algorithm 1, was designed to assign sub-areas within a warehouse environment. The input is a warehouse grid, denoted as W, of size X by Y. Each cell within this grid quantifies the traffic (frequency of UGV traversal). The algorithm initiates by transforming the warehouse environment into a collection of data points where each cell becomes a data point situated in a two-dimensional plane, carrying its traversal count as a value. Pairs of these data points undergo similarity calculations grounded in the negative squared Manhattan distance between their UGV traversal counts, subsequently storing these similarities in matrix S. As the process unfolds, two matrices named R (responsibility) and A (availability) are introduced and set to zero. For precise computations, the diagonal of matrix S is set to its median value, which is a strategy used to determine the preference value. The algorithm then enters an iterative phase aimed at convergence, wherein it updates the R and A matrices. Upon stabilization, exemplars, or representative points, are identified where the sum of matrices A and R is at its peak. The final steps see the non-exemplar points being matched with their closest exemplar based on the highest similarity, ensuring spatial connectedness. The culmination of this procedure yields clusters of proximate cells, highlighting regions within the warehouse with analogous traversal patterns. Figure 2 shows the outcome of the algorithm in a 20-by-20 environment. ```
1. Input: Warehouse environment W with dimensions X by Y, where each cell rep
2. resents UGV traversal count. 3. Output: Clusters of neighboring cells with similar traversal counts. 4. Step 1: Convert the warehouse environment W into a set of data points. 5. Represent each cell as a data point in a two-dimensional coordinate system
6. with its value being the traversal count. 7. Step 2: Calculate the similarity between every pair of data points
8. Compute similarity based on the negative squared Manhattan distance between UGV
9. traversal counts. 10. Store the similarity in a matrix S.
11. Step 3: Initialize messages between data points. 12. Initialize two matrices, namely, R (responsibility) and A (availability), to zero. 13. Set diagonal of similarity matrix S to the median of all values in S (preference value). 14. Step 4: Iterate until convergence (or maximum number of iterations). 15. Update the responsibility matrix R using R(i, k) \(<-\)S(i, k) \(-\) max\(\{\) A(i, k\({}^{\prime}\)) + S(i, k\({}^{\prime}\)): for all k\({}^{\prime}\
eq\) k\(\}\). 17. Update the availability matrix A using A(i, k) \(<\) min\(\{\)0, R(k, k) + sum\(\{\) min\((\)0,
18. R(i\({}^{\prime}\), k)\(\}\): for all i\({}^{\prime}\) not in \(\{\)i, k\({}^{\prime}\)\(\}\) }. 19. Step 5: Identify exemplars. 20. Identify data points where the sum of A and R is maximized for each point as
21. exemplars. 22. Step 6: Assign cells to clusters
23. Assign each non-exemplar data point to the exemplar with which it shares
24. the highest similarity (considering neighboring cells using the 4-neighbor
25. scheme). 26. Group the data points assigned to each exemplar into a cluster. 27. Step 7: Return the clusters of neighboring cells.