How Birchbox Transformed Its Operations With Mathematical ...

44
How Birchbox Transformed Its Operations With Mathematical Optimization Thank you for joining us. We will be starting shortly.

Transcript of How Birchbox Transformed Its Operations With Mathematical ...

How Birchbox Transformed Its Operations With Mathematical Optimization

Thank you for joining us. We will be starting shortly.

Todayโ€™s Speakers

Copyright ยฉ Princeton Consultants 2020 (V3.3)2

Rob Randall, PhD

Senior Optimization Specialist

Princeton Consultants

Irv Lustig, PhD

Optimization Principal

Princeton Consultants

David Bendes

VP, Global Business Technology

Birchbox

How Birchbox Transformed Its Operations With Mathematical Optimization

Irv Lustig, PhD, Optimization Principal at Princeton Consultants

Rob Randall, PhD, Senior Optimization Specialist at Princeton Consultants

Information Technology & Management Consulting

Advanced Analytics StrategyProcess ImprovementApplication Development

Princeton New Jersey New York City

โ–ชStability: Founded in 1981; over 1800 successful completed projects for many industry leaders and fast-growing innovators.

โ–ชRepresentative Clients: 2020 US Census, US Tennis Association, NBCUniversal, Wells Fargo, NetJets, The Wall Street Journal, Schneider.

โ–ชAnalytics-focused Professional Staff: 65 full-time consultants, 2/3rds with graduate STEM degrees; plus network of top independent consultants and university professors. 50+ experienced data scientists/developers.

โ–ชExperience: Senior Staff (top 28 consultants) average 15+ years experience; Firm Leadership (6 Directors) average 20+ years experience.

Optimization into Production

About Princeton Consultants (www.princeton.com)

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 4

Irv Lustig, PhD, Optimization Principal

Patricia Randall, PhD, Director

Robert Randall, PhD, Senior Optimization Specialist

Formulation Matters: Reciprocating Integer Programmingfor Birchbox Product Assortment

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 5

Birchbox

โ€บ Birchbox is an online monthly subscription service that sends its customers a box of beauty product samples each month

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 6

Launched in

2010

Operates in 3 countries, with

over 2.5 million active

customers

Samples tailored to each

subscriberโ€™s needs and

preferences

500+ best-in-class prestige

brand partners with products

including skincare items,

perfumes, and other cosmetics

The Competitive Edge

โ€บ A subscription box serviceโ€™s operational success is powered by its โ€œblack boxโ€ โ€“ grouping subscribers into clusters and creating configurations of available products for each subscriber cluster

Optimal box creation

Product and

vendor attributes

Subscriber history and

activity

Subscriber profiles

โ–ช Birchbox uses a mixed integer programming (MIP) model with Gurobi to optimize this process by using their proprietary objectives and constraints

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 7

Problems with the Initial Model

โ€บ The product grouping and box creation MIP worked for several years but as the customer base grew and offerings expanded, the run time increased to multiple days

โ€“ Operations was up against production deadlines every month and forced to monitor the run closely over the course of days

โ€“ Alternative business models could not be tested

โ€“ New improvements to the box experience could not be adequately handled by the existing model

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 8

Engagement History

โ€บ Birchbox contacted Princeton due to performance issues with their existing MIP model that used Gurobi

โ€บ Princeton Offer:โ€“ Advanced Analytics Model Review & Validation Service

โ€บ Benefitsโ€“ Validate and improve optimization and predictive models with an expert third party review

โ€บ Uncover new ideas for improvement

โ€บ Benchmark your models and group against best practices

โ€บ Give business leaders more confidence in your solutions

โ€บ Help your specialists improve their development skills

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 9

Simplified Problem Description

โ€บ 100 Different Productsโ€“ Each product has different attributes

โ€บ Weight, Volume, Value, etc.

โ€“ There is a maximum inventory of each product

โ€“ There is a desired minimum number of subscribers to send each product toโ€บ Often zero

โ€บ 2000 to 5000 โ€œSubscribersโ€โ€“ Depends on number of clusters from machine learning

