An application of shortest path algorithm: optimal assortments for network goods with vertical differentiation

. This paper presents an e ﬃ cient algorithm based on the shortest path algorithm for a directed weighted graph where all arc cots depend on which node is thought of as the source node. This approach can be applied well to the optimal assortment problem for a network good industry with vertical di ﬀ erentiation. The assortment problem was introduced for decision-makers to select what products to be produced or stocked from a large product category when it is not desirable to stock all of them. A network good is a good with network e ﬀ ect — the e ﬀ ect that the consumption of a good by one has an impact on the value of that product to others. Vertical di ﬀ erentiation occurs when the several goods can be ordered according to their objective quality in the sense that a high-quality good is “better” than the low-quality one. It is shown that an optimal assortment plan can be identiﬁed in a polynomial time by our algorithms. The theoretical results also provide qualitative managerial insights into the optimal assortment plan for decision-makers.


Introduction
The shortest path problem, in graph theory, involves finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent arcs is minimized. The most important algorithms for solving this problem are summarized in [1]. Shortest path algorithms are widely applied in practices, such as finding driving directions on web mapping websites like Google Maps, finding the minimal delay path in telecommunication networks, etc. This paper applies a shortest path algorithm to the optimal assortment problem for a network good industry with vertical differentiation. A network good is a good with network effect-the effect that the consumption of a good by one has an impact on the value of that product to others. Vertical differentiation occurs when the several goods can be ordered according to their objective quality. All else equal, customers prefer a product with a higher quality level to a product with a lower quality level, but they hold inherently heterogeneous valuations for product quality. When facing multiple choices, different customers would purchase a product with a different quality to maximize their own utilities. Note that, with network effect, consumers benefit from not only the product they purchased but also the user base induced by all products offered. Consider a product category with hundreds, possibly thousands, of products with network effect. A seller (or a decision maker) has to choose what products to carry from the product category to maximize his total profit, which is called the assortment problem. This kind of problem was first studied by [2]. Different from their work, this pae-mail: yinbofeng13@fudan.edu.cn per incorporates the network effect into analysis. For the ease of notation, most of the mathematical symbols are the same as in [2].
This assortment problem can be modeled as a shortest path problem in a graph. Unlike classic shortest path problem in which all arc costs are priorly given, in the graph modeled by this paper, all arc costs depend on which node is thought of as the source node. Therefore, a modified approach based on the shortest path algorithm has been developed to solve this problem and to further investigate how network effects influence the assortment decision.

Model formulation
Consider a single-period product market operated by a monopolist (seller). The seller has a set of feasible products with vertically differentiation, labeled by {1, 2, . . . , n}. Let q i , p i , and c i respectively denotes the quality, the price, and the production cost of product i, 1 ≤ i ≤ n. Without loss of generality, it is assumed that 0 < q 1 < q 2 < · · · < q n and 0 < c 1 < c 2 < · · · < c n , that is, these products can be ordered according to their objective quality from the lowest to the highest and the production cost for a low quality product is low. The seller has to choose what products to carry from this product category.
The utility for a customer who purchases the product i is assumed to be where θ measures the customer's willingness to pay for one unit of quality, and Q is the size of the product i's network. The first two terms represents the stand-alone valuation, which is the customer's intrinsic valuation of the product. The third term s(·), an concavely increasing function with s(0) = 0, represents the network benefit. Assume all products offered share the same network and hence Q is simply the seller's total unit sales. This paper adopts an additive form of the two kind of utilities. One can check that the algorithms and results in this paper can also carry over to the case with a multiplicative form. Given an assortment S = { j 1 , . . . , j m }, a subset of {1, . . . , n}, each customer who is interested in buying at most one product will select the product with the highest utility or select nothing with zero utility. In this paper, it is assumed that the seller cannot identify the specific θ value for each customer but knows the distribution of θ. Let f Q (θ) and F Q (θ) with support [θ, θ] denote the probability density function and cumulative density function of θ, where 0 ≤ θ ≤ θ ≤ ∞. The subscript Q in f Q (·) and F Q (·) means they may depend on the network size Q.
Given an assortment S and customers' belief Q, the probability that a random customer purchases the product j ∈ S can be characterized as This paper adopts the Fulfilled Expectations Equilibrium [3] as our solution concept. That is, facing a set of products offered, rational consumers form an identical expectation regarding the ultimate network size, Q, based on which customers make purchase decisions. A fulfilled expectations equilibrium requires that the realized network size is the same as consumers' prior expectation. The total market size is normalized to be 1 and hence we must have Let Q * (S ) denote the equilibrium, which is definitely a function of S , or the largest equilibrium if it has multiple equilibria. The largest equilibria is known as a Pareto Equilibrium [4]. Thus the ultimate purchase probability for product j ∈ S can be written as The expected profit for the seller is as follows: where |S | denotes the number of products in S , and K > 0 denotes the fixed cost for each product offered, including the costs of producing, stocking, and advertising a product. If prices are priorly given, the seller's problem is find an optimal assortment S * to maximize If prices are not priorly given, the seller's problem is to find S * and corresponding prices p * (S * ) to maximize

