Explainer

The expert's rule

How does an expert's rule handle a broken-size transfer, and where does it stop? It starts with the best seller, takes from stores whose set is already broken, and stops at the first set it cannot complete. Routes stay at one unit, and the cut in broken sizes melts away before the markdown.

Broken-Size Transfer · 3 / 6

In this article we ask how an allocator’s rule, settled over the years, does this job and where it stops. Ali solved the blush jacket by hand. But on the winter decision morning there are 819 candidate pairs, and on the summer one 651. This is not a job for doing by hand; it needs a rule. First we will write the rule down, then look at what it did in two seasons. From here on we call it the expert’s rule.

The rule

“It’s simple,” says Ali. “I start with the store that has sold the product best this season; if its missing sizes aren’t in the warehouse or on the way, that’s the receiving store. I take the stock from stores whose set of the same product is already broken, the ones selling least first, and I never break a full set. A store gives once per product. If every size at the receiving store can’t be brought up to at least one, I don’t touch it: the set is either completed or left as it is.”

“Best seller” is measured over four windows: sales from the start of the season to today, the STDSales from the start of the season up to today., and the last 7, 14 and 28 days. In each window the stores are ranked within that optionThe combination of a model and a colour; the basic product unit for planning and for transfer decisions., and the score is the average of the ranks, with equal weights. The STD shows the long run, the short windows show today. If the set can be completed, the sizes are filled up to the size ratioThe standard split of an option across its sizes; at Lumoda the five-size set is 1-2-2-1-1. In the trade, the mixed pack made up to that ratio is called a ratio pack. quantity as far as supply allows; if need be, a sending store gives all its stock of a size. The rule does not look at cost.

The heart of the code is a few lines. The extract below comes from the working code in cases/broken-sizes/, simplified for a single option; in the code the sending stores are donors and the receiving stores receivers.

# broken_sizes/rule.py, rule_plan (simplified, for a single option)
receivers = sorted(eligible, key=lambda m: (-score[m], ordering.key("store_id", m)))  # best seller first
pool = sorted(broken_pairs, key=lambda m: (score[m], ordering.key("store_id", m)))     # lowest seller first
marked = set()
for receiver in receivers:
    if receiver in marked:                                  # became a donor: cannot receive
        continue
    donors = [d for d in pool if d not in marked and d != receiver]
    left = need[receiver].copy()
    supply = sum(np.where(left > 0, stock[d], 0) for d in donors)
    if not (supply[broken[receiver]] >= 1).all():           # every broken size up to at least one
        skipped.append(receiver)                            # cannot be completed: untouched
        continue
    givers = set()
    for d in donors:                                        # up to the size ratio
        give = np.minimum(left, stock[d])
        if give.sum() > 0:
            left -= give
            givers.add(d)
    marked |= {receiver} | givers                           # a donor gives once in this option

This is not a bad rule. Protecting full sets, taking from stores whose set is already broken, and not sending stock to a set that will not be completed are all sensible choices in the field. Now let us look at what those choices do.

What the rule did

WinterSummer
Receiving stores completed in the plan213158
Receiving stores skipped335299
Moves446330
Units moved549418
Routes312241

Two things stand out. More receiving stores are skipped than completed. And the units moved are spread thinly across the routes: one or two units per route.

Why so many receiving stores are skipped

“Why can’t we complete so many stores?” says Pelin. “Is there no stock?”

“There’s stock, just not the right size,” says Pars. “Let’s call the stores that could send the pool. A receiving store is skipped when one of its broken sizes is left nowhere in the pool. But that size being gone from the pool means it’s at zero in every candidate further down the list too, because they are part of the pool.”

So in an option, once the first receiving store has been skipped, no store after it can be completed. The supply of the size that would complete it has run out. The rule starts with the best seller and stops at the first set it cannot complete. Most of the skipped stores never had a chance of their own; they are the ones left in the queue after that point.

The blush jacket shows this. On that jacket the rule completed three receiving stores; Istanbul 17 was the third. The next candidate was skipped, and so were the ones after it. An allocator in the field would put it as “we can’t pull this product together any further”.

This is the rule’s natural limit. It follows from the set condition and from “a store gives once”. A store can give the L and the XL at the same time, but in the same option it does not give again to another receiving store. That choice stops a store’s remaining stock being scattered in several directions; in return, fewer receiving stores are completed.

One-unit routes

In the story, five units came from five stores. That is not usual: the median number of sending stores per receiving store is 1 in winter and 1.5 in summer. Yet the blush jacket is typical in one respect: the median number of units per route is 1 in both seasons.