โ€“ For each subscriber/product combination, define โ€œeligibilityโ€:โ€บ A subscriber can receive the product

โ€บ A subscriber must receive the product

โ€บ A subscriber must not receive the product

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 10

Goal 1: Create Box Configurations

โ€บ A Configuration is a group of products

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 11

โšซ Configurations satisfy constraints on the attributesโ€“ Range on number of products included

โšซ E.g., at least 5, no more than 7

โ€“ Maximum weight, volume

โ€“ Ranges on other attributes

โ€“ Etc.

Goal 2: Assign Box Configurations to Subscribers

โ€บ Each configuration must be sent to a minimum number of subscribers and to at most a maximum number of subscribers

โ€บ Every subscriber must be assigned a configuration

โ€“ Identify quickly if this is not possible due to eligibility or lack of inventory

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 12

Configuration Goals

โ€บ Use a small number of configurations

โ€“ Typically below 100.

โ€“ For grooming products, could be as low as 30

โ€บ Respect product maximum inventory used

โ€บ Some subscribers must receive certain products.

โ€บ Some subscribers must not receive certain products.

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 13

Notation

โ€บ ๐’ซ is the set of products โ€ข๐’ฎ is the set of subscribers โ€ขโ„ฌ is the set of box configurations

โ€บ ๐’œ is the set of attributes that exist for all products

โ€“ ๐œ‡๐‘Ž๐‘ is the value of attribute ๐‘Ž for product ๐‘

โ€บ เท๐’ฎ๐‘ โŠ† ๐’ฎ are subscribers that must receive product ๐‘

โ€“ เท๐’ซ๐‘  โŠ‚ ๐’ซ are the products that subscriber ๐‘  must receive.

โ€บ ๐’ฎ๐‘ โŠ‚ ๐’ฎ are subscribers that must not receive product ๐‘

โ€“ ๐’ซ๐‘  โŠ‚ ๐’ซ are the products that subscriber ๐‘  must not receive.

Property Scope Minimum Maximum

Number of subscribers per box Global across boxes ๐œŽโ„“ ๐œŽ๐‘ข

Number of Different Box Configurations Global ๐œโ„“ ๐œ๐‘ข

Number of products per box Global ๐›พโ„“ ๐›พ๐‘ข

Total Product Quantity Across subscribers

Per product ๐‘ โˆˆ ๐’ซ ๐œ™๐‘โ„“(soft) ๐œ™๐‘

๐‘ข

Total Attribute Value For all boxes, per attribute ๐‘Ž โˆˆ ๐’œ ๐›ผ๐‘Žโ„“ ๐›ผ๐‘Ž

๐‘ข

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 14

Initial MIP Formulation: Variables

๐’š๐’ƒ: (binary) Is box ๐’ƒ used?๐’๐’ƒ: Number of times box ๐’ƒ is used

(number of subscribers assigned)

๐’˜๐’”๐’ƒ: (binary) Is subscriber ๐’” assigned to box ๐’ƒ?

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

๐’™๐’‘๐’ƒ: (binary) Is product ๐’‘ in box ๐’ƒ?

๐’’๐’‘๐’ƒ: Number of times product ๐’‘ is in box

๐’ƒ

๐’›๐’‘: Error for not satisfying minimum

product quantity

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 15

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

Initial MIP Formulation: Box/Product Logical Constraints

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข๐‘ฅ๐‘๐‘

๐‘ง๐‘ โ‰ค ๐œ™๐‘๐‘ข

Number of products in box controlled by whether product is in boxError limited by maximum

๐‘›๐‘ โ‰ค ๐œŽ๐‘ข๐‘ฆ๐‘๐‘›๐‘ โ‰ฅ ๐œŽโ„“๐‘ฆ๐‘

Number of products in box controlled by whether box is used and controlled by minimum and maximum subscribers per box (for each box)

๐‘ฅ๐‘๐‘ โ‰ค ๐‘ฆ๐‘๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘

๐‘ข๐‘ฆ๐‘