Analysis and algorithms
This section developed two algorithms to efficiently solve the problems defined in Section 2. One algorithm is designed to solve the optimal assortment problem with exogenous prices which are determined by the market environment and the seller cannot alter them by himself; and the other aims at solving the optimal assortment problem with endogenous prices which can be decided by the seller.

Exogenous pricing
This subsection studies the optimal assortment problem with exogenous prices. One can enumerate all possible assortments then identify the optimal one. However, the complexity of this naive enumeration method is O(2 n ). Consequently, this subsection develops an efficient algorithm to obtain the optimal solution. The following lemma shows some important properties of the optimal assortment which are useful to design the algorithm. In what follows, we write Lemma 1 In an optimal assortment S * = { j 1 , . . . , j m } such that j 1 < j 2 < · · · < j m , the following properties must hold: where p j 0 , q j 0 , p j m+1 , and q j m+1 are respectively defined as s(Q * ),0,+∞, and q m + 1.
All proofs are relegated to the appendix. We can see from Lemma 1 that, in the optimal assortment, the prices, price minus network benefit-quality ratios are strictly increasing in the quality level. The condition (3) guarantees that all products in S * can get a positive purchase probability. By (2) (3) and (7), the network effect helps to increase the total sales volume because a high-attraction product will be chosen to be the first product in the assortment in order to lower the barrier for customers to entry. Equation (6) indicates that the profit margins are increasing in the quality levels. The intuition behind is that offering a high-quality product leads to a higher profit margin than a low-quality product; if not, the seller can increase his profit by removing the high-quality product and inducing those customers who are willing to buy the high-quality product to buy the low-quality one with higher profit margin.
By Equation (7), the seller's problem with exogenous prices can be rewritten as , and constraints (3) are equivalent to constraints (4) and (5). It is noteworthy that the contribution to seller's objective by product j i in an optimal assortment depends on products j 1 , j i−1 , j i+1 and itself. Notice that product j 1 determines Q * (S ) for an assortment S , and the contribution by any other product in S depends on Q * (S ). As a consequence, we are able to model this problem as a shortest path problem if the product with smallest label (the first product) in S * is known. We can construct a graph G = (V, A), where V is the set of nodes and A is the arc set of G. Node set V consists of pairs of products (i, j) such that product j has a higher price, quality, price minus s(Q * )-quality ratio, and profit margin than product i. A node (i, j) means product j could be offered if product i has been offered. To facilitate the elaboration, some fictitious nodes, (0, k) and (k, n + 1) for i = 1, . . . , n+1, are introduced. For product 0 and n+1, p 0 , q 0 , p n+1 , and q n+1 are respectively defined as s(Q * ),0,+∞, and q n + 1. The node (n + 1, n + 1) is the unique terminal node. Arc set A consists of those arcs from (i, j) ∈ V to ( j, k) ∈ V. We cannot directly find the optimal assortment by finding a shortest path in the graph G, because all arc costs depends which node is considered to be the source node. Fortunately, the source node has only n + 1 possibilities, i.e., (0, k), k = 1, 2, . . . , n + 1, where if product n + 1 is chosen as the source node then the seller sells nothing to the market. Hence we can find a shortest path from each possible source node to the terminal node then we will obtain the optimal assortment by comparing the costs of the n + 1 shortest paths. Algorithm 1 represents the procedure of finding an optimal assortment. Theorem 1 Algorithm 1 gives an optimal assortment for the exogenous pricing case. Suppose the complexity of the problem (2) is X, then the complexity of Algorithm 1 is O(nX + n 4 ).

