






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Before a grocery store opens key operational decisions must be made with no historical data. One important decision is how to optimally lay out the store to maximize consumer spending. This work reviews existing literature on simulation to optimize grocery store layout, uses computer vision techniques to transform a store diagram into a digital representation, and applies simulation methods to approximate which of the layouts proposed by a store designer would result in the highest amount of impulse purchasing. Output analysis methods are used to compare these results to determine whether one design outperforms the others.
This topic was chosen after connecting with a local food co-op planning to open in my community [14]. We discussed their current status, and what aspects in the store opening process might be assisted with a simulation study. The Store Development Committee had been working with a store designer on planning the layout of the store and suggested that it could be useful to have an analysis of which of the proposed floorplans is likely to be most profitable. At this stage, the floorplan is defined as the block layout and the assigned department label. It is assumed that the floorplan is designed by someone with knowledge of the planned inventory and available space. An example can be seen in Figure 1. Due to the request to keep planning materials confidential, this report demonstrates the same simulation and analysis methods applied to fictional, example layouts.
Conventional grocery stores typically have very low profit margins, averaging about 2.2% in the US [2]. Although there is less data available on the profit margins of food co-ops, the management team expects similarly slim profit margins. In order to maintain profitability, several decisions can be made to decrease costs or increase sales. I focus on increasing sales by choosing a store layout to increase customer impulse purchases. Impulse purchases are unplanned purchases, and are viewed as an opportunity to increase sales over what a customer was planning to spend on commodities through factors the store can control. Impulse purchases are said to account for 30-50% of sales, and 3 out of 4 shoppers report making some purchasing decisions in-store [8, 12]. Hoch and Loewenstein suggest that physical proximity is the strongest inducer of reference-point shifts, which are sudden desires that result in unplanned behavior [6]. Therefore, a longer path through the store is desirable as it provides more opportunities for stimulating additional impulse purchases. Since the store is not yet open and detailed product placement data does not exist, I will use average customer path length as a proxy for impulse shopping. This relationship is well-established in the literature.
There are many approaches to simulate the path a customer will take within a grocery store. Larson uses a proprietary PathTracker® system which affixes RFID tags to grocery carts to study common paths [9]. The paths identified are specific to the store layout where the data was collected, and cannot be applied to other layouts arbitrarily. Hui, Fader, and Bradlow note the similarity of grocery store shopping to the traveling salesman problem (TSP) and study the ways customer paths systematically differ from the optimal TSP path [7]. They found that customers deviate from the optimal path on average by 28% (ranging from 5 to 95%). The first type of deviation, order deviation, is when customers do not visit the next-closest item to where they currently are. This averaged 3% of the deviation. The second type of deviation, travel deviation, is when customers visit the next-closest item, but take a path other than the shortest path to get there. This averaged 69% of the variation. Order deviation is strongly correlated to basket size, while travel deviation is uncorrelated to basket size. For this reason, in this simulation for the purpose of estimating additional purchases only order deviation will be considered. Several papers use a one-step-ahead approach in which a customer selects the next item from their list with a probability inversely proportional to its distance from their current location [1, 3]. That approach will be adapted for this simulation. Additional approaches exist for optimizing grocery-store layout to stimulate impulse shopping. Bhadury, Batta, Dorismond, Peng, and Sadhale apply the p-dispersion model to spread common “must-have” items across the store, thereby maximizing the customer’s exposure to impulse items [1]. Significant improvement was achieved using this method, but the scope and problem definition differ from that of selection from a fixed set of store layouts at the department-level. Ozgormus and Smith propose a method for increasing revenue while considering adjacency preferences and validate it on two locations of the Turkish grocery chain Migros [10]. Again, large improvements were achieved (3-4% increase in revenue), but our problem definition varies from the one described here; in [10] the layout is fixed and only the contents of those fixed departments vary. Finally, Dorismond outlines a simulation-based tool to guide periodic changes in a supermarket layout and an approach to dynamically position promotional products in a retail store [3]. There are several interesting findings, but again the block layout is assumed to be fixed and the customer path and shelf allocation are explored. Although none of these solutions exactly apply to the problem of comparing several proposed layouts to determine which maximizes customer path length, several of the strategies used in those simulations can be applied.
The first task in simulating the customer flow and purchasing activity in a store is translating a document representing the store’s layout into a representation that can be used by the simulation. A simplified example of a floor layout plan is shown in Figure 1. There is a single column which contains a legend mapping colors to the name of the product type. The location where items of that type are stored is entirely shaded in the same color. There may be some additional features of the diagram, such as dimensions, bathrooms, and more, which are ignored.
meatdairy [234, 174, 75] [219, 159, 60] [249, 189, 90] [75, 174, 234] household [84, 253, 255] [69, 238, 240] [99, 268, 270] [255, 253, 84] frozen [35, 50, 234] [20, 35, 219] [50, 65, 249] [234, 50, 35]
BGR values are used primarily in the OpenCV package which is being used in this code. With this mapping sections of the store layout map can be assigned to different departments.
Preprocess Store Layout The first step for the store layout is also to save it as a separate image, containing only the floorplan that a customer could walk through. I resize each image to 500x500 pixels to standardize maximum path size and reduce the search space. Since items can only be placed on the perimeter of any aisles, it’s necessary to find the coordinates of the perimeter for all departments.
Figure 2: Original Image. Figure 3: Produce section pixel mask. Figure 4: Perimeter where products are placed
This sequence shows edge detection for the produce section. First, the color mask created from the high and low values for any department in the legend is applied to filter out pixels that are not part of the section, resulting in Figure 3. Then, a basic edge detection algorithm is applied to identify the perimeters, shown in Figure 4. The pixel indices are stored as options for item placement for each department. A buffer of 10 pixels is set to indicate that products cannot be placed on the perimeter of the store. For example, the leftmost produce section will not have products on its leftmost perimeter, because that is against a wall and inaccessible to the customer. Finally, a combined mask of all departments is created to denote where customers can and cannot walk for the path generation algorithm. This is shown below.
Figure 5: Walking path mask, purple denotes where customers can walk, yellow denotes obstacles
Figure 7: Diagram from [4] on one-step-ahead path generation
At this point, the customer has been created and the customer’s shopping list has been assigned. The decision for which zone to visit next is determined by calculating the Euclidean distance between the current location and all future points to visit. The Euclidean distance is chosen because it is quick computationally and gives an approximation for the customer’s travel distance. The probability vector P corresponding to the unvisited points C from current point c = [cx , cy ] is computed as follows: D = | C – c | D is the distance from the current point to each point P = (1/D)^5 The probability is inversely proportional to the distance P = P/ Σ pi Probability vector is normalized to sum to 1 This was selected based on the maximum distance of 707 for one step with the image resized to 500 by 500 pixels, and could be formulated differently depending on desired behavior. Based on those probabilities, the next point is selected and the current point is removed from the list of points to visit. Once the shopping list is empty, a random checkout line is selected and the customer moves there to leave the store. The results of ordering a coordinate set is shown for an example set of points below:
Figure 8: Customer visit locations denoted in purple, overlayed with assigned order
The last step of path generation is to actually generate the path between these ordered points. One approach is to use the Euclidean distance, and ignore the physical obstruction of the aisles. This is used in [1] and others. Another approach is to use a path generation algorithm. I’ll use the A* algorithm, a common successor to Dijkstra’s algorithm which uses heuristics to achieve high performance in less time [5]. However, it’s still far less efficient than the simple computation of the Euclidean distance, and using the A* algorithm comes with a noticeable slowdown. For my implementation I track both Euclidean distance and A* path distance, with
the option to disable A* computation for faster results. Figure 9 shows the same set of ordered coordinates to be visited, and the path the customer takes using A* as compared to the shortest Euclidean path.
Figure 9: Customer path with A* shown on the left, customer path using Euclidean distance on the right
With all of these components together, there is now a way to simulate customer path distance through a store layout. The legend is parsed from an image to identify the department names matching each color. A store map is parsed from an image to represent physical obstructions and the outlines of each department are stored for potential product placement. Customer shopping lists are generated using the Instacart Grocery Online Shopping Dataset of 2017, which is remapped to the departments existing in the store layout plan. Finally, a customer’s path is generated by randomly assigning locations within a department perimeter to each product, ordering the visitation of those locations using a one-step-ahead method, and measuring the distance between points with either the Euclidean distance or the length of the path generated by the A* algorithm.
Other layouts must be compared in order to obtain results on the original task of choosing from several proposed layouts. Figure 10 below shows the three layouts created to compare between. In all of them the legend remains the same. To evaluate each layout, 1,000 customers are created, and each individual’s path is tracked for the same grocery list through all of the layouts. The path distance is output. Output analysis techniques will be used to compare the layouts and determine whether one is substantially better than the others in terms of mean customer path.
than the other, although in this sample Layout 3 generated a higher average walking path. Finally, the confidence interval comparing Layout 2 to Layout 3 is entirely below 0, so it’s been shown with 95% confidence that Layout 3 generates a longer walking path than Layout 2.
Figure 12: Results of comparing layouts pairwise by A* walking path
This analysis is repeated using the Euclidean path measure and results are shown in Figure 13. In this analysis, Layout 1 is shown to be better than Layouts 2 and 3 with 95% confidence, and Layout 2 and 3 are indistinguishable. This result differs from that found with the A* path, which is more representative of a customer’s true walking path. This is an important finding because other papers evaluate their layout with the Euclidean distance, which is now shown to not always correspond to the walking path when accounting for obstacles.
Figure 13: Results of comparing layouts pairwise by Euclidean walking path
Another way to compare many layouts is to use a selection method adopting the indifference-zone approach. This means comparing the best system, or subset of systems within the same performance zone such that we are indifferent between those systems. This method is not used here, but implementation would be a useful future step.
In addition, a brief timing analysis was completed. The time to compute one customer’s path through each of the 3 layouts using both the Euclidean distance and the A* path distance averaged 37.8 seconds, with a standard deviation of 16.75 seconds. The paths of the 1, customers for each of the three layouts from this simulation took 10.6 hours to calculate. Improvements in processing speed could be achieved by using only the Euclidean distance. To create 1,000 customer paths and calculate distance using Euclidean distance only, it takes only 7 seconds, or on average .007 seconds per customer. The tradeoff is that Euclidean distance is a less accurate representation of the walking path. Another option is to constrain the graph search space by segmenting the image into overlaid nodes in an algorithmic way or in a crude way (like further downsampling the image). Finally, other path generation algorithms could be explored to increase efficiency. In this section I showed how to compare the outputs of the simulation across different layouts using paired confidence intervals. For the example layouts, Layout 1 and 3 are both shown to generate similarly long walking paths. Using more samples, a narrower confidence interval could be obtained potentially differentiating one from the other. The Euclidean distance was shown to have different results than the A* path distance, which indicates it is not always a good representation for walking distance. Finally, a timing analysis was completed showing the speed of computing the A* path is fairly slow for the 500x500 pixel images, and options for future exploration on improving efficiency were presented.
This project applied simulation and computer vision techniques to provide a data-driven method for evaluating early-stage store layout plans. I showed how to parse a store diagram into a computerized representation, generate simulated customers, compute their walking path and distance, and compare the results for two example layouts. This analysis was repeated on real proposed layouts from a local co-op, and results were provided to the Store Development Committee. There are many avenues for future work on this project. One area where this simulation could be improved is through tailoring the shopping list creation to the expected behavior of customers. Customer preferences are known to vary by age, region, and other factors, and the co- op planning committee expects behavior to vary from that shown in larger grocery chains. As more is known about prospective customers, this simulation can be changed to incorporate those changes and create more realistic scenarios. As the store moves forward in inventory planning, a more detailed store layout could be used, and other shelf allocation techniques applied. This information again increases accuracy, and also opens up the possibility of moving from walking path lengths into specific information about the products customers pass. Combined with data on impulse buying this could translate into an estimate of the monetary increase in sales. Finally, an important next step in any model that’s based primarily on approximations and assumptions is to collect real data and compare the true results to the projected results. In this case collecting data won’t be possible in the near term, or anytime for all but one of the layouts, but it provides potential for future analysis, such as that done in [3, 10]. In conclusion, in early phases of store planning simulation can provide the opportunity to make data-driven decisions even when data is scarce. In this project, I showed how to simulate customer walking paths to compare which proposed store layout is likely to generate the highest amount of impulse buying.