๐‘ž๐‘๐‘ โ‰ฅ ๐‘›๐‘ โˆ’๐‘€(1 โˆ’ ๐‘ฅ๐‘๐‘)

๐‘ž๐‘๐‘ โ‰ค ๐‘›๐‘

Product in box if box is used

Number of products in box is equal to number of subscribers if the product is in the box

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 16

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

Initial MIP Formulation: Box/Product Quantity Constraints

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 17

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ + ๐‘ง๐‘ โ‰ฅ ๐œ™๐‘โ„“

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข

For each product, across boxes, total product used is limited by minimums and maximums

Enforces maximum number of box configurations

๐‘โˆˆโ„ฌ

๐‘ฆ๐‘ โ‰ฅ ๐œโ„“Must build a minimum number of box configurations

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘›๐‘

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘›๐‘

For each box, total product used must correspond to minimums and maximums per box

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

Initial MIP Formulation: Subscriber Constraints

For each product and box, force certain subscribers to be assigned

๐‘ โˆˆเท๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | เท๐’ฎ๐‘ |๐‘ฅ๐‘๐‘

๐‘ โˆˆ๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | ๐’ฎ๐‘ |(1 โˆ’ ๐‘ฅ๐‘๐‘)For each product and box, force certain subscribers to not be assigned

Count the number of subscribers assigned for each box

๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ = ๐‘›๐‘

๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘ โ‰ค 1 Limit each subscriber to be assigned to one box

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 18

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

Initial MIP Formulation: Box Composition Constraints

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 19

๐›ผ๐‘Žโ„“ โ‰ค

๐‘โˆˆ๐’ซ

๐œ‡๐‘Ž๐‘ ๐‘ฅ๐‘๐‘ โ‰ค ๐›ผ๐‘Ž๐‘ข Attribute Constraints

Min/Max Different Products per Box

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘ฆ๐‘

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘ฆ๐‘

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

Initial MIP Formulation: Objective Function

๐‘โˆˆโ„ฌ

๐‘โˆˆ๐’ซ

1

3600โ‹… ๐‘ฅ๐‘๐‘

โˆ’

๐‘โˆˆ๐’ซ

2

(๐œ™๐‘๐‘ข + 1)

โ‹… ๐‘ง๐‘

โ€œGenerosityโ€ โ€“ More products are better

Error in reaching desired minimum product quantities

+1

2

๐‘โˆˆโ„ฌ

๐‘›๐‘Total number of boxes built

Number of Subscribers Assigned to a box

+1

2

๐‘ โˆˆ๐’ฎ,๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘

MAXIMIZE

๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ = ๐‘›๐‘ ,Note: Because

1

2

๐‘โˆˆโ„ฌ

๐‘›๐‘ +1

2

๐‘ โˆˆ๐’ฎ,๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘ =

๐‘ โˆˆ๐’ฎ,๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 20

Initial Formulation: Issues

โ€บ Gurobi 8.0

โ€บ Solve Times ranged from minutes for easy problems to multiple days for most problems

โ€“ Using 30 cores of 8 processor/4 cores per processor, AMD Opteron 6328, 3.2Ghz, 2MB cache

โ€บ Small changes in the input data caused huge variance in performance

โ€“ E.g. just changing ๐›พ๐‘ข (maximum number of products per box) significantly increased solve times.

โ€บ Blended Objectivesโ€“ Get every subscriber a box

โ€“ Try to meet product minimums

โ€บ Symmetryโ€“ No differentiation between ๐‘ฅ๐‘๐‘1 and ๐‘ฅ๐‘๐‘2 for two different box numbers ๐‘1and ๐‘2

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 21

Solution: Pattern Generation for Each Subscriber

๐›ผ๐‘Žโ„“ โ‰ค

๐‘โˆˆ๐’ซ

๐œ‡๐‘Ž๐‘ ๐‘ฅ๐‘๐‘ โ‰ค ๐›ผ๐‘Ž๐‘ข Attribute Constraints

Min/Max Different Products per Box

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘ฆ๐‘

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘ฆ๐‘

For each product and box, force certain subscribers to be assigned

