Shelf-Space Optimisation: Product Grouping and Layout Recommendations, W13 Retailer Case – Study Notes
offline

TL;DR

Once the three shelf-space hypotheses are validated, the retailer needs to act on them. This part of the case covers how to group products that are frequently bought together (using clustering, Louvain community detection, or optimisation) and then how to use constrained optimisation to place those groups in the store layout for maximum sales benefit.

Difficulty: Intermediate to Advanced

Prerequisites: Part 1 of these study notes (Hypotheses and Testing). Familiarity with clustering, graph algorithms, and basic optimisation concepts.

Big Picture

Validating hypotheses is only half the job. The retailer now needs to translate statistical findings into concrete store-layout decisions. This means grouping products into clusters of complements (so they can sit near each other) and then assigning those groups to physical locations in the store. The case introduces three distinct modelling approaches for the grouping step, each with a different mathematical foundation: distance-based clustering, graph-based community detection, and direct optimisation. The final step layers a second optimisation model on top to decide where in the store each group should go. This is where analytics meets operations research.


Key Terms

Co-purchase frequency / co-purchase percentage

The percentage of transactions in which two products are bought together. This is the core input for all three product-grouping approaches.

Distance-based clustering

A clustering method where the "distance" between two products is inversely related to their co-purchase frequency. Products bought together often are treated as "close" and grouped together. Think of it as: products that shoppers pair up frequently end up in the same cluster.

Louvain algorithm / community-finding model

A graph partitioning algorithm that groups nodes (products) into communities by maximising modularity, which measures how dense the connections are within groups compared to between groups. Each edge weight is the co-purchase percentage. In simple terms, Louvain finds natural clusters in a network of product relationships.

Optimisation model for grouping

A mathematical model where the objective is to maximise the total "value" of products being in the same group, with value defined as the co-purchase percentage. Unlike clustering or Louvain, this approach directly optimises for the grouping outcome rather than relying on an intermediate distance or modularity measure.

Layout optimisation

The second-stage optimisation that takes the product groups (from any of the three approaches above), the shelf-space amounts (from the earlier regression and optimisation work), the physical store layout, and customer purchase patterns, and decides where in the store to place each group to maximise total sales.


Core Content: Three Approaches to Product Grouping

All three approaches start from the same data: the percentage of time any two products are bought together. They differ in how they turn that data into groups.

Approach 1: Distance-Based Clustering

  • Compute co-purchase percentages for every pair of products.

  • Define the "distance" between two products as inversely related to their co-purchase percentage. High co-purchase frequency means short distance.

  • Apply a standard clustering algorithm (e.g. k-means, hierarchical clustering) using these distances.

  • Products that are frequently bought together end up in the same cluster.

Approach 2: Community Detection (Louvain)

  • Build a graph where each product is a node.

  • Add an edge between every pair of products, weighted by their co-purchase percentage.

  • Run the Louvain algorithm, which partitions the graph into communities by maximising modularity (the density of edges within groups relative to what you would expect at random).

  • The output is a set of product communities, each containing products that are frequently co-purchased.

Approach 3: Direct Optimisation

  • Define the "value" of placing two products in the same group as their co-purchase percentage.

  • Build an optimisation model that assigns products to groups so as to maximise the total value across all pairs in the same group.

  • This approach explicitly optimises the grouping objective rather than using a proxy (distance or modularity).

Each approach has trade-offs. Clustering is familiar and fast. Louvain handles large product networks well and discovers natural community structure. Direct optimisation gives the best theoretical grouping but may be computationally expensive for large product catalogues.

Core Content: Optimising Store Layout With Groups

Once products are assigned to groups, a second optimisation model decides where in the store each group should sit. The inputs to this model are:

  • Product groups and shelf-space amounts: The groups from one of the three approaches above, along with the shelf-space allocation determined by the earlier regression and optimisation work (from Part 1).

  • Store layout: The physical floor plan, including aisle positions, entrance and exit locations, and available shelf sections.

  • Customer purchase patterns: Data on how customers move through the store and what they tend to buy together.

The objective is to locate product groups within the store so as to maximise total sales benefit. This means placing groups of frequently co-purchased products near each other (leveraging the adjacency effect from Hypothesis 3) while respecting the physical constraints of the store layout.

This is a constrained optimisation problem. The decision variables are the locations assigned to each group. The constraints include shelf-space limits and the fixed geometry of the store. The objective function captures the sales uplift from adjacency, weighted by the strength of the co-purchase relationships within and between groups.


Real-World Applications