The reason lies in how the rule is built. It picks the sending store within each option, by that option’s own score order. It does not check whether there is already a route between a sending store and a receiving store. So the lorries are not combined. The lorry question from the last article shows itself here; we will see what it costs in the sixth article.

What happened to broken sizes

We look at two Mondays and count the whole stock: how far is the number of broken sizes from the same day’s count at Lumoda, which makes no broken-size transfer?

On the first Monday after arrival the difference in winter is −73. At the sending stores, though, broken sizes go up: +34 in winter. That is to be expected; when a sending store gives all its stock of a size, that size drops to zero there. Because the rule protects full sets it opens no new broken pairs, but it widens the gap in stores whose set was already broken.

On the last Monday before the markdown the difference is −26 in winter and −27 in summer. At Lumoda there are 4,011 broken sizes on that Monday in winter. In winter most of the effect has melted away before the markdown; in summer it was small from the start. This is what we saw in Istanbul 17: once the stock sells, the set breaks again.

There is one thing you need to know when reading this difference. A pair whose stock has run out completely drops out of the broken count, because the store no longer has the product at all. The rule’s −26 and −27 come from there. In the stores where the product is on the rail in both worlds, broken sizes go up by 14 in winter and 18 in summer. So on the way to markdown day the count is low not because sets were fixed, but because some pairs dropped out of the count.

The number the field will see is much brighter. The share of received stock that turns into sales is 90.7% up to the markdown in winter, and 97.1% up to exit. Exit is the day the stock is collected from the season’s stores. These numbers look only at the receiving store. The answer to Veli’s question is not in them; the sixth article separates it out.

The censoring trap

There was an objection to the rule from the start. The last few days of a store whose set has broken look weak: the size is not on the rail, so how could it sell? That is censored demandDemand that arrives while the shelf is empty and is never recorded. Sales data show not demand but the smaller of demand and stock.. Because the rule’s score includes short windows, it should be expected to miss a good store whose set broke a while ago.

The blush jacket has an example. Since the start of the season Istanbul 18 has sold more of that jacket than Istanbul 17. But with only the XXL left, it sold hardly any in the last week. Its score dropped, and the rule made it a sending store. A rule that looked only at the last few days should be even more prone to this mistake.

We tested it. We ran the same rule with the score built from the last 28 days only. What we expected did not happen. The number of receiving stores completed in the plan is almost the same. The difference in broken sizes on the last Monday before the markdown, across both seasons and the whole stock, is −59 for the rule that looks only at 28 days and −53 for the original rule. Taking the transfer cost off the revenue difference, with a medium cost assumption, both come out close to zero over the two seasons (TRY 0.0 million). In true incremental sales per unit moved, the 28-day rule is even slightly ahead: 22.8% against 17.8%. The trap we expected did not spring in this run.

So the choice of window changes little here; it may mislead in individual stores, but its weight in the total is small. We did not test why separately. This comparison comes from a single simulation run, of the published world; we did not try it in other demand scenarios. It is not a general verdict, but it says that in this run fine-tuning the score was not worth the trouble.

The rule’s limit is not in its score: it does not look at routes and it does not weigh the sending store’s loss. Completing the set and protecting full sets are not limits; they are the definition of the job. In the fifth article we give the same two conditions to an optimisation: how much does the result change once routes and sending stores are looked at too?

What is hard in your own data

Who is going to apply the rule in the field? For an allocator it is a job done once a season, while the markdown list is being drawn up. Its inputs sit in four different places: broken sizes in store stock, the warehouse in another report, open orders on the supply side, the STD and the last few days in the sales report. Without a report that brings them together, the rule gets worked by hand in a spreadsheet and dropped in the first busy week.

Authority is a separate question. For Ali’s receiving store, the stock leaves Veli’s store. The rule writes that in one line; in the field it is a conversation between two allocators. With whose approval, and off whose target?

The STD misleads for products that arrive mid-season. If the same option went to one store with the first wave and to another with the second, their STDs do not compare the same number of days. The store that got it later looks as if it sold less. The right way is to divide sales by days in stock, but most systems do not have that ready.

The stock record is the rule’s weak spot too. The rule reads from the record that the size is at the sending store. For a size that has gone missing an instruction is written, the store cannot find the stock, and the receiving store’s set is left half done. “Completed or left alone” only holds if the record is right. And the rule’s snapshot is taken on one morning; by the time the instruction reaches the store, that size may have sold.

The rule says “best seller”, but a store with no L has no L sales. In the next article we open up that question: how many of this size would we sell here?

By Sabri Suyunu