๐‘ โˆˆเท๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | เท๐’ฎ๐‘ |๐‘ฅ๐‘๐‘

๐‘ โˆˆ๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | ๐’ฎ๐‘ |(1 โˆ’ ๐‘ฅ๐‘๐‘)For each product and box, force certain subscribers to not be assigned

๐’™๐’‘

๐’ซ (80)

๐‘ฅ๐‘ = 1 โˆ€๐‘ โˆˆ ๐’ซ๐‘ ๐‘ฅ๐‘ = 0 โˆ€๐‘ โˆˆ ๐’ซ๐‘ 

๐›ผ๐‘Žโ„“ โ‰ค

๐‘โˆˆ๐’ซ

๐œ‡๐‘Ž๐‘ ๐‘ฅ๐‘ โ‰ค ๐›ผ๐‘Ž๐‘ข

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘ โ‰ค ๐›พ๐‘ข

๐‘โˆˆ๐’ซ

๐‘ฅ๐‘ โ‰ฅ ๐›พโ„“

๐’”

Feasible New box ๐’ƒ: ๐‘ฅ๐‘๐‘ ๐’ซ๐‘ = {๐‘ โˆˆ ๐’ซ: ๐‘ฅ๐‘

๐‘= 1}

๐‘โˆˆ แช„๐’ซ๐‘

แช„๐‘ฅ๐‘ โˆ’

๐‘โˆ‰ แช„๐’ซ๐‘

แช„๐‘ฅ๐‘ โ‰ค | แช„๐’ซ๐‘| โˆ’ 1

Prevent Pattern Regeneration

Maximize

๐‘โˆˆ๐’ซ

แช„๐œ‹๐‘ แช„๐‘ฅ๐‘

( แช„๐œ‹๐‘ are โ€œdualsโ€)

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 22

Original MIP Problem: Variables

๐’™๐’‘๐’ƒ: Is product ๐’‘ in box ๐’ƒ?

๐’’๐’‘๐’ƒ: Number of times product ๐’‘ is in box

๐’ƒ, only if product in the box

๐’š๐’ƒ: Is box ๐’ƒ used?๐’๐’ƒ: Number of times box ๐’ƒ is used

(number of subscribers assigned)

๐’˜๐’”๐’ƒ: Is subscriber ๐’” assigned to box ๐’ƒ?

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’™๐’‘๐’ƒ, ๐’’๐’‘๐’ƒ๐’ซ(80)

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} (100)

๐’š๐’ƒ๐’๐’ƒ

โ€ฆ

โ€ฆ

โ€ฆ โ€ฆ๐’˜๐’”๐’ƒ๐’ฎ(5000)

๐’›๐’‘

๐’›๐’‘: Error for not satisfying minimum

product quantity

X X X X

X X X

X X X X X X

X X X

X

X X X X X X X

X X

X X

X X X X X

X X X X

X X X

X X

X X X X X X X

X X X X

X X

X X

X X

X X X X

X X X X

X X

X X X

X X X X X

X X

X X X X X

X X X

X X

X X X X

X X X X

X X X X X X

X X

X X X X X

X X X X

X X X X X X X

X X X X

X X X X

X X X

X X X X X X X

X X X X X X X

X X X X X X X

X X X

X X X X X X X X

X X X X X X

X X X X X

X X X X X X

X X X X X X X X

X X X X X X X X

X X X X X X X

X X X X X X

X X X X X X

X X X X X

X X X X X X X

X X X X X X X X

X X X X X X X

X X X X X X

X X X X X

X X X X X X X

X X X X X X X X X X X

X X X X X X

X X X X X

X X X X X

X X X X

X X X X

X X X X X

X X X X X X X

X X X X X X X X X X X X

X X X X X X X X X X

X X X X X X

X X X X X X X X X X

X X X X X X

X X X X X X X

X X X X X

X X X X X X

X X X X

X X X X X

X X X X X X X X

X X X X X X

X X X X X X X X

X X X X X X X

X X X X X X X X

X X X X X X X

X X X X X X

