Skip to content
JAOT

Retail Assortment & Pricing

Optimize retail operations including inventory levels, shelf space allocation, markdown pricing, and store layout. Whether you run a single shop or a chain of hundreds, optimization helps you stock the right products in the right quantities to maximize revenue and minimize waste.

When to Use This Guide

This guide is a good fit when you need to:

  • Inventory management -- decide how much of each product to stock given storage limits and demand forecasts
  • Markdown pricing -- choose optimal discount levels to clear seasonal inventory without leaving money on the table
  • Shelf space allocation -- assign products to shelf sections to maximize revenue per square meter
  • Store staffing -- schedule cashiers and floor staff to match foot-traffic patterns

If your problem involves distributing a fixed resource (budget, shelf space, labor hours) across competing options to maximize a business outcome, this is the right starting point.

Step-by-Step Walkthrough

  1. Identify your products. List each product with its expected demand, profit margin, and any minimum display requirements (e.g., "must stock at least 2 facings of Product A").

  2. Define your constraints. Typical constraints include total shelf space, category minimums (at least one organic option), budget caps, and supplier agreements.

  3. Choose your objective. In most retail problems you want to maximize total expected profit or revenue. Occasionally you may minimize cost while meeting a service-level target.

  4. Set up in the Builder. Create variables for each product-location pair, add shelf and budget constraints, and set the objective to maximize profit.

  5. Run and interpret results. The solver returns the optimal allocation for each product. Review which items received zero allocation -- these are candidates for delisting.

Example: Shelf Space Allocation

A convenience store has 3 sections (snacks, drinks, household) with 20, 15, and 10 shelf slots respectively. Eight products compete for space, each with a different daily revenue per slot and a minimum display requirement.

import httpx

API_URL = "https://api.jaot.io/api/v2"
headers = {"Authorization": "Bearer ok_live_your_key_here"}

# Products: (name, revenue_per_slot, min_facings, eligible_sections)
products = [
    ("chips", 12, 2, ["snacks"]),
    ("cookies", 9, 1, ["snacks"]),
    ("candy", 7, 1, ["snacks"]),
    ("soda", 15, 3, ["drinks"]),
    ("juice", 10, 2, ["drinks"]),
    ("water", 6, 2, ["drinks"]),
    ("detergent", 8, 1, ["household"]),
    ("paper_towels", 5, 1, ["household"]),
]

sections = {"snacks": 20, "drinks": 15, "household": 10}

# One variable per product: how many slots to allocate
variables = [
    {"name": p[0], "type": "integer", "lb": p[2], "ub": sum(
        sections[s] for s in p[3]
    )}
    for p in products
]

# Maximize total daily revenue
objective = {
    "sense": "maximize",
    "coefficients": {p[0]: p[1] for p in products},
}

# Section capacity constraints
constraints = []
for section, capacity in sections.items():
    eligible = [p[0] for p in products if section in p[3]]
    constraints.append({
        "name": f"{section}_capacity",
        "coefficients": {name: 1 for name in eligible},
        "sense": "<=",
        "rhs": capacity,
    })

response = httpx.post(f"{API_URL}/solve", headers=headers, json={
    "variables": variables,
    "objective": objective,
    "constraints": constraints,
})
result = response.json()

print(f"Status: {result['status']}")
print(f"Daily revenue: ${result['objective_value']:.2f}")
for p in products:
    print(f"  {p[0]}: {result['solution'][p[0]]:.0f} slots")

The solver allocates more slots to high-revenue products (chips, soda) while respecting minimum-facing requirements for every item and staying within each section's capacity.

Next Steps

  • Warehouse Layout & Operations (intermediate) -- extend your retail optimization to the back-of-house with storage layout and picking route models
  • Supply Chain Planning (advanced) -- connect store-level decisions to upstream procurement and distribution