!  Assortment planning with customers  (AssortPlan.lng)
 who have a strict preference ordering.
 Each market segment s has a preference ordering
 RP(s,p), for buying product type p. The base
 "product" of buying nothing has a preference 0.
  A market segment will buy that product, of those
 offered, that has the highest preference.
 It costs money to introduce lots of products, so
 given consumer preferences, product profitability,
 and cost of carrying each product, 
 which set of products should the vendor offer? 
 Each segment s has a size, NUM(s), which is the 
 total unit sales to that segment.
 Specifically, if the vendor carries only product p,
 then the unit sales to segment s will be
    NUM(s), assuming RP(s,p) > 0;
! Keywords:  Consumer Choice, Preference ordering,
    Marketing, Demand Substitution, Assortment Planning;
SETS:
  SEG: NUM, Z;            ! Market segments;
  PROD: PC, FXC, Y, VOL;  ! Products possible;
  SXP( SEG, PROD): RP, PR;! Combinations;
  ENDSETS
DATA: SEG = 1..7; ! The market segments; ! and their sizes; NUM = 19 13 24 39 11 12 14; PROD = 1..6; ! The products; ! Profit contribution per unit each product; PC = 16 16 13 18 14 19; ! Fixed cost of introducing each product; FXC = 100 120 80 115 110 165; ! Relative preference of customer segment s for product p. Bigger => more preferred 0 => would not buy the product; RP = 5 3 4 2 6 1 ! Segment 1; 0 0 3 4 1 2 1 3 4 0 0 2 0 1 2 0 3 0 0 1 2 5 3 4 4 0 1 0 2 3 5 6 3 2 4 1;! Segment 7; NPT = 3; ! We want to carry at most three products; ENDDATA ! Parameters: NUM(s) = number people in segment s, PC(p) = profit contribution per unit of product p sold, FXC(p) = fixed cost of introducing product p, RP(s,p) = relative attractiveness to segment s of product p, higher => more preferred. NPT = number products that can be carried. Variables: Y(p) = 1 if we carry product p, else 0, VOL(p) = volume, or units, sold of product p, PR(s,p) = proportion (0 or 1 in this case) of customers from segment s who will buy product p, given the set of products available; ! Maximize profit contribution from sales minus fixed cost of introducing the products; MAX = @SUM( PROD(p): PC(p)*VOL(p) - FXC(p)*Y(p)); ! Y(p) = 1 if we introduce product p, else 0; @FOR( PROD(p): @BIN(Y(p))); ! Set PR(s,p) = 0 if segment s does not buy product p. Compute portion/probability of/that segment s buys product p. Cannot buy it if not introduced; @FOR( SXP(s,p): ! If s buys product p, then p must be offered; PR(s,p) <= Y(p); ! Will not buy p if s prefers nothing better; PR(s,p) <= ( RP(s,p) #GT# 0); ! Will not buy p if some more preferred product q is offered; @FOR( PROD( q) | RP(s,q) #GT# RP(s,p): PR(s,p) + Y(q) <= 1; ); ); ! Volume sold of product p; @FOR( PROD(p): VOL(p) = @SUM( SEG(i): NUM(i)*PR(i,p)); ); ! Limit on products carried; @SUM( PROD(p): Y(p)) <= NPT;