X X X X X X X X

X X X X X X X

X X X X

X X X X X

X X X X

X X X X X X

X X X X X

X X X X X X X

X X X X

X X X X X X X

X X

(Only if subscriber ๐’” is eligible for box ๐’ƒ)

Master

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 23

Master MIP Problem: Box/Product Logical Constraints

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข๐‘ฅ๐‘๐‘

๐‘ง๐‘ โ‰ค ๐œ™๐‘๐‘ข

Number of products in box controlled by whether product is in boxError limited by maximum

๐‘ง๐‘ โ‰ค ๐œ™๐‘๐‘ข

Error limited by maximum

๐‘ฅ๐‘๐‘ โ‰ค ๐‘ฆ๐‘๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘

๐‘ข๐‘ฆ๐‘

๐‘ž๐‘๐‘ โ‰ฅ ๐‘›๐‘ โˆ’๐‘€(1 โˆ’ ๐‘ฅ๐‘๐‘)

๐‘ž๐‘๐‘ โ‰ค ๐‘›๐‘

Product in box if box is used

Number of products in box is equal to number of subscribers if the product is in the box

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข๐‘ฆ๐‘

๐‘ž๐‘๐‘ = ๐‘›๐‘

Product in box if box is used

Number of products in box is equal to number of subscribers assigned to the box

๐‘›๐‘ โ‰ค ๐œŽ๐‘ข๐‘ฆ๐‘๐‘›๐‘ โ‰ฅ ๐œŽโ„“๐‘ฆ๐‘

Number of products in box controlled by whether box is used and controlled by minimum and maximum subscribers per box (for each box)

๐‘›๐‘ โ‰ค ๐œŽ๐‘ข๐‘ฆ๐‘๐‘›๐‘ โ‰ฅ ๐œŽโ„“๐‘ฆ๐‘

Number of products in box controlled by whether box is used and controlled by minimum and maximum subscribers per box (for each box)

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 24

Master MIP Problem: Box/Product Quantity Constraints

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ + ๐‘ง๐‘ โ‰ฅ ๐œ™๐‘โ„“

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข

For each product, across boxes, total product used is limited by minimums and maximums

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ + ๐‘ง๐‘ โ‰ฅ ๐œ™๐‘โ„“

๐‘โˆˆโ„ฌ

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข

For each product, across boxes, total product used is limited by minimums and maximums

๐‘โˆˆโ„ฌ

๐‘ฆ๐‘ โ‰ฅ ๐œโ„“Must build a minimum number of box configurations

๐‘โˆˆโ„ฌ

๐‘ฆ๐‘ โ‰ฅ ๐œโ„“ Must build a minimum number of box configurations

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘›๐‘

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘›๐‘

For each box, total product used must correspond to minimums and maximums per box

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘›๐‘

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘›๐‘

For each box, total product used must correspond to minimums and maximums per box

โ„ฌ = {1,โ€ฆ , ๐œ๐‘ข} Enforces maximum number of box configurations

๐‘โˆˆโ„ฌ

๐‘ฆ๐‘ โ‰ค ๐œ๐’–Must build at most a certain number of box configurations(HARD option)

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 25

Master MIP Problem: Subscriber Constraints

For each product and box, force certain subscribers to be assigned

๐‘ โˆˆเท๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | เท๐’ฎ๐‘ |๐‘ฅ๐‘๐‘

๐‘ โˆˆ๐’ฎ๐‘

๐‘ค๐‘ ๐‘ โ‰ค | ๐’ฎ๐‘ |(1 โˆ’ ๐‘ฅ๐‘๐‘)For each product and box, force certain subscribers to not be assigned

Count the number of subscribers assigned for each box

๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ = ๐‘›๐‘Count the number of subscribers assigned for each box

๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ = ๐‘›๐‘

๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘ โ‰ค 1 Limit each subscriber to be assigned to one box

๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘ โ‰ค 1Limit each subscriber to be assigned to one box

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 26

Master MIP Problem: Hierarchical Objective Function

๐‘โˆˆโ„ฌ

