Journal Pre-proof A Stackelberg knapsack game with weight control
Ulrich Pferschy, Gaia Nicosia, Andrea Pacifici
PII:
S0304-3975(19)30630-9
DOI:
https://doi.org/10.1016/j.tcs.2019.10.007
Reference:
TCS 12213
To appear in:
Theoretical Computer Science
Received date:
28 January 2019
Revised date:
16 July 2019
Accepted date:
5 October 2019
Please cite this article as: U. Pferschy et al., A Stackelberg knapsack game with weight control, Theoret. Comput. Sci. (2019), doi: https://doi.org/10.1016/j.tcs.2019.10.007.
This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of record. This version will undergo additional copyediting, typesetting and review before it is published in its final form, but we are providing this version to give early visibility of the article. Please note that, during the production process, errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain. © 2019 Published by Elsevier.
A Stackelberg Knapsack Game with Weight Control Ulrich Pferschya , Gaia Nicosiab,∗, Andrea Pacificic a Department
of Statistics and Operations Research, University of Graz, Austria,
[email protected] b Dipartimento di Ingegneria, Universit` a degli Studi Roma Tre, Italy,
[email protected] c Dipartimento di Ingegneria Civile e Ingegneria Informatica, Universit` a degli Studi di Roma “Tor Vergata”, Italy,
[email protected]
Abstract We address a bilevel knapsack problem where a set of items with weights and profits is given. One player, the leader, may control the weights of a given subset of items. The second player, the follower, outputs the actual solution of the resulting knapsack instance, maximizing the overall profit. The leader receives as payoff the weights from those items of its associated subset that were included in the solution chosen by the follower. We analyze the leader’s payoff maximization problem for three different solution strategies of the follower and discuss the complexity of the corresponding problems. In particular, we show that, when the follower adopts a greedy strategy, setting the optimal weight values is N P-hard. Also, it is N P-hard to provide a solution within a constant factor of the best possible solution. However, a MIP-formulation can be given. Moreover, the truncated greedy strategy allows an easy answer for the revision of weights. For the additional case, in which the follower faces a continuous (linear relaxation) version of the above problems, the optimal strategies can be fully characterized and computed in polynomial time. Keywords: Knapsack problem, Stackelberg game, Bilevel optimization.
1. Introduction Bilevel programming (BP) comprises optimization problems in which some of the decision variables, in an upper level problem, must be optimal for some other, lower level problem. It is a paradigmatic tool to model scenarios whose outcome depends on the interplay of two decision makers. In general, bilevel programs are computationally hard to solve: Jeroslow [12] and Hansen et al. [11] ∗ Corresponding
author
Preprint submitted to Theoretical Computer Science
October 8, 2019
showed that BP is N P-hard even when the objective functions and constraints are linear. In [15], the authors provide a number of computational complexity results for BP, and state that most solution techniques have been developed focusing on special cases in which convenient properties, such as linearity or convexity, can be exploited to develop efficient solution methods. This is the case for an important class of strategic games, the so-called Stackelberg games (introduced by von Stackelberg to model market dynamics [23]) which may be regarded as a special case of BP. Here, two players interact at two distinct levels. One player, called the leader L, makes its choice first by choosing some elements or setting certain parameters. After the leader’s decision, the other player F, called the follower, chooses its response. Both players aim at optimizing their own objectives, possibly conflicting or not positively correlated. To this purpose the leader needs to anticipate the optimal response of the follower. In terms of a bilevel program, the upper level optimization problem is the leader’s problem, while the lower level one is the follower’s problem. Usually, it is assumed that the players have complete and mutual knowledge about each other’s models. In this work we address a Stackelberg-type leader-follower scenario for the classical binary knapsack problem (KP). In KP we are given a discrete finite set N of items, each having a positive integer weight and a profit, and a knapsack with bounded weight-capacity c. One asks for a subset of items with maximum total profit and total weight not exceeding the capacity of the knapsack (a comprehensive collection of results on KP can be found in [14]). The importance of KP is witnessed by a plethora of both theoretical and practical applications and, besides that, it has been also investigated under a game theoretic perspective (see, e.g., [8, 10, 16, 18, 17, 24]). We consider the following leader-follower situation: A given subset of items L ⊂ N is controlled by the leader L, who may choose freely the weights of all items in L. After L has set the weights, the follower F computes a solution set S of the knapsack problem over all items in N aiming at the maximization of the total profit, irrespective of whether an item is in L or not. The leader receives as payoff the total weight only from its own items which are included in the solution, i.e., from items in S ∩ L. As a consequence, L wants to choose small values for the weight of its items in order to increase chances that those are included in the solution computed by F, but this, in turn, decreases the potential payoff from those items. In fact, according to the nature of Stackelberg games, the payoff of an item in L for the leader is negatively correlated to the likelihood of being included in the solution set. The original motivation of our model is related to the application scenarios sketched hereafter. A financial trader L (e.g., a bank) offers a number of products (i.e., investments opportunities) to a client F who has a fixed investment budget (knapsack capacity) for buying assets and wants to maximize the total utility or profit gained from these assets. F has also access to alternative forms of investment but limited knowledge and computational capacity. All these financial products, either offered by the trader or not, are characterized by a given
2
cost and a performance measure (like, e.g., their return-on-investment (ROI) or the net present values), which are determined by the market. The client selects a portfolio using simple strategies based on the efficiency of the products at hand. Due to client’s limited information, the trader may offer its own products at prices larger than their actual costs (while maintaining their real market profitability valid for the clients.) In this case, the trader aims at maximizing its revenue, that is, the total selling price of the assets sold to client F. This objective is typical in short-term strategies and in the initial phase of a business, when it is more important to increase market shares and strengthen the company’s position and eminence, rather than its profits. The trader has therefore to decide, for all its financial products, the price offered to the client in order to make its investments attractive and increase chances that client purchases those instead of other products. We assume that the follower has (polynomially) bounded computation power for deriving its feasible sets. Since the optimization task faced by the follower requires the solution of an N P-hard knapsack problem, we therefore restrict the selection procedure of F to natural, possibly suboptimal greedy-type strategies, namely, the classical greedy algorithm, its “abbreviated” version greedy-split, and the relaxed variant, where F is allowed to choose fractions of items and thus solves the LP-relaxation of the underlying knapsack problem (see Section 2). Greedy and Greedy-Split algorithms are “natural” and very simple approaches to KP that can be efficiently implemented. Though their performance can be arbitrarily bad compared to the optimal (integral) solution of KP, they are the base of different approximation-guaranteed algorithms and they have been also successfully adopted in practice (see, e.g., [1, 13, 17]). We refer to the textbook by Kellerer et al. [14] where the use of these heuristics, as well as of the linear relaxation, is extensively discussed for several applications both of theoretic and practical nature. In the literature on Stackelberg games, similar restricting hypotheses on the computation power have been often considered (see for instance, [3, 4].) The resulting solutions are sometimes called semi-feasible (see e.g. [2]) because from a bilevel optimization perspective, a suboptimal solution of the follower’s problem is not feasible for the leader’s decision problem. In any case, the selection policy adopted by the follower is also known to L. A summary of our contribution is given in Section 2.1. Note that in this work we consider the problem in which the leader controls the weights of its items (and its payoff is given by the weights of those items selected in the follower’s solution set). A different version of the present problem, in which the leader rather controls the profits of a subset of items, has been recently considered in [20]. In that study, for each of the leader’s items, a revised profit is offered to the follower, which then selects the solution set among all the items in order to maximize its overall profit. The leader receives as pay-off only part of the profits of its items that are included by the follower in the solution set, namely the difference between the original profits and those offered to the follower. 3
The complexity of a two-level Subset Sum problem, which is a special case of the problem addressed in this paper, is studied in [19]. Two variants of our Stackelberg game are considered, in which the leader controls the weights of its items in the objective function, or in the bounded resource constraint, respectively. Another related problem has been studied in [3], where the authors consider two different Stackelberg games in which the follower cannot optimize exactly over the range of all feasible subsets. In particular, the authors address a MinKnapsack game and the follower seeks to purchase a min-cost selection of objects of some bounded weight. They show that when F uses a greedy 2-approximation algorithm the problem is strongly N P-hard but admits a polynomial-time (2 + ε)-approximation algorithm for the leader’s revenue maximization problem. In [7] the authors consider a “bi-knapsack” bilevel problem in which the items can be packed in two knapsacks (even simultaneously) and the leader gets profit from the items in both knapsack, while the follower only from those in one of the knapsacks. Improved approximation results for that problem are given in [22]. An overview and complexity results for various bilevel knapsack problems are given in [5]. Situations where leader and follower compete for items are discussed from an algorithmic point of view in [6] and more recently in [9]. This paper is organized as follows: Section 2 formally introduces the addressed problem and describes our results. Section 3 presents two strong negative approximability results for the case where the follower computes an optimal solution of the underlying knapsack problem. In Section 4 we analyze the problem in which the follower adopts a greedy strategy. The cases in which F applies LP-relaxation and Greedy-Split, respectively, are considered in Section 5 and Section 6, respectively. Some computational experiments are reported in the Appendix. 2. Notation and formal problem definition We are given two sets of items: the set L, indexed by j = 1, . . . , n , contains the leader’s items or L-items, and the set F , indexed by i = 1, . . . , nf , contains the follower’s items or F-items. Each item in any of the two sets has a profit F and a weight, both non-negative. The profits pF i and weights wi of the Fitems remain fixed and cannot be modified by any player. In addition, w.l.o.g. we suppose that the items in F are sorted in non-increasing order of efficiency F pF i /wi . Every L-item j has a fixed profit pL j but the leader L can set arbitrary weights L w ˜j for all items j ∈ L (nominal input values wjL are irrelevant). Therefore, an ordering by efficiency cannot be given in advance for L-items. After L has chosen its weights w ˜jL , F chooses a solution of the 0-1 knapsack problem based on these weights w ˜jL for j ∈ L and comprising the items of both sets F ∪ L aiming at the maximization of the total profit over both item sets. The objective function of L is given by the sum of weights w ˜jL over all items j ∈ L which are included in the knapsack. Thus, increasing the weight of 4
an item increases the pay-off for L but diminishes the chance that the item is included in the solution determined by F. This problem is denoted as Stackelberg Knapsack Problem with Weight selection (SKPW). We can write SKPW as a bilevel program using binary decision variables uj for items j ∈ L and vi for i ∈ F in the problem of the follower F. w ˜jL xj max j∈L
⎫ ⎧ ⎬ ⎨ x F L F (1) s.t. pL u + p v : w ˜ u + w v ≤ c ∈ argmax j i j i j i j i ⎭ y (uv)∈{0,1}n ⎩j∈L i∈F j∈L i∈F x ∈ {0, 1}n ; w ˜ L ∈ Rn y Note that this program is non-linear bilevel due to the objective function and the capacity constraint. Although optimal solutions of the N P-hard knapsack problem can be computed in reasonable time in practice, there are hardly any structural results offering necessary or sufficient conditions for the inclusion of an item in an optimal solution. Moreover, as discussed in the Introduction, it is common to assume that the follower can not solve N P-hard problems but has limited computation power. Following this line of thought we consider three simple algorithmic approaches which F applies to the given knapsack problem instead of computing the optimal solution. All three are based on the sorting of the items by non-increasing efficiency. We assume that in case of a draw in this ordering, the follower always prefers items of the leader, i.e. an optimistic scenario as described in [5]. The follower’s algorithms that we take into consideration are listed hereafter: Greedy algorithm. The classical Greedy algorithm considers the items in nonincreasing order of efficiency and packs each item into the knapsack if there is enough remaining capacity. No packed item is ever removed again. LP-relaxation. In this case, F is allowed to split items in its solution set, that is we are not considering an integer problem anymore. It is well-known that the LP-relaxation can be computed by starting the Greedy algorithm and packing a fractional part of the first item which does not fit completely into the knapsack. This is called the split item. Greedy-Split. This algorithm computes an integer solution by simply taking the LP-relaxation and removing any split item, i.e. “rounding down” the LP-solution. Clearly, this is equivalent to stopping the Greedy algorithm as soon as the first item is encountered, which can not be packed into the knapsack. This truncated version of the classical Greedy algorithm was used in [14, ch. 2.1] since many theoretical properties of the Greedy algorithm hold even for Greedy-Split and therefore it is possible to conduct simplified analyses. 5
It is well known that Greedy and Greedy-Split can be implemented efficiently in O(n log n) and O(n) time, respectively (see [14, ch. 2]), where n is the total number of items. 2.1. Our contributions The main results of this paper are summarized hereafter and illustrated in Table 1. The first results that we prove concern the non-approximability of our problem when the follower adopts either an exact solution algorithm or an εapproximation algorithm. Similarly, when the strategy adopted by follower F is the Greedy algorithm, the leader’s problem SKPW cannot admit a polynomial time approximation algorithm with a constant approximation ratio (unless P=N P). This negative result is proved in Theorem 6. If the follower selects the solution set using the LP-relaxation strategy, it is possible for the leader to optimally select weights in polynomial time, as it is illustrated by Algorithm 1. When F follows the Greedy-split algorithm, the weight selection problem is polynomially solvable, as shown in Section 6. The cases with Greedy and Greedy-split algorithms can be modeled as (mixed-integer) linear programs, see the model (6)–(13) in Section 4.2. Similar questions have been addressed in our work on the Stackelberg knapsack problem with profit control [20]. Unfortunately, the results provided in that work do not extend to the present weight-control problem. The outcomes, however, turn out to be similar in some cases. The most notable difference is the fact that Greedy-Split remains weakly N P-hard for profit control. Follower’s Solution Strategy
Complexity of SKPW ∈ APX APX ∈ APX, MIP model ∈ Polynomial Polynomial
Exact ε-approximation Greedy LP Relaxation Greedy-Split
Table 1: Summary of results.
3. Negative approximability results Hereafter, we prove two general results concerning the non-approximability of SKPW when the follower adopts either an exact solution algorithm or an ε-approximation algorithm. Theorem 1. For SKPW there is no polynomial time approximation algorithm with any positive approximation ratio for the leader, if the follower applies an exact algorithm (unless P=N P). 6
Proof. Consider an instance of Partition with n integer numbers a1 , . . . , an and the question is whether there exists a subset of these numbers with total n sum equal to b = 12 i=1 ai . We define the following instance of SKPW for a knapsack with capacity L c = b. L consists of one item with pL 1 = 1 (the weight w1 is irrelevant as per the problem definition), while item set F contains the n items of Partition with wiF = ai and pF i = M · ai , i = 1, 2, . . . , n. If the given instance of Partition is a YES-instance, then F may select the corresponding subset of items and reach an objective function value of M c. In fact, the possible inclusion of the single item of L in the solution would contribute only with pL 1 = 1 to the objective function of F, but it would correspond to a loss of at least one unit of weight, i.e. M units of profit. Thus, L ends up with an objective value of 0. If the given instance of Partition is a NO-instance, then F may select items from F with total weight at most c − 1. Now, L can set w ˜1L = 1 and F may always add this item to its solution assuring an increase in objective value of 1. Thus, any algorithm with positive approximation ratio for L could decide the N P-complete problem Partition. As pointed out in the Introduction, we assume that the follower has limited computation power. Thus, discarding the possibility of an exact solution for F, the next natural step would be to assume that F applies some ε-approximation algorithm, e.g. a fully polynomial approximation scheme (FPTAS). Of course, for the knapsack problem a wide spectrum of ε-approximation schemes is available (see [14, ch. 6]) and it does not make sense to consider them individually. However, assuming that F applies a “black box” ε-approximation algorithm, where the leader does not know any algorithmic details, but only the fact that some ε-approximate solution (for a fixed and known ε) of the optimal knapsack solution will be derived, keeps the same inapproximability results in place as stated above for the exact solution strategy of the follower. The argument is straightforward and quite similar to [3], Proposition 1. Proposition 2. For SKPW there is no polynomial-time approximation algorithm with any positive approximation ratio for the leader, if the follower applies an (unknown) ε-approximation algorithm (unless P=N P). Proof. It suffices to consider the following trivial instance: F contains a large F F F item with pF 1 = M − 1 and w1 = c − 2 and two small items with p2 = p3 = 1, F F w2 = 2 and w3 = 1. Let M > 1/ε. L consists of a single small item with profit pL 1 = 1. Clearly, F must select the large item. Then, the follower might e.g. follow a strategy of packing items in decreasing order of weights. In that case, L can only reach a non-zero payoff by setting w ˜1L = 2. But the follower might just as well pack items in increasing order of weights. Then, L can only avoid a zero payoff by setting w ˜1L = 1. Since the details of the approximation algorithm executed by the follower are unknown to the leader, there is no way that L can guarantee any positive approximation ratio.
7
Note that in both proofs there is no tie breaking involved between items of L and F. The choice between two equally profitable items in the proof of Proposition 2 is a feature of the (unknown) ε-approximation algorithm. Thus, the two negative results hold for both the optimistic and the pessimistic tie breaking scenarios. As a consequence of these negative results, in the remainder of the paper we move to the above described algorithms for the decision of the follower. 4. Follower applies Greedy In this section, we assume F applies the Greedy algorithm to select the solution set. L has to decide, for each item j ∈ L whether it shall be in the solution set and, in this case, what is the efficiency of j. Recalling that the sequence of items in F is given in decreasing order of efficiency, the leader decides in which position of this ranking (i.e., in which interval between two consecutive items of F) item j should be inserted by suitably choosing the values w ˜jL . The outcome of this decision is an overall ranking of both the leader’s and follower’s items. At each step of the Greedy selection process applied by F on this ordering, a certain number of items have been included in the partial solution set, i.e., in the knapsack. Let, FR , LR , and cR be the residual set of follower items, the residual set of leader items, and the residual capacity, respectively (i.e. the items and capacity still available). Definition 3. We say that j ∈ L is placed before i ∈ F if its efficiency is smaller than that of i − 1 ∈ F and greater than or equal to that of i ∈ F . To place an L-item j ∈ LR before an F-item i, the leader needs to guarantee that pLj/w˜jL ≥ pFi /wiF . Clearly, since the objective of the leader consists of the chosen item weights, and recalling the above tie-breaking rule, L chooses the wF F largest possible weight for j, i.e., w ˜jL = pL j · i /pi , unless the residual capacity enforces a smaller value. In conclusion, j is placed before i if
F L L wi w ˜j := min cR , pj F . (2) pi We say that an item i ∈ FR is blocked by L, if the leader includes a subset S ⊆ LR of its items such that: (i) S can be feasibly packed, i.e., w ˜jL ≤ cR (3) j∈S
and (ii) item i cannot be packed after the inclusion of S, i.e., j∈S
pL j
wiF + wiF > cR pF i
(4)
wF F where the term w ˜jL = pL j · i /pi , according to equation (2), represents the fact that the items in S are placed before i ∈ F and take their maximum possible weights while being more efficient than i ∈ F .
8
The following Lemma shows that, if L does not block an item i ∈ F even though it is possible, then any resulting solution cannot be better for the leader than those obtained by blocking it. Lemma 4. In an optimal solution some subset S of L-items is placed before an F-item i if and only if i can be blocked. Proof. (⇐=) If i ∈ FR can by some item set S, this means that L be blocked ˜jL > cR − wiF , for some residual capacity cR can place S before i with j∈S w resulting from the current situation of the game. However, if L does not block i, then F can pack i leaving a residual capacity cR − wiF as an upper bound for any further weight accrued by L. Instead, by ˜jL from set S. blocking i, L would obtain (at least) a larger weight j∈S w (=⇒) If an item j ∈ S is placed before i although i can not be blocked but will be packed anyway, then L could choose a larger weight w ˜jL by placing j after i and possibly increase its weight in the objective. Observe that, if i is not blocked, there may be L-items blocking i−1 which are selected (and included in the solution set) by the Greedy algorithm immediately before i. Lemma 4 says that blocking should be done whenever possible, but we cannot say anything about the particular set S used to block i. This leaves open the question of how to block. Placing some item j ∈ LR before an item i ∈ F allows only a smaller weight w ˜jL than placing j after i. Thus, an intuitive strategy would block (whenever blocking is possible) with a set S of minimum possible total weight, in order to “save” more potential weight for the next iterations. Of course, choosing such a set S would require the solution of an N P-hard Subset Sum Problem (SSP) in each iteration which can be done by dynamic programming in pseudopolynomial time (and very efficiently in practice). However, the following Example 5 shows that this blocking strategy is not necessarily optimal. Example 5. Consider an instance of SKPW with knapsack capacity c = M , L where L consists of two items with profits pL 1 = M and p2 = 2M . Item set F also contains two items: i
pF i
wiF
F pF i /wi
1 2
M2 (M − 1)2
M M −1
M M −1
Item 1 of F should be blocked by L according to Lemma 4. This can be done either with L-item 1 using, according to equation (2), w ˜1L = M · 1/M = 1 or with L 1 item 2 and w ˜2 = 2M · /M = 2. Clearly, blocking F-item 1 with the minimum weight implies choosing the former option. However, now F-item 2 could still be packed and must be blocked by L with w ˜2L = 2M · 1/(M − 1) ≈ 2. This ends the game with a total weight of ≈ 3 for L. An optimal solution would block F-item 1 by setting w ˜2L = 2, thus also blocking F-item 2. The remaining item 1 of L could be packed with w ˜1L = c − 2 and hence the whole capacity M could be obtained by L. 9
Observe that the above example shows that the strategy of blocking with a minimum weight subset of L-items is not only sub-optimal but it may perform arbitrarily bad. 4.1. Negative approximability results In this section we prove that it is N P-hard for the leader to determine weights w ˜jL which guarantee a solution within a constant factor of the best possible solution. In particular, we have the following result. Theorem 6. For SKPW there is no polynomial time approximation algorithm with a constant approximation ratio, if the follower applies the Greedy algorithm (unless P=N P). Proof. We prove the theorem by using a reduction from Partition and showing that, if there exists a polynomial time approximation algorithm with a constant approximation ratio for SKPW, then Partition can be solved in polynomial time. Consider an instance I of Partition with n integer numbers a1 , . . . , an . The question iswhether there exists a subset of these numbers with total sum n equal to b = 12 i=1 ai . We define the following instance of SKPW with knapsack capacity c b. L consists of n + 1 items with pL j = aj for j = 1, . . . , n and one additional item L with pn+1 = 1 (weights are not required). Item set F contains only three items with profits and weights reported in the following table. i
pF i
wiF
1 2 3
c−b+1 (c − 3b + 1)/2 1
c−b+1 c − 3b + 1 c
F pF i /wi
1 1/2 1/c
Since nf = 3, there are three relevant intervals for L to place its items: Let Si ⊆ L be the set of items L places before an item i ∈ F . From (2) we have that w ˜jL = pL ˜jL = 2 pL j , ∀j ∈ S1 and w j , ∀j ∈ S2 . W.l.o.g. we can assume that all items in S1 are packed by the Greedy algorithm. Otherwise, L could move all unselected items to the next subset. Now we consider the following three cases. (i) j∈S1 pL j = b. This is the optimal strategy for L: Item 1 of F is blocked, F ˜jL + w1F = j∈S1 pL because j∈S1 w j + w1 = b + c − b + 1 = c + 1. Next, F packs the remaining items except n + 1, i.e. j∈S2 pL j = b. This yields: j∈S1
w ˜jL +
w ˜jL + w2F = b + 2b + c − 3b + 1 = c + 1
j∈S2
and thus F-item 2 is blocked as well. Placing the final L-item n + 1 before L L ≤ c. Choosing w ˜n+1 = c − 3b yields a solution for F-item 3 requires w ˜n+1 L with optimum total weight of c. 10
pL ˜jL +w1F ≤ b−1+c−b+1 = c j ≤ b − 1. In this case we have j∈S1 w and therefore item 1 of F can be packed leaving at most b − 1 as a possible solution value for L. L L (iii) j∈S1 pL j ≥ b + 1. Let us first assume that j∈S1 pj + j∈S2 pj ≤ 2b, which means that at least one unit of profit remains for S3 . As shown in case (i) item 1 of L is blocked since j∈S1 pL j ≥ b. However, item 2 of F is packed by Greedy because of the following inequalities:
(ii)
j∈S1
w ˜jL +
j∈S1
w ˜jL + w2F =
j∈S2
=
pL j +
j∈S1
≤ 2b + 2b −
F 2pL j + w2 ≤ 2b +
j∈S2
pL j
F pL j + w2 ≤
j∈S2
+
w2F
≤ 4b − (b + 1) + c − 3b + 1 = c
(5)
j∈S1
In this case the weight for the leader can be at most c − w2F = 3b − 1. L In the remaining case, namely j∈S1 pL j + j∈S2 pj = 2b + 1, no items remain for S3 and the best case can be bounded by packing all items in S2 since item 1 can not be blocked anyway. This yields an upper bound for the solution value of L of 2(2b + 1) = 4b + 2. All together we have shown that the instance of Partition has a “Yes”-answer if and only if the optimal weight obtained by the leader in SKPW equals c while it is < 4b + 2 for any “No”-answer. This rules out a polynomial time approximation algorithm with any constant approximation ratio ρ choosing, e.g., c > ρ(5 b). 4.2. Integer Programming formulation Since SKPW does not even admit a polynomial time approximation algorithm, we now introduce a Mixed Integer Programming (MIP) formulation for computing the best solution of SKPW for L, if the follower applies Greedy. For notational convenience we introduce two dummy items 0 ∈ F with w0F = 1, F F pF 0 = M and nf + 1 ∈ F with wnf +1 = c and pnf +1 = 1 (and increase the capacity by one) to guarantee that every item of L is placed between two items of F . The decision task for L boils down to placing each item j ∈ L into an interval between two F-items i − 1 and i. With (2) this implies setting each wF
i weight w ˜jL ≤ pL j pF for some i ∈ F . Hence, we have to introduce separate reali
n ×n
valued variables w ¯ ∈ R+f , where w ¯ij represents the actual weight of item ¯ij = 0 j ∈ L, if it is used to block item i ∈ F (possibly item nf + 1), and w otherwise. As stated in Lemma 4 blocking is always beneficial for L, moreover an item j ∈ L should be placed into an interval between i − 1 and i of F only
11
if i can be blocked. G = max w ¯ij zw
(6)
i∈F j∈L
s.t.
xij ≤ 1
j∈L
(7)
xij + yi ≤ 1
i ∈ F, j ∈ L
(8)
wiF pL j F pi
i ∈ F, j ∈ L
(9)
i∈F
(10)
i∈F
w ¯ij ≤
c(1 − yi ) − i∈F j∈L
xij k≤i j∈L
w ¯ij +
w ¯kj −
wkF yk < wiF
k
wiF yi ≤ c
(11)
i∈F
w ¯ij ≥ 0 xij , yi ∈ {0, 1}
i ∈ F, j ∈ L
(12)
i ∈ F, j ∈ L
(13)
Variables y ∈ {0, 1}nf encode whether item i ∈ F is packed into the knapsack (yi = 1) or not (yi = 0). Variables x ∈ {0, 1}nf ×n , indicate whether item j ∈ L is packed and used to block item i ∈ F (xij = 1) or not (xij = 0). Note that, when j ∈ L blocks an item i ∈ F it may as well exclude some other succeeding item i > i, i ∈ F , from the solution. However, in our model we associate the blocking only with the highest-ranked blocked item. Constraints (8) and (9) impose that if i ∈ F is included in the solution, then ¯ij are forced to 0 for all j ∈ L. Constraints (10) ensure that, if an xij and w item i ∈ F is not packed (yi = 0) but blocked, then wiF must be larger than the residual capacity1 . This means also that if wiF is smaller or equal the residual capacity, then item i ∈ F must be packed (yi = 1), as required by the Greedy rule. By (7) at most one F-item can be blocked by a L-item. In the Appendix we briefly report on some computational experiments to illustrate the practical performance of the above MIP model. 5. Follower solves the LP-relaxation Hereafter, we give a characterization of the solution structure of SKPW when the follower solves the LP-relaxation of the knapsack problem and then describe a polynomial time algorithm for the leader’s problem. Since items are allowed to be split, there is no tactical strategy of blocking involved, but the leader simply competes with the follower items for knapsack capacity. This means that the leader tries to minimize the weight capacity consumed by F-items. At first, L has to compete against the most efficient F-item with weight w1F : If the leader can avoid that this item is fully packed by 1 The
strict inequality is a slight abuse of standard linear programming notation.
12
F (Cases 1. and 2. below), it will do so by placing all its item before this F-item and thus securing a maximal share of the capacity. However, if the packing of the full weight w1F cannot be avoided (Case 3.) then it makes no sense for the leader to offer its items at a high efficiency with a low weight. Instead, the leader will accept that item 1 is fully packed and restart its argument with the residual capacity c − w1F . More formally, the leader will start by moving all its items before the most F F efficient F-item, i.e., item 1, by setting – according to (2) – w ˜ L = (pL j w1 )/p1 j L F F for all j ∈ L, thus reaching a maximal total weight of W1 = j∈L (pj w1 )/p1 . Then one of the following three cases may occur: 1. If W1 ≥ c, the leader obtains an optimal solution with value c from the LP-relaxation. 2. If W1 < c ≤ W1 + w1F , all of W1 and a fractional part of item 1 ∈ F with weight c − W1 ≤ w1F is packed. If the leader changes its allocation this can only lower the total weight of items packed before F-item 1, while F increases the fractional part of w1F . 3. If W1 + w1F < c, then L cannot avoid that F-item 1 is fully packed in the LP-relaxation. However, in this case, the remaining capacity c − w1F could be exploited by the leader, who may place all L-items after 1 and before w2F . This yields a total 2 and thus increase all its item weights to w ˜jL = pL j pF 2 weight W2 ≥ W1 . In the latter case, L may reach a weight higher than W1 but, possibly, also higher than W2 : in fact, the same reasoning (and the same three cases as above) apply for W2 and the residual capacity c − w1F . It is also easy to see that in Case 1. the leader can always reduce the weights of some of the L-items such that their total weight is equal to c and thus no Litems are split at all. Therefore, fractional items will only appear in the solution for F-items. Iterating this process over all slots between two F-items i−1 and i, the leader stops as soon as an item i cannot be fully packed into the knapsack. In this case, i−1 L obtains as solution weight either the full residual capacity cR = c − k=1 wkF in case that item i is not packed at all (analogous to Case 1.), or L obtains wiF L j∈L pj if L cannot avoid that a fractional part of i is packed (Case 2.). pF i In both cases, L can only diminish its solution value by moving to the next interval and allow F-item i to be fully packed. In conclusion, the leader obtains its optimal solution value W ∗ which may be computed as follows: F F min ci , W ∗ = max (pL (14) j wi /pi ) j∈L
i=1,...,nf
i−1 where c1 = c and ci = c − h=1 whF for i = 2, . . . nf . The optimal solution for the leader (i.e., the w ˜ L values) can be computed as shown by Algorithm 1 in linear running time O(n + nf ).
13
Algorithm 1 SKPW: Optimal weight for L if F uses the LP-Relaxation. 1: i := 0 2: W := 0 {current best solution for L} 3: repeat i 0 4: cR := c − k=1 wkF {Assume k=1 wkF := 0} 5: i := i + 1 w F n L 6: W := min{cR , pFi j=1 pj } i
until W + wiF ≥ cR w F n L 8: if W = pFi j=1 pj then 7:
i
wF
w ˜jL := pFi pL j for all j ∈ L i 10: else ni 11: Let ni be the smallest index such that j=1 9:
12:
w ˜jL :=
13:
w ˜nLi
14: 15: 16:
wiF pF i
wiF pF i
pL j ≥ cR
pL j for j = 1, . . . ni − 1 ni −1 wiF L := cR − j=1 p pF j i
w ˜jL := 0 for j = ni + 1, . . . n end if Output w ˜L , W
6. Follower applies Greedy-Split Consider now the case in which the follower applies Greedy-Split, that is when the solution corresponds to the truncated LP relaxation solution. It was pointed out in Section 5 that the leader’s solution for the LP relaxation always consists of non-fractional items. Thus, it is quite clear that the arguments of the previous section can be applied in this case as well. Going through the three cases of Section 5, above in Case 1 it was pointed out that the leader can set weights so that no items are split and their total weight equals c, which will also be the solution of Greedy-Split. For Case 2, Greedy-Split will pack all L-items but omit the fractional part of item 1 ∈ F and then stop its execution. Clearly, there is no possibility for the leader to increase its share of the capacity. In Case 3 also Greedy-Split will pack item 1 ∈ F completely and therefore L should move all its items after 1 and consider the residual capacity c − w1F in the next iteration. All together, expression (14) still holds and allows the computation of the value of an optimal solution for the leader. The optimal values for w ˜jL can be computed by Algorithm 1 without any modifications and thus SKPW when F applies Greedy-Split can be solved in O(n + nf ) time. For the sake of completeness, let us mention that the mathematical program (6)–(13) for the Greedy case could also be extended to Greedy-Split by adding
14
the following sets of constraints: yi+1 ≤ yi xj ≤ yi
i ∈ F \ {nf } > i ∈ F \ {nf }, j ∈ L
(15) (16)
Constraints (15) enforce the Greedy (split) structure of the solution for the Fitems, that is, if item i ∈ F has not been included in the solution then all the succeeding items (with no larger efficiencies) are not part of the solution set. The remaining constraints (16) state that for all i ∈ F , ∈ F such that > i, and j ∈ L, if item i is not included in the solution set then item j of the leader cannot be used to block a later item > i (which, of course, is not part of the solution). Of course, from a practical point of view, this MIP formulation for SKPW when F applies Greedy-Split will be dominated by the above linear time algorithm derived from Algorithm 1. 7. Conclusions We address a special Stackelberg strategic game in a knapsack setting where the leader controls item weights and the follower determines a solution set of an instance of binary knapsack. We analyze the leader’s problem of maximizing its payoff, which depends on weights of those of its items included in the solution set, under three natural strategies adopted by the follower. We discuss the complexity of the resulting problems and provide MIP models for the hard cases. A number of further questions remain open for possible future research. It may be of interest to analyze relevant cases for the leader problem that can be solved in polynomial time. Further computational studies may assess the efficiency of the presented algorithms and MIP models and quantify the leader’s payoff with respect to theoretical upper bounds (e.g. j wjL ) for different distributions of items weights and profits and choice of the L-items. Acknowledgements Ulrich Pferschy was supported by the Field of Excellence “COLIBRI” at the University of Graz and by the project “Choice-Selection-Decision”. References [1] Ak¸cay, Y., Li, H., Xu, S.H.: Greedy algorithm for the general multidimensional knapsack problem, Annals of Operations Research, 150, 17–29 (2007) [2] Ben-Ayed, O.: Bilevel linear programming, Computers and Operations Research 20(5), 485–501 (1993) [3] Briest, P., Hoefer, M., Gual`a, L., Ventre, C.: On Stackelberg pricing with computationally bounded consumers, Networks 60(1), 31–44 (2012) 15
[4] Briest, P., Hoefer, M., Krysta, P.: Stackelberg network pricing games, Algorithmica 62, 733-753 (2012) [5] Caprara, A., Carvalho, M., Lodi, A., Woeginger, G.J.: A study on the computational complexity of the bilevel knapsack problem, SIAM Journal on Optimization 24(2), 823–838 (2014) [6] Caprara, A., Carvalho, M., Lodi, A., Woeginger, G.J.: Bilevel knapsack with interdiction constraints, INFORMS Journal on Computing 28(2), 319–333 (2016) [7] Chen, L., Zhang, G.: Approximation algorithms for a bi-level knapsack problem, Theoretical Computer Science 497, 1–12 (2013) [8] Darmann A., Nicosia, G., Pferschy, U., Schauer J.: The subset sum game, European Journal of Operational Research 233(3), 539–549 (2014) [9] Della Croce, F., Scatamacchia, R.: Lower Bounds and a New Exact Approach for the Bilevel Knapsack with Interdiction Constraints. Proceedings of IPCO 2019, Springer Lecture Notes in Computer Science 11480, 155– 167 (2019) [10] Ensthaler, L., Giebe, T.: Bayesian optimal knapsack procurement, European Journal of Operational Research 234(3), 774–779 (2014) [11] Hansen, P., Jaumard, B., Savard, G.: New branch-and-bound rules for linear bilevel programming, SIAM Journal on Scientific and Statistical Computing 5(13), 1194–1217 (1992) [12] Jeroslow, R. G.: The polynomial hierarchy and a simple model for competitive analysis, Mathematical Programming 32(2), 146–164 (1985) [13] Julstrom, B. A.: Greedy, genetic, and greedy genetic algorithms for the quadratic knapsack problem, Proceedings of the 7th annual conference on Genetic and Evolutionary Computation, GECCO ’05, 607–614 (2005) [14] Kellerer, H., Pferschy, U., Pisinger, D.: Knapsack Problems, Springer, (2004) [15] Labb´e, M., Violin, A.: Bilevel programming and price setting problems, 4OR: A Quarterly Journal of Operations Research 11(1), 1–30 (2013) [16] Marini, C., Nicosia, G., Pacifici, A., Pferschy, U.: Strategies in Competing Subset Selection, Annals of Operations Research, 207(1), 181-200 (2013) [17] Nicosia, G., Pacifici, A., Pferschy, U.: Competitive subset selection with two agents, Discrete Applied Mathematics 159(16), 1865–1877 (2011) [18] Nicosia, G., Pacifici, A., Pferschy, U.: Price of Fairness for allocating a bounded resource, European Journal of Operational Research 257, 933– 943 (2017) 16
[19] Pferschy, U., Nicosia, G., Pacifici, A.: On a Stackelberg subset sum game, Electronic Notes on Discrete Mathematics, 69, 133–140, (2018), (extended version available as arXiv:1801.03698) [20] Pferschy, U., Nicosia, G., Pacifici, A., Schauer J.: On the Stackelberg knapsack game, submitted manuscript (2019) [21] Pisinger, D.: Core problems in knapsack algorithms, Operations Research, 47(4), 570–575 (1999), code available at: http://hjemmesider.diku.dk/∼pisinger/generator.c [22] Qiu, X., Kern, W.: Improved approximation algorithms for a bilevel knapsack problem, Theoretical Computer Science 595, 120–129 (2015) [23] von Stackelberg, H.: Marktform und Gleichgewicht (Market and Equilibrium). Verlag von Julius Springer (1934) [24] Wang, Z., Xing, W., Fang, S.-C.: Two-group knapsack game, Theoretical Computer Science 411(7-9), 1094–1103 (2010)
Appendix: Brief overview of computational experiments We ran some illustrative tests for the three proposed follower strategies. These should not be seen as all-encompassing benchmarks but only as a preliminary “proof of concept”. The Mixed Integer program (6)–(13) for the Greedy case and Algorithm 1 for the LP case have been tested on a set of 120 pseudorandom instances, with up to 150 items for each player. The results for the Greedy-split case can be obtained either by a variant of Algorithm 1 or by the MIP (6)–(13)+(15)–(16). Note that the latter takes almost the same running time as the MIP for the Greedy case. The MIP models have been coded in AMPL and solved by CPLEX V12.5 solver, while Algorithm 1 has been implemented in Python 3.6.1 on a standard PC with Intel i5, 8 GB RAM, 2.7 GHz. By slightly adapting the knapsack instances generator by Pisinger [21], a number of tests instances were created for 8 different categories. Each category is characterized by one out of four different levels of correlation between item profits and weights. (1, 2, 3: null, low, medium correlation; 4: profit equals weight for all items, see [21] for the details). In addition, the values of the number of F-items nf are uniformly distributed in two intervals: [10–30] (small instances) and [100–150] (large instances). In any instance, the number of leader items is n := (1+ε)nf where ε is randomly taken in the interval [−0.05, +0.05]. We have generated 20 (resp. 10) instances for each one of the four small (resp. large) instance categories. In all the experiments, the following quantities have been measured: • computation times,
17
• optimal solution values for the leader’s profit, • the fractions (quotas) of knapsack capacity occupied by the items of the leader and, respectively, those of the follower, in the optimal solution, • the number of F-items in the optimal solution sets. The above figures do not show any significant trend as the level of correlation (between items profits and weights) varies. Therefore, in Table 2, we just report average values over the 80 small and the 40 large instances. For both of these classes, the table details the strategy of the follower in the first column. Correspondingly, columns 2–5 present the average values of, in order, the leader and follower quotas (L-F quotas), the computation times in seconds (time), and the number of F-items in the solution set (#F -items). F-strategy Small instances: Greedy Greedy-split LP relax Large instances: Greedy Greedy-split LP relax
L-opt. profit
L-F quotas (%)
time (s)
#F-items
1018.0 1018.0 1018.0
84.8 - 15.0 84.8 - 9.5 84.8 - 15.2
0.67 0.00 0.00
8.2 5.1 5.3
5417.3 5417.3 5417.3
93.4 - 6.5 93.4 - 5.0 93.4 - 6.6
260.98 0.00 0.00
9.6 5.1 5.9
Table 2: Average values for our computational results
Despite that the instances have been designed introducing a high variance in the parameters, the results are quite similar for the three different strategies of the follower. In fact, it is to note that, in 118 of the tested instances, the L-items selected in an optimal solution remain the same (with tiny variations for the remaining 2 instances), independently from the strategy adopted by the follower. This explains the identical average values for the leader’s profit and quota (2nd and 3rd column). We conclude that the more complex solution structures for the leader implied by the Greedy algorithm of the follower did not materialize in our test instances. Note that, instead, the follower quotas do vary indeed. In particular, for Greedy-split the follower may suffer from the fact that some capacity remains unused. In addition and not surprisingly, another parameter that is sensibly affected by the size of the instances, is the computation time needed to solve the mixed integer programs. However, for all the instances, CPLEX was able to find optimal solutions for the MIP of the Greedy case (as well as for the Greedy-split MIP, whose computation times, essentially identical, are not reported) in times not larger than 400 seconds. Computation times of the LP-relax Algorithm 1 and the corresponding variant for the Greedy-split solution are negligible, for all tested instances.
18