Every large retailer (supermarkets, department stores, home-improvement chains) faces this problem. The reason bread and milk are typically at the back of the store, and why complementary items like pasta and pasta sauce sit in the same aisle, is the result of exactly this kind of analysis. Category management teams at retailers and CPG manufacturers use shelf-space optimisation tools daily.

Beyond retail, the same grouping and layout logic applies to e-commerce product recommendation pages, warehouse slotting (placing frequently co-picked items near each other to reduce pick times), and even hospital supply rooms.


Common Misconceptions

  • Students sometimes assume that clustering and community detection will produce identical groups. They will not. Clustering uses a distance metric; Louvain optimises modularity. The groups can differ meaningfully, and part of the analytical work is choosing which method suits the data and the business question.

  • The direct optimisation approach (Approach 3) is sometimes assumed to be strictly better because it optimises the grouping objective directly. In practice, it can be computationally intractable for very large product sets, which is why the other approaches exist.

  • Students often forget that the layout optimisation is a separate step from the grouping. Grouping decides which products belong together. Layout optimisation decides where in the store those groups go. These are two distinct models with different inputs and constraints.

  • Co-purchase frequency is sometimes confused with co-occurrence in the store. Two products sitting near each other does not mean they are frequently bought together, and two products frequently bought together might currently be in different aisles.


Why It Matters / Exam Flags

⚠️ Be able to describe all three product-grouping approaches and explain what makes each one different (distance metric vs. modularity vs. direct objective).

⚠️ Know the inputs to the layout optimisation model: product groups, shelf-space amounts, store layout, and customer purchase patterns.

⚠️ Understand that the recommendations phase has two distinct modelling steps (grouping, then layout), each with its own objective and constraints.

⚠️ If asked to compare approaches, note that direct optimisation gives the tightest alignment with the business objective but may not scale, while clustering and Louvain are more practical for large product sets.


Quick Self-Test

  1. True or false: In the clustering approach, products with a high co-purchase percentage are assigned a large distance from each other.

    • False. The distance is inversely related to co-purchase frequency. High co-purchase means short distance.

  1. Fill in the blank: The Louvain algorithm partitions a product graph by maximising _______.

    • Modularity.

  1. True or false: The layout optimisation step and the product-grouping step use the same model.

    • False. They are two separate models. Grouping assigns products to groups. Layout optimisation assigns groups to store locations.

  1. Fill in the blank: The three inputs to the layout optimisation model (besides the product groups) are shelf-space amounts, _______, and customer purchase patterns.

    • Store layout.


Practice Q&A

Q: Compare the clustering approach and the Louvain approach for product grouping. What is the key structural difference?

A: Clustering works in a metric space: it defines a distance between products (inverse of co-purchase frequency) and groups products that are "close." Louvain works on a graph: it treats products as nodes connected by weighted edges (co-purchase percentages) and partitions the graph to maximise the density of edges within groups (modularity). Clustering uses distance; Louvain uses network structure.

Q: Why might a retailer choose the direct optimisation approach over clustering or Louvain?

A: Direct optimisation explicitly maximises the business objective (total co-purchase value of products in the same group), while clustering and Louvain optimise proxy objectives (distance minimisation and modularity, respectively). If the product catalogue is small enough for the optimisation to run in reasonable time, it gives the most aligned answer.

Q: What are the decision variables, objective, and constraints in the layout optimisation model?

A: Decision variables: the store location assigned to each product group. Objective: maximise total sales benefit (driven by adjacency effects between co-purchased product groups). Constraints: each product type's minimum and maximum shelf space, total available shelf space in the store, and the physical layout of the store (which locations are adjacent to which).

Q: A student says "once we know which products go together, we are done." What step are they missing?

A: They are missing the layout optimisation step. Knowing which products belong in the same group is necessary but not sufficient. The retailer still needs to decide where in the store to place each group so that adjacency effects between groups are maximised and physical constraints are respected.


Connections to Other Topics

The clustering approach connects directly to unsupervised learning topics in any data science or machine learning course. If you have covered k-means or hierarchical clustering, this is a real-world application with a custom distance metric.

The Louvain algorithm connects to graph theory and network analysis. If your course covers social network analysis or community detection, this case provides a non-social application of the same tools.

The two-stage optimisation (grouping, then layout) connects to multi-stage decision-making and decomposition strategies in operations research. The idea of solving a complex problem by breaking it into manageable sub-problems is a recurring theme in OR coursework.


Related Terms / Search Tags

product grouping, co-purchase analysis, market basket analysis, clustering retail products, Louvain algorithm, community detection, modularity, graph partitioning, shelf-space optimisation, store layout optimisation, constrained optimisation, category management, planogram, adjacency optimisation, retail operations research, product placement strategy, assortment optimisation