๐‘โˆˆ๐’ซ

1

3600โ‹… ๐‘ฅ๐‘๐‘

โˆ’

๐‘โˆˆ๐’ซ

2

(๐œ™๐‘๐‘ข + 1)

โ‹… ๐‘ง๐‘

โ€œGenerosityโ€ โ€“ More products are better

Error in reaching desired minimum product quantities

+1

2

๐‘โˆˆโ„ฌ

๐‘›๐‘Total number of boxes built

MAXIMIZE

Number of Subscribers Assigned to a box

+1

2

๐‘ โˆˆ๐’ฎ,๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘

Number of Subscribers Assigned to a box

๐‘ โˆˆ๐’ฎ,๐‘โˆˆโ„ฌ

๐‘ค๐‘ ๐‘

MAXIMIZE

๐‘โˆˆโ„ฌ

๐‘ฆ๐‘Number of boxes used (Target is ๐‰๐’–)(SOFT Option)

MINIMIZE

๐‘โˆˆ๐’ซ

1

(๐œ™๐‘๐‘ข + 1)

โ‹… ๐‘ง๐‘Error in reaching desired minimum product quantities

MINIMIZE

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 27

New Formulation

โ€บ Full Master Problem has all possible patternsโ€“ Is probably very large!

โ€บ Address via โ€œcolumn generationโ€ techniquesโ€“ Generate patterns as needed

โ€“ Form a Restricted Master Problem (RMP)

โ€บ Not true column generationโ€“ Adding new variables and new constraints

โ€บ Not โ€œBranch-and-priceโ€โ€“ Could be considered โ€œPrice-and-branchโ€

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 28

Column and Constraint Generation

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 29

๐‘ž๐‘๐‘ โ‰ค ๐œ™๐‘๐‘ข๐‘ฆ๐‘

๐‘ž๐‘๐‘ = ๐‘›๐‘

Product in box if box is used

Number of products in box is equal to number of subscribers assigned to the box

๐‘›๐‘ โ‰ค ๐œŽ๐‘ข๐‘ฆ๐‘๐‘›๐‘ โ‰ฅ ๐œŽโ„“๐‘ฆ๐‘

Number of products in box controlled by whether box is used and controlled by minimum and maximum subscribers per box (for each box)

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ฅ ๐›พโ„“๐‘›๐‘

๐‘โˆˆ๐’ซ

๐‘ž๐‘๐‘ โ‰ค ๐›พ๐‘ข๐‘›๐‘

For each box, total product used must correspond to minimums and maximums per box

Count the number of subscribers assigned for each box

๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ = ๐‘›๐‘

โ€บ Each new pattern ๐’ƒ adds constraints

๐’š๐’ƒ: (binary) Is box ๐’ƒ used?๐’๐’ƒ: Number of times box ๐’ƒ is used (number of subscribers assigned)

๐’˜๐’”๐’ƒ: (binary) Is subscriber ๐’” assigned to box ๐’ƒ? (for each eligible subscriber)

๐’’๐’‘๐’ƒ: Number of times product ๐’‘ is in box ๐’ƒ for each product

โ€บ Each new pattern ๐’ƒ adds variables

Reciprocating Integer Programming (RIP)

โ€บ Two MIPsโ€“ Communicate by โ€œreciprocatingโ€ information

โ€บ Pattern Generation: Solve a MIP!!!โ€“ Bootstrap

โ€บ Generate a lot of patterns, enough for each subscriber, preferring products with lots of inventory

โ€“ Generate New Patterns

โ€บ RMP: First solve an LP, then solve a MIP!โ€“ Get all subscribers a box with the first objective (maximize number of assigned subscribers)

โ€“ Then move to MIP

โ€บ RMP generates โ€œDualsโ€ for objective of subproblemโ€“ Even when the RMP is a MIP!

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 30

Patte

rns

โ€œDualsโ€

Restricted Master Problem (RMP)

MIP Pattern Generation Subproblem

RIP Step 1: Bootstrap

โ€บ Solve the Pattern Generation MIPโ€“ Just generate feasible solutions