Endogenous pricing
This section presents the model with endogenized prices. The seller needs to choose what products as well as their prices before customers arrive. In this subsection, (the failure rate) is increasing in θ, for any Q ∈ [0, 1]. This assumption is satisfied by most common distributions, for example, uniform, normal, exponential, etc, and is adopted by many studies in the field of operations management [5].
step 2. Construct the arc set A. A = {arc from (k, n + 1) to (n + 1, n + 1), k = 0, 1, . . . , n} ∪ {arc from (i, j) to ( j, k) : 0 ≤ i < j < k ≤ n + 1}. step 3. For h = 1, 2, . . . , n, consider (0, h) as the source node and compute the corresponding network size Then define arc costs: Then solve the shortest path problem from (0, h) to (n + 1, n + 1). Denote the cost of a shortest path by v h . If the minimum is negative, then h * minimizing the problem is the product with smallest label in the assortment. Other products in the assortment can be found according to nodes on the shortest path from (0, h * ) to (n + 1, n + 1). If the minimal value of the above problem is nonnegative then the assortment set is empty.
where Q * is the network size for this assortment. A customer with valuation θ j i gets the same utility from buying product j i and product j i−1 , i = 1, . . . , m, where the product j 0 can be thought of as the no purchase option. Since {p j 1 , . . . , p j m } and {θ j 1 , . . . , θ j m } can be uniquely determined by each other, in what follows, {θ j 1 , . . . , θ j m } can be thought of as the seller's decision variables, given an assortment S . The following lemma presents some properties for the endogenous pricing case when an optimal assortment is given.

Lemma 2
Given an assortment S * = { j 1 , . . . , j m }, the optimal prices for products in S * must satisfy the following properties: In Lemma 2, (9) and (10) illustrate the role of the network effect in pricing the products when an assortment is given. With the network effect, the first product in an optimal assortment is tends to be with a low price to attract more customers with low valuations to join the network and increases the network value of the high-end product, allowing the seller to extract greater surplus. Analogous to Lemma 1, the following lemma provides some properties of the optimal assortment, which are important to develop the algorithm for endogenous pricing case.

Lemma 3
In an optimal assortment S * = { j 1 , . . . , j m } such that j 1 < j 2 < · · · < j m , Q * can de characterized by (9) and the following conditions must hold: Lemma 3 shows that, in the optimal assortment, the production costs, production costs minus s(Q * ) + s (Q * )Q * -quality ratios are strictly increasing in the quality level. The condition (12) guarantees that all products in S * can get a positive purchase probability. Given an optimal assortment S * and corresponding prices, we can find that the prices and profit margins for products in S * must be increasing in the quality due to Lemma 1. By the definition of θ j i s, the seller's problem with endogenous pricing can be rewritten as As analogous as in Section 3.1, we are able to model this problem as a shortest path problem if the product with smallest label (the first product) in S * is determined. The construction of the graph G = (V, A) is similar with that in Section 3.1. Algorithm 2 represents the procedure of finding an optimal assortment. In this algorithm, we set c 0 = s(Q * ) + s Q * and q 0 = 0, where Q * can be computed by (9) if the first product in an assortment is known.
Theorem 2 Algorithm 2 gives an optimal assortment for the endogenous pricing case. Suppose the complexity of the problem (9) is X, then the complexity of Algorithm 2 is O(nX + n 4 ).
step 3. For h = 1, 2, . . . , n, consider (0, h) as the source node and compute the corresponding network size Then define arc costs: where θ k is defined by Equation (11). Then solve the shortest path problem from (0, h) to (n + 1, n + 1). Denote the cost of a shortest path by v h . step 4. Minimize the following problem If the value is negative, then h * minimizing the problem is the product with smallest label in the assortment. Other products in the assortment can be found according to nodes on the shortest path from (0, h * ) to (n + 1, n + 1). If the value of the above problem is nonnegative then the assortment set is empty.

