Customer mobility and congestion in supermarkets
Fabian Ying, Alisdair O. G. Wallis, Mariano Beguerisse-D\'iaz, Mason, A. Porter, Sam D. Howison

TL;DR
This paper models customer movement within supermarkets using mobility models, demonstrating how store layouts can be optimized to reduce congestion based on empirical data and simulation techniques.
Contribution
It applies population-level mobility models to small-scale supermarket environments and introduces an optimization method for store layout to minimize congestion.
Findings
Gravity and intervening-opportunities models estimate 65-70% of customer flow.
Optimized layouts reduce congestion, often placing popular zones at the store perimeter.
Customer movement insights can inform store design to improve shopping experience.
Abstract
The analysis and characterization of human mobility using population-level mobility models is important for numerous applications, ranging from the estimation of commuter flows in cities to modeling trade flows between countries. However, almost all of these applications have focused on large spatial scales, which typically range between intra-city scales to inter-country scales. In this paper, we investigate population-level human mobility models on a much smaller spatial scale by using them to estimate customer mobility flow between supermarket zones. We use anonymized, ordered customer-basket data to infer empirical mobility flow in supermarkets, and we apply variants of the gravity and intervening-opportunities models to fit this mobility flow and estimate the flow on unseen data. We find that a doubly-constrained gravity model and an extended radiation model (which is a type of…
| Variable | Description |
|---|---|
| Store network | |
| Distance matrix (with entries ) associated with | |
| Length of edge in the graph | |
| Shortest-path length between and in the graph | |
| Mean zone length (excluding entrance and tills) | |
| Number of nodes in the graph | |
| Number of edges in the graph | |
| Time period | |
| Fraction of baskets in the data set | |
| (i.e., the number of baskets in the data set in | |
| a time period divided by the total number | |
| of baskets during the same time period) | |
| Number of origin–destination (OD) trips | |
| from zone to zone | |
| OD matrix with entries | |
| Number of OD trips that start at zone | |
| (it equals the sum of the entries in the row of ) | |
| Number of OD trips that terminate at | |
| (it equals the sum of the entries | |
| in the column of ) | |
| Attraction factor of zone to zone | |
| Number of intervening opportunities | |
| of origin–destination pair | |
| (it equals ) | |
| Number of trips (it equals ) | |
| Number of shopping journeys | |
| (it equals ) | |
| , | Service rate of zone |
| (we use when it is independent of ) | |
| Estimated number of visits to zone | |
| Rate of customer arrival at zone | |
| Total mean queue size | |
| Maximum arrival rate |
| Min | Mean | Max | |
|---|---|---|---|
| Number of zones () | 61 | 123 | 197 |
| Number of edges () | 128 | 236 | 401 |
| Number of baskets | 2479 | 13672 | 29201 |
| Mean zone length, excluding entrance and tills () | 6.42 | 6.91 | 7.65 |
| Model | Mean CPC | Mean |
|---|---|---|
| Gravity | 0.686 | 0.045 |
| Ext. radiation | 0.672 | 0.054 |
| IO | 0.655 | 0.047 |
| Radiation | 0.513 | 0.116 |
| Model | Mean | Median | Minimum |
|---|---|---|---|
| Gravity | 0.975 | 0.975 | 0.959 |
| IO | 0.978 | 0.977 | 0.963 |
| Ext. rad. | 0.975 | 0.973 | 0.960 |
| Model | Mean | Median | Minimum |
|---|---|---|---|
| Gravity | 0.996 | 0.998 | 0.976 |
| IO | 0.994 | 0.996 | 0.926 |
| Ext. rad. | 0.999 | 1.000 | 0.980 |
| Objective function | Original | Minimum value | Mean value |
|---|---|---|---|
| 6575 | 5009 () | 5042 () | |
| (with ) | 38.10 | 29.10 () | 29.28 () |
| (with ) | 12.78 | 11.86 () | 11.93 () |
| Model | Mean CPC | Mean |
|---|---|---|
| Gravity (exponential) | 0.677 | 0.049 |
| Gravity (power law) | 0.686 | 0.045 |
| Without the aisle constraint | With the aisle constraint | ||||
|---|---|---|---|---|---|
| Objective function | Original | Minimum value | Mean value | Minimum value | Mean value |
| 6575 | 5040 () | 5150 () | 5009 () | 5042 () | |
| (with ) | 38.10 | 27.21 () | 28.02 () | 29.10 () | 29.28 () |
| (with ) | 12.78 | 11.06 () | 11.23 () | 11.86 () | 11.93 () |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Customer mobility and congestion in supermarkets
Fabian Ying
Mathematical Institute, University of Oxford, Oxford OX2 6GG, UK
Alisdair O. G. Wallis
Tesco PLC, Tesco House, Shire Park, Kestrel Way, Welwyn Garden City, AL7 1GA, UK
Mariano Beguerisse-Díaz
Mathematical Institute, University of Oxford, Oxford OX2 6GG, UK
Mason A. Porter
Department of Mathematics, University of California, Los Angeles, California 90095, USA
Sam D. Howison
Mathematical Institute, University of Oxford, Oxford OX2 6GG, UK
Abstract
The analysis and characterization of human mobility using population-level mobility models is important for numerous applications, ranging from the estimation of commuter flows in cities to modeling trade flows between countries. However, almost all of these applications have focused on large spatial scales, which typically range between intra-city scales to inter-country scales. In this paper, we investigate population-level human mobility models on a much smaller spatial scale by using them to estimate customer mobility flow between supermarket zones. We use anonymized, ordered customer-basket data to infer empirical mobility flow in supermarkets, and we apply variants of the gravity and intervening-opportunities models to fit this mobility flow and estimate the flow on unseen data. We find that a doubly-constrained gravity model and an extended radiation model (which is a type of intervening-opportunities model) can successfully estimate 65–70% of the flow inside supermarkets. Using a gravity model as a case study, we then investigate how to reduce congestion in supermarkets using mobility models. We model each supermarket zone as a queue, and we use a gravity model to identify store layouts with low congestion, which we measure either by the maximum number of visits to a zone or by the total mean queue size. We then use a simulated-annealing algorithm to find store layouts with lower congestion than a supermarket’s original layout. In these optimized store layouts, we find that popular zones are often in the perimeter of a store. Our research gives insight both into how customers move in supermarkets and into how retailers can arrange stores to reduce congestion. It also provides a case study of human mobility on small spatial scales.
I Introduction
Understanding human mobility is important for city planners, policy makers, transportation researchers, and many others. Motivated by practical applications and the desire to explore fundamental phenomena in human sciences, many researchers have developed and analyzed population-level models, such as gravity Zipf (1946) and intervening-opportunities (IO) models Stouffer (1940); Schneider (1959), to study human mobility Barbosa et al. (2018).
Population-level mobility models characterize the flow of people or other entities between locations using local attributes, such as their populations or the distance between the locations. They have been used for many applications, including modeling commuter flow between locations Simini et al. (2012), trade flow between countries Bergstrand (1985), and traffic flow inside a city Piovani et al. (2018). These applications are diverse, but they are all on large spatial scales, ranging from an inter-country scale of thousands of kilometers (e.g., estimating trade flow Anderson (1979); Bergstrand (1985)) to city and regional scales of tens of kilometers (e.g., estimating commuting patterns Masucci et al. (2013)). For even smaller spatial scales (e.g., building level), the prevalent approach in most studies is to use pedestrian models, such as mobility models for individuals (e.g., random walks Gutiérrez-Roig et al. (2016)) or models of crowd dynamics Helbing and Molnar (1995).
We consider the problem of modeling mobility flow between zones inside supermarkets and investigate how the flow changes when we rearrange store layouts. We therefore examine aggregate flow, which (despite the small spatial scales of these systems) makes population-level mobility models more suitable than random walks 111However, as we show in Section IV, we can interpret population-level mobility models as flows that arise from random walks. or crowd-dynamic models. The small, building-level spatial scale may affect the fundamental features of mobility dynamics (and therefore the performance of the models) in important ways. For example, it has been reported that some models (such as radiation models) perform worse on small spatial scales than on large ones Masucci et al. (2013). A possible reason for this observation is that the spatial ‘force’ is much smaller on small scales than on large ones due to the smaller cost of making a trip in the former situation, so other non-spatial ‘forces’ that are not captured by these models may instead be the primary factors that underlie the flow. In a supermarket, for example, the distance between two zones (the spatial ‘force’) may be less relevant than the number of their complementary items (a non-spatial ‘force’) for the flow between the two zones. Furthermore, these models are inherently memoryless, as they describe mobility flow from an origin location to a destination location using local attributes of the origin and destination locations, without considering the location from which (or how) a person who leaves the origin location entered it in the first place. When one models humans walking inside a building (e.g., in a supermarket or a museum), the direction from which a person comes likely influences where that person goes next, so there is memory in the system. For example, Farley and Ring Farley and Ring (1966) observed that customers in supermarkets tend to move from the entrance unidirectionally along the outer perimeter after entering a store.
In the present paper, we conduct a detailed case study of mobility models in an investigation of congestion in supermarkets, a practical problem that is influenced by the layout of a store. Reducing congestion is important not only for improving the shopping experience of customers, but also for reducing the fulfillment time and cost of online orders. (In many supermarkets, staff members go around a store alongside customers and pick up items that were ordered online.) Congestion may delay such orders and thereby incur additional costs to a business and inconvenience customers in a store. In our study, we integrate mobility models with a congestion model — in which each supermarket zone is a queue and in which we make the simplifying assumption that customers traverse shortest paths between purchases — to estimate congestion in supermarkets. We then use a simple optimization algorithm to find store layouts with low congestion.
Our article has three main contributions. First, we show that several different mobility models can successfully estimate the majority of observed trips in supermarket customer-flow data, demonstrating that these models can work on small (specifically, building-level) spatial scales. Second, we show how to combine these models with a congestion model based on queuing networks to estimate congestion in customer flow. Third, we demonstrate how to optimize store layouts to reduce congestion.
Our article proceeds as follows. In Section II, we describe our mathematical setup. In Section III, we describe the data set from which we infer the origin–destination (OD) trips in supermarkets. In Section IV, we describe the mobility models and goodness-of-fit measures that we use in our investigation. We also describe how we estimate the parameters of our models. In Section V, we present our results when applying these models to supermarket store data, using both (in-sample) fitting and (out-of-sample) estimation of customer flows. In Section VI, we describe an application of a human mobility model to estimate customer congestion and determine store layouts that reduce it. Specifically, we discuss our congestion model, our optimization method, and the results of the optimization. We conclude and discuss future research directions in Section VII, and we give some additional details about our work in appendices.
II Mathematical setup
In this section, we set up our approach for analyzing mobility flow in supermarkets. We discuss how we discretize space in a supermarket, how we model shopping journeys, and how we characterize flow between zones of a supermarket. We will discuss our data in Section III and mobility models in Section IV.
In our investigation, we employ mobility models that require us to discretize space (i.e., a supermarket), which we divide into a discrete number of disjoint locations, with an associated measure of distance between distinct locations. To do this, we manually divide each store into rectangular zones of approximately equal size. (See Appendix A for details.) We then represent a store as a network with nodes (representing the zones) and edges, which connect neighboring zones (see Figure 1). We distinguish an entrance zone (labeled ) and a till zone (labeled ). A store network , which is embedded in space, is undirected. Although there are distances between supermarket zones, the network itself is unweighted. For the location of each node, we use the centroid of its corresponding zone. For each edge , we assign an edge length , which we take to be the Euclidean distance between its two incident nodes and . (The edge length approximates the walking distance between two nodes 222A definition of edge length that is closer to the walking distance between two nodes is the length of a shortest path that does not cross any shelves between the centroids of zones and . We call this distance the “shelf-respecting shortest-path distance”. However, the difference between the Euclidean distance and shelf-respecting shortest-path distance is small (in most cases, the straight line between the centroids of two zones only clips a corner of a shelf), so we use the former because it is considerably faster to compute..) We define an distance matrix that is associated with . The entry of is equal to the shortest-path distance between and ; this distance is the minimum length of a path between and . We define the zone length of each zone as the length of the longer side of the rectangle that encloses the zone.
One customer’s shopping journey is a sequence of zones (), where is the number of items that the customer buys, (entrance), (tills), and are the zones at which a customer picks up items, which we order by their pick-up times. A customer can purchase multiple items in the same zone, so may not be distinct. Each consecutive pair of distinct zones (so ) for constitutes an origin–destination (OD) trip (or simply a trip). That is, a trip is a segment of a customer’s shopping journey that is either between consecutive purchases in different zones, from the entrance to the first purchase, or from the last purchase to the tills. We are interested in the number of OD trips in a store from each origin zone to each destination zone (over some duration ). We do not consider flow within a zone and thus set for . The matrix , with entries , is called an origin–destination (OD) matrix Barbosa et al. (2018); its off-diagonal entries record mobility flow between zones. We denote an empirical OD matrix by and an OD matrix from a model by . Throughout our paper, we denote an origin node of a trip by and a destination node of a trip by ; we index other nodes using the symbol . We summarize our main notation in Table 1.
III Data
We use anonymized, ordered customer-basket data from large stores of a major United Kingdom supermarket chain (Tesco) over a common three-month period ( days). The data consists of a fraction of all customer baskets in these stores. We summarize the properties of the data in Table 2.
For each store, we infer the number of OD trips from zone to zone over the days from the data as follows. Each ordered customer basket is a list of item purchases, which we order by pick-up time. We use item-location data to map each ordered list of purchases to their associated zones in a supermarket. For example, we map a list of purchases (e.g., bread, milk, butter, and pasta) to its corresponding shopping journey (1, 10, 16, 28, 26, 53), where bread is in zone 10, milk is in zone 16, butter is in zone 28, pasta is in zone 26, and the tills are in zone 53 (see Figure 1(c)). In this example, each item has a unique item location, so we can recover the corresponding shopping journey in a straightforward way. However, about 10% of the purchased items have unknown item locations and about 8% of the purchased items have multiple item locations. We refer to the latter items as multi-located items, and we remove items with unknown item locations from customer baskets. For each basket with one or more multi-located items, we consider all combinations of possible purchase locations for those items. (For example, there are combinations for a basket with multi-located items with locations each.) For each combination, we calculate the sum of the shortest-path distances between the locations of consecutive purchases in the basket. We then choose a combination of the purchase locations that minimizes this sum. We do not possess data to validate that customers tend to buy multi-located items at locations that minimize the sum of shortest-path distance between consecutive purchases, but this assumption likely has only small impact on the results of our analysis (see Section V for these results), as only about 8% of the items are multi-located.
We decompose each customer shopping journey into its sequence of OD trips and estimate the total number of trips from zone to zone by counting all OD trips from the data. (For example, the previous example shopping journey (1, 10, 16, 28, 26, 53) consists of 5 trips: (1, 10), (10, 16), (16, 28), (28, 26), and (26, 53).) Assuming that the observed mobility patterns in our data set are representative of the mobility of all customers, we rescale by multiplying it by (where is the number of baskets in the data set in a time period divided by the total number of baskets during the same time period) to estimate the mobility flow of all customers who visit a store.
IV Mobility models
We examine several mobility models, which we use to estimate . Let and , respectively, be the empirical numbers of trips that depart from and arrive at each node . (Note that and are also the row and column sums, respectively, of .) We consider a class of models that yield an OD matrix from , , the store network, and either one or zero fitting parameters. The goal of the models is for to be “close” to an empirical OD matrix . (We discuss diagnostics for comparing and in Section IV.5.) The models use pieces of information of to estimate the off-diagonal entries of .
In our problem, for all nodes except for (entrance) and (tills), as every customer who finishes a trip in zone (except for and ) continues their journey with a trip that starts from . Note that , because each shopping journey starts at node , so the first trip (which starts at ) of each shopping journey does not have a preceding trip that ends at . Similarly, , because each shopping journey ends at node , so the last trip (which ends at ) does not have a subsequent trip that starts at . The quantity also corresponds to the number of shopping visits at (except for and ). It is thus equal to the total number of times that customers visit to purchase one or more items. The number of journeys in the data satisfies both and , as every journey starts at node and ends at node . Note that and need not be equal to [math], as the entrance and till nodes can contain items. Therefore, one is able to determine and from and . In practice, we estimate these values from sales data (see Appendix D). Therefore, we assume that we know and .
We use doubly-constrained (also called production–attraction-constrained) versions Wilson (1971) of mobility models. In these models, the mobility flow satisfies
[TABLE]
where and . In other words, has the same row sums and column sums as . This, in turn, implies for each node that both the number of trips that arrive at and the number of trips that depart from are equal to their empirical values. Therefore, for notational simplicity, we drop the superscripts on and for the remainder of our paper. Because for , the number of people at each node (except for the entrance and till nodes) is also conserved in the models.
For each origin node , there is a vector of ‘attraction values’ for each possible destination . We calculate these values from a model-specific function that takes , , and information (such as the distance between two nodes) from a store network as inputs. The function is the same for each origin node . (Allowing this function to be heterogeneous for different nodes would allow us to incorporate different types of supermarket zones into our models.) The mobility flow in a doubly-constrained model is
[TABLE]
where are “balancing factors” to ensure that Equations 1 and 2 are satisfied. Given , and , we determine and using an iterative proportional-fitting procedure Deming and Stephan (1940). See Appendix B for more details.
We can interpret as the mean aggregate flow that arises from a continuous-time random-walk model at stationarity. In our models, customers arrive at node (i.e., the entrance) at a rate of . In contrast to a standard random walk on a network Masuda et al. (2017), customers do not choose a random neighbor at each step. Instead, each customer at node chooses a random destination , which need not be adjacent to , with probability , and it then takes a trip from to the chosen destination . That is, the customer traverses some path from to the chosen destination . For simplicity, we assume that customers take a shortest path from node to node , where we choose this path uniformly at random from all shortest paths between these two nodes. (Other routing models are possible; one possibility is a standard random walk that starts at node and reaches an absorbing state at node .) We remove customers who finish a trip at node at rate ; this ensures that the mean number of customers in the system is constant. The quantity thus gives the mean number of trips from zone to zone over a period . Our model assumes that there is no memory in customer mobility; the next destination of each customer depends only on its present location.
We present each model in a scale-invariant form, such that the parameters are dimensionless and the attraction values are invariant under the scalings and for and for all . Because and scale with the number of journeys in the data set (and therefore with ), scale invariance ensures that the model parameters and the transition probabilities are independent of and 333For sufficiently large , it would be interesting to generalize our analysis to incorporate seasonal shopping variations, such as differences in behavior during holidays..
In Table 3, we summarize the different choices of and the number of parameters for each of the four models that we employ. We discuss these models in the following subsections.
IV.1 Gravity models
Gravity models of mobility Carey (1867); Zipf (1946); Wilson (1970); Erlander and Stewart (1990), which are named after Newton’s law of gravity, have been used to model a variety of systems, including human migration Erlander and Stewart (1990); Jung et al. (2008); Lee et al. (2014), cargo-ship movement Kaluza et al. (2010), inter-city telecommunication flow Krings et al. (2009), spatial accessibility of health services Luo and Wang (2003), and trade flow Anderson (1979); Bergstrand (1985). In a gravity model, the mobility flow between two locations depends only on the distance between the locations and on the ‘mass’ (i.e., ‘population’) of the two locations. In our models, each node (i.e., zone) has two types of populations: there is an origin population (the number of trips that depart from zone ) and a destination population (the number of trips that arrive at zone ). We use the origin population when we calculate the mobility flow from (i.e., the outflow from ) and the destination population when we calculate the mobility flow to (i.e., the inflow to ). Because for in our problem, the two values for population are the same, except for the entrance () and till () nodes.
We use a doubly-constrained gravity model, with
[TABLE]
where is a spatial normalization factor (which we choose to be the mean zone length, excluding the entrance and till zones) and is a dimensionless fitting parameter. We exclude the entrance and till zones in calculating mean zone length, because they are typically much larger than the other zones in a store. See Appendix A for more details.
The expression is an example of a ‘deterrence function’, for which an exponential function is also a common choice Barbosa et al. (2018). In contrast to other studies on small spatial scales Lenormand et al. (2016); Liang et al. (2013); Simini et al. (2012), we find that a power-law deterrence function gives a (slightly) better fit to our data than an exponential deterrence function (see Appendix C).
IV.2 Intervening-opportunities models
In intervening-opportunities (IO) models, which were first proposed by Stouffer in 1940 Stouffer (1940), each location (i.e., node) has opportunities, which (depending on their number and/or quality) give the location some amount of ‘popularity’. The key concept of IO models is the notion of intervening opportunities. The intervening opportunities of an OD pair consist of all opportunities in nodes that satisfy . (Note that in general.) In IO models, the mobility flow between two locations (i.e., zones in our application) depends on the number of intervening opportunities (rather than on the distance) between the two locations and on the ‘populations’ of the two locations. A larger number of intervening opportunities of an OD pair entails a smaller mobility flow from zone to zone , because customers are more likely to find what they are looking for (or to be diverted) before they reach . Intervening-opportunities models and their variants have been used in many applications, including to model intra-city mobility Ruiter (1967), interstate migration Anderson (1955); Akwawua and Pooler (2000, 2001), rioting behavior Davies et al. (2013), and the creation of social ties in a city Sim et al. (2015).
We measure the number of opportunities at each node by , the number of trips that arrive at . The number of intervening opportunities of an OD pair is then
[TABLE]
Therefore, the ‘opportunities’ in our problem amount to opportunities for customers to stop and purchase something. Note that when we scale for all , so the number of opportunities scales linearly with .
In Stouffer’s original IO formulation (StIO), the number of people who move a given distance is proportional to the number of opportunities at that distance and is inversely proportional to the number of intervening opportunities. The attraction values are
[TABLE]
for some (to avoid dividing by [math]) and where is the total number of trips. In Equation 6, we use instead of to ensure scale invariance. Additionally, is only approximately inversely proportional to (because of the term).
In our investigation, we use Schneider’s reformulation of the IO model Schneider (1959), because it is more popular than Stouffer’s IO formulation Barbosa et al. (2018) and is underpinned by a mechanistic model. In this reformulation, the attraction values are
[TABLE]
where is a dimensionless fitting parameter. The quantity equals the number of customers at node who take a trip to node divided by the number of customers who leave under the following mechanistic model. Each customer at considers opportunities in nondecreasing order of distance from , and they accept each opportunity with probability . They take a trip to the node that has the first opportunity that they accept. One can show that the number of customers who take a trip from to divided by the total number who leave is equal to the right-hand side of Equation 7 (see Appendix E). We use a doubly-constrained version of the IO model, so gives only the attraction value of zone to a customer in zone . In a doubly-constrained model, the quantity equals the actual number of customers who make a trip from to divided by the total number of trips that originate at .
IV.3 Radiation model
The original radiation model Simini et al. (2012), which was proposed as an alternative to gravity models, is a parameter-free variant of the IO model with attraction values
[TABLE]
The radiation model and its variants have been used for studies of commuter flows Simini et al. (2012, 2013), human migration Lee et al. (2014), mobile-phone calls Simini et al. (2012), and other applications. An advantage of this version of the radiation model is that it has no parameters. However, it does not appear to do a good job of capturing human mobility on small spatial scales Lenormand et al. (2012); Masucci et al. (2013); Liang et al. (2013).
IV.4 Extended radiation model
Yang et al. Yang et al. (2014) proposed an extension of the radiation model that includes an exponent . In this model, the attraction values are
[TABLE]
Yang et al. claimed that this extended radiation model fits empirical OD matrices better than the original radiation model for intra-city commuting flow and observed that their calibrated values of decreased as they considered systems with smaller spatial scales. When , one recovers a variation of the original radiation model from Equation 8 (specifically, with each occurrence of replaced by ).
IV.5 Goodness-of-fit measures
IV.5.1 Common part of commuters (CPC)
The common part of commuters (CPC) score is the proportion of trips that the OD matrices and have in common:
[TABLE]
It was introduced in Gargiulo et al. (2012); Lenormand et al. (2012) and has been used in studies of human mobility Yang et al. (2014); Lenormand et al. (2016); McNeill et al. (2017). The CPC score is based on the Sørensen index Sørensen (1948), and it varies from [math] (when there is no agreement between the model and data) to (when and are identical). Because our models are doubly-constrained, . Therefore, we interpret the CPC score as the fraction of customers whose trip is assigned correctly by a model.
There are various other goodness-of-fit measures, such as normalized root-mean-squared error in , information gain, common part of edges, cosine distance, and Pearson product-moment correlation. However, in past studies, these measures often gave similar results as CPC when comparing the performance of mobility models Lenormand et al. (2016); McNeill et al. (2017), so we primarily use CPC, which has an intuitive interpretation in our modeling context.
IV.5.2 Error in estimated number of zone visits
In addition to CPC, we also consider an application-specific goodness-of-fit measure , which measures the normalized root-mean-square error (NRMSE) in the number of visits to each node. When we examine congestion in supermarkets in Section VI, we use measures of congestion that depend on the number of visits to each node, so a mobility model should have low values of for it to be viable for our application to congestion. Given an OD matrix , we estimate the number of visits by assuming that each customer, for an OD trip , takes a shortest path, which we choose uniformly at random among all shortest paths from to . Each customer who takes a trip from to visits each node along the chosen shortest path. The estimated number of visits to each node is the weighted sum of the number of trips with OD pairs for all and , where the weight is the fraction of shortest paths from to that traverse . (We use the convention that the starting and terminal nodes, and , are traversed as part of a shortest path from to .) That is,
[TABLE]
The number of visits is closely related to geodesic node betweenness centrality Newman (2018), which we recover when for all . We can compute all values in time using a straightforward adaptation of a fast algorithm for computing geodesic betweenness centrality Brandes (2001).
To measure the model error in the estimated number of visits, we calculate the NRMSE in with the formula
[TABLE]
where is the number of visits to the most-visited node.
Our shortest-path assumption is a modelling choice and seems likely to be somewhat unrealistic for describing the precise trajectories between purchases. For example, in one study Hui et al. (2009a), it was reported that customer trajectories between purchases are, on average, about four times as long as a shortest path. However, to the best of our knowledge, there does not exist a model that accurately describes how customers move between purchases. We use the shortest-path assumption as a null model, and we note that it is possible to replace this assumption with a more intricate model that estimates the number of visits to each node. Additionally, we use the shortest-path assumption only to estimate the number of visits to each node; we do not use this assumption when we estimate OD matrices.
IV.6 Parameter calibration
Following the approach in Lenormand et al. (2012), we calibrate the model parameters , , and of the gravity, IO, and extended radiation models (respectively) for each data set by maximizing the CPC score. We call a parameter value ‘optimal’ when it maximizes the CPC score for a given model and data set.
V Results
V.1 Fit to data
We test the four models in Section IV on each of the stores. In our computations, the gravity model consistently achieves the best CPC score across the stores, with a mean of about (see Figure 2(a) and Table 4). This value is comparable with reported CPC scores in previous studies on mobility systems with larger spatial scales Lenormand et al. (2016); McNeill et al. (2017); Yang et al. (2014). The performance of the extended radiation model, with a mean CPC score of , is almost as successful on average. The IO model consistently yields lower CPC scores than the gravity and extended radiation models. The gravity model also has the best (i.e., lowest) mean value of across the stores (see Table 4), closely followed by the IO model and then the extended radiation model. In terms of , the relative performance of these three models is store-dependent (see Figure 2(b)). In some stores, the gravity model has the lowest value of ; in other stores, either the IO model or the extended radiation model achieves the lowest value. For each store, the radiation model performs the worst among the four models, yielding both the lowest CPC scores and the highest values of across all 17 stores. The poor performance of the radiation model is consistent with other studies of mobility systems on small spatial scales Lenormand et al. (2012); Masucci et al. (2013); Liang et al. (2013).
To further investigate the performance of the models, we examine the results of a single store (which we call ‘Store A’) in more detail. Specifically, we examine the estimated OD matrix , the estimated number of visits, and the distance distribution of the OD trips for each of the mobility models. The results for this store are qualitatively similar to the results for the other stores.
In Figure 3, we compare the empirical number of trips with the estimated number of trips from each mobility model for each OD pair of nodes in Store A. To evaluate the quality of , we create logarithmic bins from to . For each bin, we consider all OD pairs whose empirical number of trips lies within the bin. We calculate the mean, median, and interquartile range for the estimated number of trips for these OD pairs . See the black box plots in Figure 3.
On average, the estimated numbers of trips from all four models are close to their empirical numbers, except for OD pairs with a large number of trips. For these OD pairs, the gravity, IO, and the extended radiation models underestimate the number of trips. We tested whether this bias results from the presence of a large number of very short trip between neighboring shelves on either side of a zone boundary. However, this does not appear to be the case. We also examined a more general type of gravity model to explore whether it can improve the fit and/or remove this bias, but it did not. The underestimation by the models of the number of trips for OD pairs with many trips remains an interesting and unexplained feature of the empirical data. The radiation model is effective at estimating the mean number of trips for most of the bins, but its overall performance is poor because of the large variance in its estimates for each bin (see Figure 3(c)).
In Figure 4, we compare the estimated number of visits that we compute from the OD matrix of the models with the number of visits that we estimate using the empirical OD matrix for Store A. We find that the gravity, IO, and extended radiation models are effective at estimating the number of visits for most nodes, except for some of the ones with a large number of visits. For these nodes, the three models overestimate the number of visits. The radiation model underestimates the number of visits for most nodes (see Figure 4(c)).
In Figure 5, we compare the distribution of trip distances in our models with the empirical distribution. The gravity, IO, and extended radiation models have trip-distance distributions that qualitatively resemble the empirical distribution. Among the four models, the trip-distance distribution from the gravity model is closest to the empirical distribution. The IO model underestimates the number of long-distance trips (specifically, those above \mathrm{m}$$), and the extended radiation model overestimates the number of these long-distance trips. The trip-distance distribution of the radiation model is qualitatively different from the empirical distribution (see Figure 5).
In summary, among the models that we examine, the gravity model best fits the empirical mobility-flow data. On average, it successfully explains about 69% of the OD trips in the data sets. It also is effective at estimating the number of visits to each node, with NRMSE values of about (see Table 4). The extended radiation and IO models are close behind; on average, they successfully explain the data of about 65–67% of the OD trips. For the most part, these three models also yield trip-distance distributions that look similar to the empirical distribution. The radiation model does not fit the data well, so we exclude it from further consideration.
V.2 Sensitivity analysis: Parameter dependence of models
We explore how the performance of the gravity, IO, and extended radiation models depends on their respective model parameter values. For each model, let to be the optimal parameter value. We calculate the CPC scores for parameter values between [math] and (see Figure 6). For each of the models, we observe progressively smaller CPC scores for parameter values that are progressively farther away from , so model performance depends on the parameter value. The decrease in CPC score with distance from is steepest for the gravity model, second-steepest for the IO model, and shallowest for the extended radiation model. Interestingly, the CPC score for the extended radiation model plateaus as at a value close to the maximum CPC score. This suggests that a parameter-free special case of the extended radiation model, which we obtain by setting , may perform well. (We do not explore this special case in this article.)
V.3 Evaluation: Model performance on estimating trips in unseen data
We conduct two series of tests to analyze the performance of the gravity, IO, and extended radiation models at estimating mobility flow for a time period for a store for which we do not know the optimal parameter value. As we showed in Section V.2, the performance of each of these models depends on the value of its associated parameter. In each test, we estimate mobility flow using the optimal parameter value from a different time period of the same store (in our first series of tests) or from a different store for the same time period (in our second series of tests). In each test, we compare the achieved CPC value with the maximum CPC value (which we obtain when using the optimal parameter value) with the given model. We also compute their ratio
[TABLE]
A value of that is close to indicates that the estimated mobility flow using a parameter value that is optimal for a different time period or for a different store fits the empirical just as successfully as using the optimal parameter value. In other words, these tests allow us to investigate whether the optimal parameter values of a model differ significantly between different time periods of the same store or between different stores.
In the first series of tests, we split the -day data set of each store into two parts. The first part is the mobility-flow data from the first days; for this subset of the data, we find the optimal parameter value for each model. The second part is the mobility-flow data of the remaining days; we estimate the mobility flow during this period using a mobility model with the empirical values of and (i.e., the number of OD trips that, respectively, start and end at zone ) from this period and the optimal parameter value from the initial -day period. We perform one test for each store, so there are tests per model. The mean value of is about for each of the three models (see Table 5). Therefore, the model parameter values do not change much across different time periods of the same store. It thus seems that our models are likely not overfitting data, as was also noted recently for these types of mobility models by Hilton et al. Hilton et al. (2019). This also suggests that to estimate mobility flow of a store during some (sufficiently long) time period, we only need to know the values of and (which we can estimate from purchase data) during that time period and the optimal parameter value for a different (sufficiently long) time period of the same store.
In each test in our second series of tests, we estimate the -day mobility flow of one store using a mobility model with the optimal parameter value of another store from the same time period. We perform one test for each ordered pair of distinct stores, so there are tests in total for each model. The mean value of is above for each of the three models (see Table 6); this suggests that the differences in model parameter values across stores are small and have minimal effect on the performance of the models. Therefore, we conclude that we can estimate the mobility flow of one store using the optimal parameter value from another store. This also suggests that if we change the layout of a store, the optimal model parameter values should not change appreciably.
VI Reducing congestion in supermarkets
We now use mobility models to estimate and reduce congestion in supermarkets. Our approach has three components:
- (1)
a congestion model, based on queuing networks, that estimates congestion from mobility flow ;
- (2)
a mobility model that estimates the change of the flow with a new store layout; and
- (3)
an optimization algorithm that finds store layouts with less congestion.
We describe these components in detail in Sections VI.1–VI.3.
VI.1 Congestion model
In our congestion model, each node acts as a queue. We suppose that the congestion model, which resembles the one in Guimerà et al. (2002), is in a stationary state. (A key difference is that our model is in continuous time, whereas the model in Guimerà et al. (2002) is discrete.) We take four inputs: (1) an OD matrix with entries , which we calculate using one of the doubly-constrained mobility models in Section IV; (2) a time period over which we measure or estimate ; (3) a store network , with its associated distance matrix ; and (4) service rates for each node ; as we describe later in this section, we can estimate these rates from the mean customer dwell time at .
In Section IV, we interpreted as the flow from a random-walk model in which new customers arrive at a store’s entrance and take trips to random destinations based on a transition matrix whose entries are if and otherwise. In this section, we instead interpret as the mean mobility flow during a time period of length under the following model. New customers arrive at each node (not just at the entrance) of a network (i.e., a supermarket) according to a Poisson process with rate . Each customer chooses a random destination with probability . Customers traverse the network by taking a shortest path from zone to zone . Customers queue at each node that they visit (for both traversal and shopping) to be served, where each node is a single-server queue with exponential service rate Kelly (2011). After a customer is served at the destination node , we remove it from the network. The quantity is then the mean number of customers who take a trip from node to node during a time period of length .
We can view the model in the formulation of the present section as a ‘decomposed’ variant of the model in Section IV. There are independent random walks, each of which starts at a different node in a network and ends after taking exactly one trip to a random destination, instead of a single random walk that always starts at the entrance node and terminates at the exit node after taking one or more trips. In the new formulation, the mean rate at which customers finish a trip at node is the same as the mean rate at which new customers start a trip at . By contrast, in the random-walk perspective of Section IV, the exact number of customers who finish at is equal to the number of customers who start a trip at during any time period. In other words, customers are ‘conserved’ at each node only in a stochastic sense (i.e., on average during some period of time), rather than in an absolute sense.
We calculate for each node from using Equation 11. We need to separately consider situations with and .
When for all , the quantity is the mean number of customer visits to during a time period of length . The arrival rate at each node is then . We call this situation a free-flow state. In this state, the queue size at each node in stationarity is a geometric random variable with mean and is independent of the queue sizes of the other nodes Kelly (2011). The total mean queue size in this state is Taylor and Karlin (2014)
[TABLE]
When for some , node cannot serve customers sufficiently fast, and the number of customers who wait at the queue keeps increasing. Our system is in a congested state and cannot be stationary.
If we have information about the mean customer dwell time at each node , we can infer the empirical service rate of each node using Little’s Law, which states that the mean queue size is equal to the mean dwell time multiplied by the rate of arrivals:
[TABLE]
where
[TABLE]
is the mean queue size at Taylor and Karlin (2014). Combining Equations 15 and 16, we obtain the following formula for the empirical service rate:
[TABLE]
Because we do not have empirical data for the service rate, we assume for simplicity that the service rates are homogeneous. That is, for all , so we are in a free-flow state if , where .
We use the maximum arrival rate and the total mean queue size as proxies to measure congestion. The measure , which does not depend on any parameters, is the minimum service rate that ensures that the system is in a free-flow state. It is also closely related to the traffic capacity in the traffic-dynamics model from Arenas et al. Arenas et al. (2001) that has been used to model traffic on transportation and communication networks Chen et al. (2011); Arenas et al. (2001); Guimerà et al. (2002); Ohira and Sawatari (1998); Zhao et al. (2005); Mukherjee and Manna (2005). The traffic capacity is an important performance measure of the traffic-dynamics model of Arenas et al. Arenas et al. (2001). It represents the maximum rate at which walkers (which, in our case, represent customers) arrive at a network from outside the system before the system reaches a congested state. In the traffic-dynamics model of Arenas et al. (2001), one fixes the service rate but varies the rate at which walkers arrive from outside the system (i.e., the external arrival rate). By contrast, we fix the external arrival rate and vary .
The total mean queue size , which measures congestion in a free-flow state, is equal to the total mean number of customers in a store. By Little’s Law Little (1961), a store layout that minimizes also minimizes the mean trip time. Unlike , the total mean queue size depends on , so we perform separate optimizations for different values of .
The measures and are correlated with each other, as is a sum that is dominated by the terms from nodes with large values of , so store layouts with smaller values of often also have smaller values of .
VI.2 Mobility model
We focus on the gravity model to estimate changes in the OD matrix when changing a store’s layout, because it provides the best fit to the data, both in terms of the CPC score and in the estimated number of visits (see Table 4). We assume that we can swap the locations of nodes (which corresponds to swapping the contents of their shelves), but that we cannot change the store network topology or edge distances in any other way. To ensure that similar items stay with one another in the same aisle, we add a further constraint (which we call the aisle constraint) that we can only swap an aisle (which consists of a set of nodes) with another aisle with the same number of nodes. However, we do allow permuting of nodes within the same aisle. (In Appendix G, we also report our results when we relax the aisle constraint. These results are of similar quality to our more constrained approach in this section.) We do not consider adding or removing nodes or edges, as such changes are often costly. We highlight the nodes that belong to an aisle in Figure 7(a) based on their color. Nodes of the same color are in the same aisle, and gray nodes do not belong in any aisle.
Crucially, we need a hypothesis for how and (i.e., the numbers of trips to and from a node ) change when we change the location of a node . We assume that and depend only on the items inside a zone and not on the zone’s location. Therefore, when we change the location of a node , we assume that the node has the same values of and in the new location. In other words, we are assuming that the number of shopping visits at node (i.e., the number of times that customers visit to purchase items) is independent of its location. This is a key assumption of our model. For nodes with many essential items, such as bread and milk, this assumption seems justifiable, as customers buy such items regardless of their location in a store. However, we anticipate that this assumption breaks down for nodes in which most items are either less essential or purchased with less (or no) planning.
VI.3 Optimization algorithm
We use a simulated-annealing (SA) algorithm Kirkpatrick et al. (1983) to find permuted layouts of a store with smaller values of one of the two objective functions ( or ). Our SA algorithm swaps two aisles, which we choose uniformly at random from all pairs of aisles with the same number of nodes and whose centroids are less than \mathrm{m}$$ apart. After swapping the two aisles, we permute the nodes within each aisle, where we choose the permutation uniformly at random from all possible permutations. We list the parameters of the SA algorithm in Appendix F.
VI.4 Optimization results
We optimize a store’s layout (specifically, the layout of Store A) with the SA algorithm for three examples, in which we minimize
- (1)
; 2. (2)
with ; and 3. (3)
with .
For , each node serves incoming customers at a rate of customers per day, which amounts to customers per minute in a store that is open for hours. The maximum arrival rate in the original store layout is , so a service rate of is an example in which the most popular nodes have a longer mean dwell time. For example, in a store that is open for hours, the most popular node has a mean dwell time of about seconds (which we calculate using Equation 15). Our example with , a value much larger than the original , corresponds to a scenario in which customers typically have short mean dwell times in all nodes. (In this case, the most popular node has a mean dwell time of about seconds.) We perform each optimization times and report our results in Table 7. For all three examples, the SA algorithm produces store layouts with objective-function values that are significantly smaller than their values in the original store layout. The relative reduction in is smaller for than it is for . This is not surprising, as with , a larger fraction of the total mean queue size comes from nodes with the highest arrival rates in the original network. For example, the sum of the mean queue sizes of the three nodes with the highest arrival rates constitute 39% of for . By contrast, these three nodes contribute only 15% of the value of for . Therefore, store layouts that lower the arrival rates of the most congested nodes (while the arrival rates of the other nodes do not increase much) tend to have lower values of for . For , because the most congested nodes contribute less to than for they do for , achieving a major relative reduction in requires reducing the arrival rates of a larger number of nodes. This is potentially a very difficult task. Therefore, our observation of a lower reduction in for than for is consistent with expectations.
We measure the popularity of node by (i.e., by the sum of the numbers of trips that start and end at ). For each node except the entrance and till nodes, is equal to twice the number of shopping visits to that node. In the networks with the smallest with and , our optimization tends to move popular nodes from the center of Store A towards the left and top of the store (see Figure 7(b)). By contrast, when , many popular nodes remain in the center of Store A (see Figures 7(c) and 7(d)). However, our optimization moves some of them to the store’s bottom-left area, which previously was not a popular area.
VII Conclusions and discussion
We employed several population-level mobility models to investigate customer mobility flow between zones in supermarkets, whose spatial scales are much smaller than in previous uses of these models. We estimated origin–destination (OD) matrices, which describe empirical mobility flow, for supermarkets from anonymized and ordered customer-basket data (where a customer’s “OD trip” is either a trip between consecutive purchases, a trip from the entrance to the first purchase, or a trip from the last purchase to the tills). We fit the mobility models to empirical distributions of customer OD trips and examined the adjustment of store aisles to reduce congestion in supermarkets.
Among the models that we studied, the gravity model gave the best fit to the empirical mobility flow (it successfully estimated about 69% of the flow on average), and the extended radiation and intervening-opportunities (IO) models were almost as successful. This illustrates that one can successfully use population-level mobility models for applications on spatial scales of tens to hundreds of meters.
In our investigation, we estimated the number of visits to each node from mobility flow by assuming that each customer traverses a shortest path, and we found that our estimations from the origin–destination (OD) matrices from the gravity, IO, and extended radiation models agree well with the total number of visits that we estimated from empirical OD matrices. (We used the shortest-path assumption only to estimate the number of visits; our estimates of mobility flow do not rely on this assumption.) Additionally, the gravity, IO, and extended radiation models yield trips with similar distance distributions to the empirical distribution. However, consistent with other studies on small spatial scales (which generally have been in intra-urban settings) Lenormand et al. (2012); Masucci et al. (2013); Liang et al. (2013), the basic radiation model was not successful at reproducing features of the data.
The gravity, IO, and extended radiation models each have one parameter, and their performance depends on the value of their parameter. In our investigation, we found that it is sufficient to use the optimal model parameters that we calibrated on a single store to give good estimates of the mobility flows of all other stores. The only additional information that we needed for the other stores is the number of trips from and to each node; one can estimate these quantities from the purchase data of these stores. For a given store, we were also successful at using the models to estimate the mobility flow of a time period using a parameter value from fitting to data for another time period of the same store. Given our success at translating optimal parameter values across both stores and time periods, our approach provides a potentially valuable testbed for experimentation by supermarket companies using sales data from existing stores before trying out new store layouts.
Finally, we showed how to use the gravity model in conjunction with a congestion model — with tests using congestion measured based either on the maximum number of visits or on the total mean queue size — and an optimization algorithm to reduce congestion in supermarkets. We considered a congestion model in which each node acts as a queue with service rate , assumed that customers traverse a shortest path between two nodes, and explored the space of store layouts in which one can permute aisles (but one cannot permute individual store zones, except within the same aisle). We then used the gravity model to estimate how mobility-flow changes from permutations of a store layout. In the layouts that we obtained by minimizing or minimizing with low service rate , popular nodes (as measured by the number of trips from and to a node) move from the center of a store to the left and upper perimeters. By contrast, in the layouts that we obtained by minimizing with a high service rate , some popular nodes move to a previously unpopular corner of a store.
There are several ways to build on our work. Possibilities include further development of mobility models and congestion models, analyzing seasonal effects and customer heterogeneity, allowing service rates to be heterogeneous, exploring the effect of our choice of space discretization, and applying our approach to situations other than supermarkets. We discuss several of these items in the following paragraphs.
In our investigation, we inferred empirical mobility flow from anonymized, ordered basket data of the mobility of a relatively small sample of customers (approximately 7%) from supermarkets. Naturally, this sample also has certain biases, as our data consists primarily of baskets from regular customers. It is likely that these customers possess better knowledge than other customers of the stores in which they shop (given that they do so regularly), so their mobility patterns may not be representative of all customers of a given store.
We have also neglected temporal information and seasonal effects in our data by aggregating the mobility flow over days. However, we expect mobility flow to be different at different times of the day (and on weekdays versus weekends) and at different times of a year (e.g., during certain holidays). We also expect different zones of a store to be the most congested ones at different times. Given sufficient data, one can apply mobility models to data that is segmented by the time of day or by the day of a year and then compare the parameter values from independent fitting to data in different time periods.
To study congestion, we used a simple routing and congestion model (using queues in each zone of a store). We assumed shortest-path routing, but some researchers have noted that customers deviate from shortest paths between purchases Hui et al. (2009a, b). It is important to improve understanding of the routes that customers take between purchases. One possible approach is to use anonymized customer-trajectory data to develop and calibrate a stochastic routing model (e.g., using a variant of a random walk, perhaps with probabilities affected by heterogeneous fitness values for different zones of a store). One can incorporate such a routing model in a straightforward way into our framework to better estimate the number of visits to each zone . When we estimated the mobility flow of different store layouts, we assumed that the number of customer shopping visits at node is fixed and does not depend on the location of . However, the location of a zone that contains items that are typically bought in an unplanned way likely affects the number of shopping visits to that zone. One can incorporate increasingly accurate models of the number and zone distribution of shopping visits into our framework to improve estimates of the mobility flow from different store layouts. Additionally, more empirical research is necessary to attain a detailed mechanistic understanding of the causes of congestion in supermarkets. We modeled congestion as queues in a zone; if such a model is conceptually accurate, we can incorporate more realistic types of queues (e.g., with variable service rates or with customers who do not enter a queue if it is too long). One can infer service rates using a method that is analogous to what we described in Section VI, provided one possesses data on customer dwell time (or can somehow infer such times) for each zone of a store.
Another consideration is the choice of space discretization and spatial resolution, and it is necessary to examine how such choices affect qualitative results of both mobility models and congestion models. (In our work, we divided each store into zones of approximately similar size, with zone lengths of about \mathrm{m}$$.)
Although one can apply our approach for modeling mobility flow and congestion at any spatial scale, we expect that one can implement our methodology in practice in systems in which one can modify the underlying spatial structure. Many such applications have small spatial scales, as rewiring a small system is often a lot less costly than rewiring a large one. For example, when considering commuting flow, one cannot change the locations of countries or buildings. However, one can apply our tools for modeling mobility flow and congestion in a museum and use our optimization procedure to suggest better locations for the exhibits. Other examples include poster sessions in academic conferences and food stations in buffet restaurants. Applying our approach to these settings will help reveal which of our findings are specific to mobility flow in supermarkets and which ones apply more generally to human mobility on small spatial scales.
Acknowledgements.
FY acknowledges support from EPSRC Centre For Doctoral Training in Industrially Focused Mathematical Modelling (EP/L015803/1) in collaboration and Tesco PLC. MBD acknowledges support from Oxford–Emirates Data Science Lab. We also thank David Allwright, Robert Armstrong, Chico Camargo, Albert Díaz-Guilera, Scott Hale, Renaud Lambiotte, Neave O’Clery, Trevor Sidery, and an anonymous referee for helpful comments.
Appendix
Appendix A Defining zones in a store
In this appendix, we discuss how we define the zones in a store.
First, we manually identify the aisles in a store. Each aisle is a long rectangle between two lines of shelves. The edges of each aisle are either parallel to the horizontal axis or parallel to the vertical axis on a floor plan. (In other words, there are no tilted aisles.)
We then subdivide each aisle into rectangular zones of equal dimensions, where we choose the number of zones such that the length of the zones in the aisle is as close as possible to \mathrm{m} (our targeted mean zone length). (We define the “length” of a zone as the longer side of the rectangle that encloses the zone.) The number $Z$ of zones in each aisle varies between different aisles; it is typically either $2$ or $3$. The width of each aisles is smaller than $7\,$\mathrm{m}, so if an aisle is horizontal (i.e., the longer edges of the aisle are parallel to the horizontal axis), then all zones in the aisle also horizontal. Similarly, if an aisle is vertical (i.e., the longer edges of the aisle are parallel to the vertical axis), all zones are also vertical.
We then manually place the entrance zone and the till zone. We fill the remaining floor area of a store with long, large rectangles whose widths are similar to the width of store aisles. We divide each of these large rectangles into zones of equal size (where zones for different large rectangles may have different sizes). See Ying (2019) a lengthier discussion of how we define zones.
Appendix B Iterative proportional-fitting procedure for determining and
In the doubly-constrained models, we are given , , and for all nodes and . We seek to determine and (the balancing factors) that satisfy
[TABLE]
Rearranging Equations 18 and 19 yields
[TABLE]
In our iterative proportional-fitting procedure, we initialize for all . We then calculate using Equation 21 from , followed by an update of using Equation 20. We repeat this procedure until the values on the right-hand side of Equations 18 and 19 are close (specifically, within 1%) of the values on the left-hand side. In practice, this procedures converges within iterations for all of the employed models.
Appendix C Performance of the doubly-constrained gravity model with an exponential deterrence function
In the doubly-constrained gravity model with an exponential deterrence function, the OD matrix is given by Equation 3 with
[TABLE]
We find that both the CPC score and NRMSEv are slightly worse on average than for the gravity model with a power-law deterrence function (see Table 8).
Appendix D Estimating and from purchase data
In our models, we used and to calculate mobility flow. In the main text, we assumed that we know these values. In this section, we show how to estimate and from customer-level purchase data.
For each customer , our data includes a list of items that were purchased during a shopping journey. Using item-location data, we can identify the possible zones in which a customer could have picked up each item. We assume that all items in the same zone were picked up in one visit by a customer, so customers do not visit a zone more than once. The main challenge is how to account for purchased multi-located items. We calculate the number of trips that start from nodes for each customer as follows. If a customer buys an item that is located only in zone , we set . Otherwise, we check whether a customer buys an item that is located both in zone and in other zones. (In other words, there are multiple possible zone locations for that item.) If this is the case, let be the number of such purchased items, and let be the number of possible zone locations for each of the items. We set . Therefore, each item that is located in zone and in other zones counts as a of a visit, with capped at . If a customer has not purchased any items that are located in zone , then . By construction, the value of is at most , and it can take a fractional value when a customer buys items that are located in as well as other zones.
We calculate (with ) with the formula
[TABLE]
where is the number of journeys in the data set and is the Kronecker delta. The term accounts for the first trips of each shopping journey, as these start at the entrance of a store. We calculate with the formula
[TABLE]
We rescale , and by dividing by (i.e., by the number of baskets in the data set during the time period divided by the total number of baskets during the time period).
In Figure 8, we compare the empirical values of and with ones that we estimate for Store A. In our calculations, the estimated values are close to the empirical ones, so we conclude that we can estimate and using only purchase data.
Appendix E Derivation of the attraction factor in Schneider’s IO model
In Schneider’s IO model, each customer who leaves node considers each opportunity in nondecreasing order of distance from (i.e., from the nearest node to the farthest one). For simplicity, we assume that there are no equidistant nodes. A customer accepts the current opportunity with probability , where is a dimensionless fitting parameter and is the total number of trips 444In the original formulation, is replaced by in Equation 7, and has dimensions of [(number of trips)-1]. Upon accepting an opportunity at , a customer takes a trip from node to node and thus does not consider any other opportunities. A customer who has not accepted any opportunity restarts the process and considers all opportunities again in nondecreasing distance from . This process continues until the customer accepts an opportunity.
We calculate the probability of a customer accepting an opportunity at node as follows. Let be the number of rejected opportunities in the final iteration when an opportunity is accepted. The random variable has a truncated geometric distribution. A customer who accepts an opportunity at node must reject all opportunities at closer nodes and accept one of the opportunities at . In other words, a customer in zone takes a trip to zone if . The probability of rejecting at least opportunities is
[TABLE]
where the approximation becomes exact as and tend to infinity with constant. Therefore, the probability that a customer accepts an opportunity at node is
[TABLE]
In Equation (26), the quantity equals the number of customers who make a trip from to divided by the number of customers who leave . However, as we use a doubly-constrained model, gives only the attraction value of zone to a customer in zone . In such a model, the quantity equals the actual number of customers who make a trip from to divided by the total number of trips that originate at .
Appendix F Parameters of the simulated-annealing algorithm
We set the initial computational temperature to when minimizing and to when minimizing . We use a cooling schedule in which we reduce the temperature by 0.18% of the current temperature at each step, so there are steps in total. We use the standard acceptance probability function , where is the change in the objective-function value of the current step and is the computational temperature.
Appendix G Results of the simulated-annealing algorithm without the aisle constraint
We now apply the SA algorithm without the aisle constraint. Specifically, in one swapping step, we choose an edge uniformly at random among all edges, except for those that are incident to the entrance or till node; and (assuming the step is accepted) we swap the two nodes that are incident to chosen edge. We use the same parameters that we described in Appendix F. The SA algorithm without the aisle constraint finds store layouts with smaller values of on average than when we run the algorithm with the aisle constraint (see Table 9). We find that the relative decrease in is smaller for than for . Interestingly, the store layouts that we obtain when minimizing have larger values of without the aisle constraint than with the constraint. This suggests that the SA algorithm, which is a heuristic algorithm, is not very efficient at exploring the state space of store layouts, as it is unable to find the store layouts (which have small values of ) that were obtained with the aisle constraints.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Zipf (1946) G. K. Zipf, American Sociological Review 11 , 677 (1946).
- 2Stouffer (1940) S. A. Stouffer, American Sociological Review 5 , 845 (1940).
- 3Schneider (1959) M. Schneider, Papers in Regional Science 5 , 51 (1959).
- 4Barbosa et al. (2018) H. Barbosa, M. Barthelemy, G. Ghoshal, C. R. James, M. Lenormand, T. Louail, R. Menezes, J. J. Ramasco, F. Simini, and M. Tomasini, Physics Reports 734 , 1 (2018).
- 5Simini et al. (2012) F. Simini, M. C. González, A. Maritan, and A.-L. Barabási, Nature 484 , 96 (2012).
- 6Bergstrand (1985) J. H. Bergstrand, The Review of Economics and Statistics 67 , 474 (1985).
- 7Piovani et al. (2018) D. Piovani, E. Arcaute, G. Uchoa, A. Wilson, and M. Batty, Royal Society Open Science 5 , 171668 (2018).
- 8Anderson (1979) J. E. Anderson, The American Economic Review 69 , 106 (1979).