โ€บ Generate enough patterns for each subscriber

โ€บ Make sure each product has enough patterns

โ€บ Dynamically adjust objective functionโ€“ Initially, แช„๐œ‹๐‘ = ๐œ™๐‘

๐‘ข . Choose products with the most inventory

โ€“ Dynamically adjust to incent products to be used at same rateโ€บ ProdCnt[๐‘] is number of patterns containing product ๐‘

แช„๐œ‹๐‘ =๐œ™๐‘๐‘ขmax

เทœ๐‘โˆˆ๐’ซProdCnt[ ฦธ๐‘]

1 + ProdCnt[๐‘]

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 31

RIP Step 2: Relax

โ€บ Based on the Sifting Method: Dynamically add patterns to build up the RMPโ€“ Bixby, Gregory, Lustig, Marsten, Shanno (1992)

โ€บ Solve LP relaxation of RMPโ€“ Use Gurobiโ€™s deterministic concurrent optimization

โ€บ Can use basis from previous solve to start

โ€บ Remove nonbasic variables and associated patterns with negative reduced costs

โ€บ Add duals from specific constraints to compute เทœ๐œ‹๐‘

โ€บ Use เทœ๐œ‹๐‘ to add back previously deleted patterns

โ€บ Adjust objective function for subproblem (๐‘ฃ๐‘ is unused inventory)

แช„๐œ‹๐‘ =

1

2min

๐‘โˆˆ๐’ซ:เท๐œ‹๐‘>0เทœ๐œ‹๐‘

๐‘ฃ๐‘

1 +max๐‘โˆˆ๐’ซ

๐‘ฃ๐‘โˆ’ 1 if เทœ๐œ‹๐‘ = 0

โˆ’เทœ๐œ‹๐‘ if เทœ๐œ‹๐‘ > 0

โ€บ Stop when RMP master problem objective is equal to the number of subscribers

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 32

RIP Step 3: Populate

โ€บ Create the MIP version of RMPโ€“ Do not include all variables from the LP relaxation!

โ€บ Choose all patterns included in the LP relaxation solution basis or patterns that are assigned (even fractionally) to a subscriber

โ€บ For each pattern, ensure sufficient subscribers per patternโ€“ Do not include all eligible subscribers for each pattern

โ€บ For each product with positive values of ๐œ™๐‘โ„“, ensure that there are enough

patterns (and associated subscribers) that include that product

โ€บ For each subscriber, ensure sufficient patterns per subscribersโ€“ Do not include all eligible patterns for each subscriber

โ€บ Overriding goal โ€“ try to not make the MIP have too many variables (less than 300,000 worked well)

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 33

RIP Step 4: Subscribe

โ€บ Solve the MIP form of the RMP

โ€บ Stop if

โ€“ Upper bound is proven to be smaller than the number of subscribers

โ€“ Solution found equal to the number of subscribers (Proof of optimality not required!)

โ€“ Gurobi hits a small node limit

โ€บ If adequate solution not found, add back all deleted patterns

โ€“ Solve MIP form of the RMP again

โ€บ If adequate solution still not found, generate new patterns using surrogate dual values

แช„๐œ‹๐‘ =1

๐‘ฃ๐‘+1

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 34

โšซ Boxes Step: First Add Constraint:โ€“ Enforce every subscriber gets a box

๐‘โˆˆ แช„โ„ฌ,๐‘ โˆˆ๐’ฎ

๐‘ค๐‘ ๐‘ โ‰ฅ |๐’ฎ|

RIP Steps 5 and 6: Boxes and Product

HARD OPTION

โ€บ Skip to Product Step

SOFT OPTION

โ€บ Minimize Number of Boxes

โ€บ Stop when objective at or below ๐œ๐‘ข

โ€บ Add Constraint

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 35

๐‘โˆˆ แช„โ„ฌ

๐‘ฆ๐‘

๐‘โˆˆ แช„โ„ฌ

๐‘ฆ๐‘ โ‰ค ๐œ๐‘ข