Conclusion
This paper presents a modified shortest path algorithm for a directed weighted graph where all arc cots depend on which node is thought of as the source node, and applies this approach to an optimal assortment problem for a network good industry with vertical differentiation.
In our model, we examine two cases: (i) the exogenous pricing case in which the prices for all products are determined by the market environment and the seller cannot alter them by himself; and (ii) the endogenous pricing case in which the seller need not only to choose what products to offer from a given product category but also to make price decisions for the products offered. For each case, we develop a efficient algorithm based on the shortest path method to obtain an optimal assortment. It is shown that each algorithm can get an optimal solution in a polynomial time. The theoretical results, e.g., Lemma 1 and Lemma 3, show (i) that, in an optimal assortment with exogenous prices, the product prices, profit margins, and price minus network benefit-quality ratios are increasing in the quality; and (ii) that in an optimal assortment with endogenous prices, the prices, production costs, production cost minus network benefit-quality ratios, and profit margins are increasing in the quality; and (iii) that, with network effect, the seller always has incentive to choose a high attractable product as the low-end product in order to expand the market coverage then to increase the value of the high-end product for customers. These observations provide the qualitative insights into the optimal assortment plan for decision-makers.

Appendix. Proofs
Proof of Lemma 1 Q * is the largest fixed point of Equation (1), given S * . To solve this largest fixed point is equivalent to solve the problem (2).
Since K > 0, every product in an optimal assortment S * must have a positive purchase probability because, if not, removing the product with zero demand does not affect the total demand but decreases the total fixed cost. From the definition of P j i (S ), we know that a customer with valuation p j i+1 −p j i q j i+1 −q j i gets the same utility from buying j i and j i+1 , for i = 1, . . . , n−1; and a customer with valuation is indifferent from buying 1 or nothing. Hence, to guarantee P j i > 0 for any j i ∈ S , Equation (3) must hold. Equations (4) and (5) and (7) follow directly from Equation (3). Finally, Equation (6) can be seen from the seller's problem (15).

Proof of Theorem 1
According to Lemma 1 and the construction of Algorithm 1, we can see that any path with nonpositive cost at Step 3 uniquely corresponds to an assortment satisfying conditions in Lemma 1 and vice versa. Hence, the assortment given by Algorithm 1 must be one of the optimal assortments by enumerating all possibilities satisfying conditions in Lemma 1. That is, Algorithm 1 gives an optimal assortment.
By Corollary 1 in [2], the complexity of the shortest path problem at Step 3 in algorithm 1 is O(n 3 ) if the source node is given. This kind of shortest path problem would be run n times. Therefore, the complexity of this algorithm is O(nX + n 4 ).
We have known that, when an assortment is given, choosing optimal prices for these products is equivalent to choosing {θ j 1 , . . . , θ j m } to maximize the seller's profit. Since Q =F(θ j 1 ) in equilibrium, taking derivatives of the objective function with respect to Q, θ j 2 , . . . , θ j m , we obtain Equations (9), (10) and ((11)).
The condition θ * j 1 < θ * j 2 < · · · < θ * j m ≤ θ is necessary to guarantee each product in the optimal assortment can have a positive purchase probability. Therefore, this lemma is proved.

Proof of Lemma 3
Given S * = { j 1 , . . . , j m }, Equation (11) gives the definition of θ j i for i = 2, . . . , m. For i = 1, taking the derivative of the objective function with respect to θ j 1 , we have that where Q =F(θ j 1 ). Then by the last two conditions in Lemma 2 we can know that Equation (12) holds to guarantee each product in the optimal assortment can have a positive purchase probability. Equations (13) and (14) directly follow Equation (12).

Proof of Theorem 2
The proof is analogous to the proof of Theorem 1.