โšซ Product Step:โ€“ Minimize (violation of product minimums)

โ€“ Stop if

โšซ Optimal

โšซ User terminates (provide values of intermediate solutions to allow abort)

โšซ After 100 nodes of branching

๐‘โˆˆ๐’ซ

1

(๐œ™๐‘โ„“ + 1)

๐‘ง๐‘

Parallel MIP

โ€บ Two Options

โ€“ Use all processors on one MIP of restricted master problem

โ€“ Use Gurobi Concurrent Optimization

โ€บ Set a random seed for each parallel run

โ€บ Can help the Gurobi heuristics find feasible solutions faster

โ€บ Computational Results using Birchbox hardware:

โ€“ 24 cores of 8 processor/4 cores per processor, AMD Opteron 6328, 3.2Ghz, 2MB cache

โ€“ Concurrent Optimization for MIP: 6 parallel solves, 4 threads each

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 36

Computational Results (Gurobi 9.0)

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 37

Wall Clock Times in HH:MM:SSConcurrent MIP

Default MIP

Hard or Soft Fastest Concurrent or Default Fastest

Lessons Learned: FORMULATION MATTERS!!!

โ€บ Solvers have gotten faster but the business problems have gotten bigger and harder and expectations can be unrealistic

โ€บ Even with the tremendous performance improvements we have seen in solvers in the last several years, a poor formulation can still doom a model and the determination of whether MIP is appropriate

โ€บ It is easy to formulate a model; it can be very difficult to formulate it so that it can

โ€“ Handle the scale and complexities of business operations

โ€“ Provide that solution in the required timeframe

โ€“ Provide robust performance for varying data sets

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 38

Lessons Learned: Proof of optimality may not be critical

โ€บ It is important to understand the objectives in the context of the business problem to determine whether a โ€œgoodโ€ solution is good enough

โ€บ When there are multiple objectives, understand which ones align with feasibility and which ones measure the quality of the solution

โ€บ In our problem, two of the three objectives were indicating whether the problem could meet basic solution requirements, and this was critical to know as soon as possible

โ€บ The third objective measured the quality of one solution vs. another and was only important once feasibility was determined

7/28/2020 COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3) 39

Lessons Learned: Miscellaneous

โ€บ Curate a representative data set for continual testing

โ€“ Tweaks to the model can help performance for some data sets and hurt it for others so you need to compare against the baseline for multiple data sets before declaring success

โ€บ Donโ€™t be afraid to challenge the status quo when it comes to the business problem

โ€“ Sometimes the Business subject matter experts can get used to equating the model to the business constraints. An outside resource can help push the team to consider new angles and think outside the (Birch)box.

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 40

Lessons Learned: Leverage the Power of Gurobi MIP

โ€บ In many column generation schemes, people build heuristics to generate new columns/patterns

โ€บ MIP can do often this just as well

โ€บ Use various features of Gurobi

โ€“ Concurrent MIP Optimization

โ€“ Stopping criteria

โ€บ Objective target

โ€บ Best bound

โ€“ Concurrent LP Optimization at the root

โ€บ Barrier is often the winner at the root!

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 41

โ€œLife-Alteringโ€ Improvements

โ€œThe increase in speed and flexibility from the new model impacts every piece of our business across multiple teams. Now we can strategically invest that time in everything from building more personal customer experiences to optimizing our production process. With this new model, Birchbox has truly entered a new operating

universe.โ€

David BendesVice President of Global Business Technology at Birchbox

COPYRIGHT ยฉ PRINCETON CONSULTANTS 2020 (V3.3)7/28/2020 42

Thank You โ€“ Questions?

Your Next Steps

โ€ข Try Gurobi 9.0 Now!

โ€ข Get a 30-day commercial trial license of Gurobi at www.gurobi.com/free-trial

โ€ข Academic and research licenses are free!

โ€ข For questions about Gurobi pricing, please contact [email protected] or [email protected]

โ€ข A recording of this webinar, including the slides, will be available in roughly one week.

Copyright ยฉ Princeton Consultants 2020 (V3.3)44