• Aucun résultat trouvé

2 Hardness Results

N/A
N/A
Protected

Academic year: 2022

Partager "2 Hardness Results"

Copied!
12
0
0

Texte intégral

(1)

Laurent Bulteau1, Danny Hermelin2, Anthony Labarre1(B) , and St´ephane Vialette1

1 Universit´e Paris-Est, LIGM (UMR 8049), CNRS, ENPC, ESIEE Paris, UPEM, 77454 Marne-la-Vall´ee, France

{laurent.bulteau,anthony.labarre,stephane.vialette}@u-pem.fr

2 Department of Industrial Engineering and Management, Ben-Gurion University of the Negev, Beersheba, Israel

hermelin@bgu.ac.il

Abstract. We investigate a variant of the so-called InternetShopping problem introduced by Blazewicz et al. (2010), where a customer wants to buy a list of products at the lowest possible total cost from shops which offer discounts when purchases exceed a certain threshold. Although the problem isNP-hard, we provide exact algorithms for several cases, e.g.

when each shop sells only two items, and anFPTalgorithm for the num- ber of items, or for the number of shops when all prices are equal. We complement each result with hardness proofs in order to draw a tight boundary between tractable and intractable cases. Finally, we give an approximation algorithm and hardness results for the problem of max- imising the sum of discounts.

1 Introduction

Blazewicz et al. [3] introduced and described the InternetShoppingproblem as follows: given a set of shops offering products at various prices and the delivery costs for each set of items bought from each shop, find where to buy each product from a shopping list at a minimum total cost. The problem is known to beNP- hard in the strong sense even when all products are free and all delivery costs are equal to one, and admits no polynomial (clnn)-approximation algorithm (for any 0< c <1) unlessP=NP.

A more realistic variant takes into account discounts offered by shops in some cases. These could be offered, for instance, when the shopper’s purchases exceed a certain amount, or in the case of special promotions where buying several items together costs less than buying them separately. Blazewicz et al. [4] investigated such a variant, which features a concave increasing discount function on the products’ prices. They showed that the problem is NP-complete in the strong sense even if each product appears in at most three shops and each shop sells exactly three products, as well as in the case where each product is available at three different prices and each shop has all products but sells exactly three of them at the same value. A variant where two separate discount functions

c Springer International Publishing AG, part of Springer Nature 2018

F. V. Fomin and V. V. Podolskii (Eds.): CSR 2018, LNCS 10846, pp. 53–64, 2018.

https://doi.org/10.1007/978-3-319-90530-3_6

(2)

are taken into account (one for the deliveries, the other for the prices) was also recently introduced and studied by Blazewicz et al. [5].

In this work, we investigate the case where a shopper aims to buyn books frommshops with free shipping; additionally, each shop offers a discount when purchases exceed a certain threshold (discounts and thresholds are specific to each shop). We show that the associated decision problem, which we call the Clever Shopper problem, is already NP-complete when only two shops are available, or when all books are available from two shops and each shop sells exactly three books. We also obtain parameterised hardness results: namely, that CleverShopperisW[1]-hard when the parameter ismor the number of shops in a solution, and that it admits no polynomial-size kernel. On the positive side, we give a polynomial-time algorithm for the case where every shop sells at most two books, an XP algorithm for the case where few shops sell books at small prices, an FPTalgorithm with parameter n, and another FPT algorithm with parameterm.

Let us now formally define Clever Shopper. For n N, let [n] = {1,2, . . . , n}. LetB be a set of books to buy, S be a set of shops; E ⊆B×S encodes the availability of the books in the shops, and w:E→Nencodes the prices. A subsetE⊆Edescribes from which shop each book should be bought;

each book iscovered exactly once (i.e., anyb∈B has degree 1 inE). Adiscount ds R+ is associated to each shop s and offered when athreshold ts R+ is reached, which is formally defined using the followingthreshold function:

δ(s, E, ds, ts) =

ds if

(b,s)∈Ew(e)≥ts, 0 otherwise.

We refer to the function D that maps each shop s to the pair (ds, ts) as the discount function. The problem we study is formally stated below, and gener- alises well-studied problems such as bin covering [1] and H-index manipu- lation[12].

CleverShopper

Input: an edge-weighted bipartite graphG= (B∪S, E, w); a discount func- tionD; a boundK∈N.

Question: is there a subsetE ⊆E that covers each element ofB exactly once and such that

e∈Ew(e)

s∈Sδ(s, E, ds, ts)≤K?

2 Hardness Results

We prove in this section several hardness results under various restrictions, both with regards to classical complexity theory and parameterised complexity theory.

We show that CleverShopperisNP-complete even if there are only two shops to choose from. For this first hardness result, we need book prices to be encoded in binary (i.e. they can be exponentially high compared to the input size).

Proposition 1. Clever Shopper is NP-complete in the weak sense (i.e., prices are encoded in binary), even when|S|= 2.

(3)

Proof (reduction from Partition). Recall the well-known NP-complete Partitionproblem [11]: given a finite set A and a sizeω(a)Nfor each ele- ment inA, decide whether there exists a subsetA⊆Asuch that

a∈Aω(a) =

a∈A\Aω(a).

LetI= (A, ω) be an instance of Partition, andT =

a∈Aω(a). We obtain an instance I of Clever Shopperas follows: introduce two shops s1 and s2

with (ds1, ts1) = (ds2, ts2) = (1, T /2). Each item a∈A is a book that shopss1

and s2 sell at the same price — namely, ω(a). It is now clear that there exists a subset A ⊆Asuch that

a∈Aω(a) =

a∈A\Aω(a) if and only if all books

can be purchased for a total cost ofT−2.

This NP-hardness result allows arbitrarily high prices (the reduction from Partitionrequires prices of the order of 2|B|). In a more realistic setting, we might assume a polynomial bound on prices, i.e., they can be encoded in unary.

As we show below, the problem remains hard for a few shops in the sense ofW[1]- hardness. We complement this result with anXPalgorithm in Proposition7.

Proposition 2. CleverShopperisW[1]-hard form=|S|in the strong sense (i.e., even when prices are encoded in unary).

Proof (reduction fromBinPacking). Recall the well-known BinPackingprob- lem: givennitems with weightsw1, w2, . . . , wn andmbins with the same given capacityW, decide whether each item can be assigned to a bin so that the total weight of the items in any bin does not exceedW. BinPackingisNP-complete in the strong sense andW[1]-hard for parameterm, even whenn

i=1wi=mW and all weights are encoded in unary [10].

We build an instance I of Clever Shopper from an instance of Bin Packing with the aforementioned restrictions as follows. Create m identical shops, each withts=W andds= 1. Createnbooks, where bookiis available in every shop at pricewi. The budget ism(W−1). In other words, any solution requires to obtain the discount from every shop, which is only possible if pur- chases amount to a total of exactlyW per shop before discount. Therefore, the solutions toI correspond exactly to the solutions of the original instance of Bin

Packing.

We can obtain another hardness result under the assumption that all books are sold at a unit price. Here we cannot bound the total number of shops (we give an FPT algorithm for parameter m in Proposition8 in that setting), but only the number of chosenshops (i.e., shops where at least one book is purchased).

Proposition 3. CleverShopperwith unit prices isW[1]-hard for the param- eter “number of chosen shops”.

Proof (reduction from Perfect Code). Given a graphG= (V, E) and a pos- itive integer k, Perfect Code asks for a size-k subset V V such that for each vertex u∈V there is precisely one vertex inN[v]∩V (whereN[v] is the closed neighbourhood of v, i.e., v and its adjacent vertices, as opposed to the

(4)

u1

u2

u3

u4

u5

b1

s1

b2 s2

s3 b3

s4

b4

b5

s5

1

1

1

1 1

1 1

1

1 1 1

1 1

1 1

1

1

Fig. 1.Reducing Perfect Codeto CleverShopper. Left: the input graph with a size-2 perfect code (bold). Right: the corresponding bipartite graph and a solution with total cost 52 = 3 (bold).

openneighbourhoodN(v) =N[v]\{v}). This problem is known to beW[1]-hard for parameterk [7].

Let I = (G = (V, E), k) be an instance of Perfect Code. Write V = {u1, u2, . . . , un}. We obtain an instanceI of Clever Shopperas follows. Let us first define a bipartite graph G = (B ∪S, E) where B = {bi : ui V}, S = {si : ui V} and E = {{bj, si} : uj NG[ui]}. All shops sell books at a unit price. As for the discount function, for each shop si S we have D(si) = (1, dG(ui) + 1) (i.e., a unit discount will be applied, fromdG(ui) + 1 of purchase). Figure1illustrates the construction.

We claim that there exists a size-kperfect code forGif and only if all books can be bought for a total cost ofn−k.

LetV⊆V be a size-kperfect code inG. For everyui∈V, letupc(i)be the unique vertex inN[v]∩V (pc is well-defined since V is a perfect code). Then buying each book bi ∈B at shop bpc(i)yields a solution forI, and it is simple to check that its cost isn−k.

Suppose that all books can be bought for a total cost of n−k. Since n books must be bought at unit price and shops only offer a unit discount, k shops must be chosen in the solution. Let S ⊆S denote these k shops. Since D(si) = (1, dG(ui) + 1) for each shop si S, we conclude that for each book bi∈B there is precisely one shop inN[bi]∩S. Then{ui :si ∈S} is a size-k perfect code inG.

Note that the number of visited shops corresponds exactly to the total dis- count received (i.e. to parameterkin the reduction).

We now prove1the non-existence of polynomial kernels (under standard com- plexity assumptions) for Clever Shopper parameterised by the number of books. To this end, we use theor-compositiontechnique [6]: given a problem P and a parameterised problemQ, anor-compositionis a reduction takingt instances (I1, . . . , It) ofP, and building an instance (J, k) ofQ, withkbounded

1 Details will appear in the full version.

(5)

by a polynomial on maxt≤t|It|+ logt, such that (J, k) is a yes-instance if and only if there exists t ≤t such that It is a yes-instance. IfP is NP-hard, then Q does not admit a polynomial kernel unlessNPcoNP/poly [6].

Proposition 4. Clever Shopper admits no polynomial kernel unless NP coNP/poly.

3 Positive Results

We now give exact algorithms for Clever Shopper: a polynomial-time algo- rithm for the case where every shop sells at most two books, and three param- eterised algorithms based respectively on the number of books, the number of shops, and a bound on the prices.

We give a polynomial time algorithm for the case where each shop sells at most two books. As we shall see in Sect.4, this bound is best possible. Its running time is dominated by the time required to find a maximum matching in a graph with|B∪S|vertices.

Proposition 5. CleverShopperis inPif every shop sells at most two books.

Proof. Let I be an instance of Clever Shopper given by an edge-weighted bipartite graph G = (B ∪S, E, w) and a pair (ds, ts) for each s S, where ds, ts R+. Vertices in S (resp. in B) have degree at most 2 (resp. at least 1). Note that vertices in S can be made to have degree exactly 2, by adding dummy edges with arbitrarily high costs, with no impact on the solution. For b B, letp(b) be the cheapest available price for book b (discount excluded), i.e., p(b) = min{w({b, s})|s∈S}.

Construct a new (non-bipartite) graphG = (B∪S, E, w), as follows: for every shop s∈S, let{b1, b2}=NG(s) (i.e., the two books available at shop s).

– For each i ∈ {1,2}, if w({bi, s}) ts, then add an edge{bi, s} to E with weightw({bi, s}) =ds+p(bi)−w({bi, s}).

– If w({b1, s}) +w({b2, s}) ts, add an edge {b1, b2} to E with weight w({b1, b2}) = ds+p(b1)−w({b1, s}) +p(b2)−w({b2, s}). If edge {b1, b2} existed already, keep only the one with maximum weight.

Note that edges with negative weights may remain: they may be safely ignored, but we keep them to avoid case distinctions in the rest of this proof.

Figure2 illustrates the construction. Since a maximum weight matching forG can be found in polynomial time [8], it is now enough to prove the following claim: G admits a matching of weight at least W if and only if instance I of Clever Shopperadmits a solution of total cost at most

b∈Bp(b)−W.

Assume that instanceI admits a solutionE⊆Eof total cost

b∈Bp(b)−

W. Note thatW 0 (the sum of the minimum prices of the books is an upper bound of the optimal solution). We build a matching M of G as follows. Let s S be anydiscount shop, i.e., a shop whose discount is claimed, and let b1

andb2be its neighbours. Then at least one of them has to be bought fromsto get the discount.

(6)

G b1

b2

b3

b4

b5

p(b1)=12 p(b2)=9 p(b3)=4 p(b4)=8 p(b5)=7

s1

s2

s3

s4

s5

12 10 119 7 4

5 8 8

7

G b1

b2

b3

b4

b5

s1

s2

s3

s4

s5

3 2

1

212 1

Fig. 2.Each shop offers a discount of 3 on a purchase of value10. Bold edges indicate how to obtain optimal discounts: buy bookb1 from shops1, bookb2from shops3, and books b3 and b4 from shop s4. The remaining books are bought at their cheapest available price (so here we buyb5froms5). Our clever customer used the discounts to buy all books for 6 less than if she had bought each book at its lowest price: 3 forb1, 1 forb2, 2 forb3 andb4together.

– If{b1, s} ∈E and{b2, s}∈/E, add{b1, s}toM. The amount spent at this shop isw({b1, s})−ds=p(b1)−w({b1, s}).

– Similarly, if {b2, s} ∈ E and {b1, s} ∈/ E, add {b2, s} to M. The amount spent at this shop isw({b2, s})−ds=p(b2)−w({b2, s}).

– Finally, if{b1, s} ∈Eand{b2, s} ∈E, then add{b1, b2}toM. The amount spent at this shop isw({b1, s}) +w({b2, s})−ds≥p(b1) +p(b2)−w({b1, b2}).

Note that edges added toM are indeed present inE, since in order to obtain the discount froms, the book prices must satisfy the same condition as for creating the corresponding edges. Note also thatM is a matching, since each book can be bought from at most one shop. LetBbe the set of books bought from discount shops. Summing over all these shops, the total price paid for the books inB is at least

b∈Bp(b)

e∈Mw(e).

The books in B \B do not yield any discount, so the total price paid for them is at least

b∈B\Bp(b). Overall, the cost of the books is at least

b∈Bpb

e∈Mw(e), therefore

e∈Mw(e)≥W.

LetM be a maximum weight matching ofGof weightW. For each edgee∈ M, letsebe the shop for whichewas introduced. For an edgee={b, se} ∈M, buy bookbfrom shopse. The price is high enough to reach the threshold for the discount, so we payw({b, se})−de=p(b)−w(e). For an edgee={b1, b2} ∈M, buy booksb1 andb2 together from shopse. We again get the discount, and pay w({b1, se}) +w({b2, se})−de=p(b1) +p(b2)−w(e). Note that fore=f ∈M, se=sf, so we never count the same discount twice. For every other book, buy

(7)

them at the cheapest possible pricep(b), without expecting to get any discount.

The total price paid is at most

b∈Bp(b)

e∈Mw(e) =

b∈Bp(b)−W. We now give a dynamic programming FPT algorithm with the number of books as parameter.

Proposition 6. Clever Shopper admits an FPT algorithm for parameter n with running time O(m3n).

Proof. Given j [m] andB ⊆B, let pj(B) be the price for buying all books in B together from shop sj (discount included), and p≤j(B) be the lowest price that can be obtained when purchasing all books in B from a subset of {s1, . . . , sj}. Our goal is to computep≤m(B).

Forj = 1, clearly p≤1(B) =p1(B) for every B. For any otherj, consider an optimal way of buying the books inB from shops s1, . . . , sj. This way the customer buys some (possibly empty) subset B of books in sj, and the rest, i.e., B\B, at the lowest price from shopss1, . . . , sj−1. Therefore:

p≤j(B) =

pj(B) if j= 1,

minB⊆B{pj(B) +p≤j−1(B\B)}otherwise.

The values ofpj(B) for alljandBcan be computed inO(m2n) time. Then the dynamic programming table requires to enumerate, for allj, all subsets B and B such that B⊆B ⊆B. Any such pairB, B can be interpreted as a vector v ∈ {0,1,2}n, wherei ∈B ⇔vi = 2 and i∈B ⇔vi 1. Therefore, filling the dynamic table takesm3n steps, each requiring constant time.

As usual with dynamic programming, this algorithm yields the optimal price that can be obtained. One gets the actual solution (i.e., where to buy each book) with classic backtracing techniques.

The NP-hardness of Clever Shopper for two shops (using large prices, encoded in binary) and itsW[1]-hardness when the parameter is the number of shops leave a very small opening for positive results: we can only consider small prices (encoded in unary) for a constant number of shops. The following result proves the tractability of this case.

Proposition 7. Clever Shopper admits an XP algorithm running in time O(nmWm), whereW is the sum of all the prices of the instance,nis the number of books, andm is the number of shops.

Proof. We propose the following dynamic programming algorithm, which gener- alises the classical pseudo-polynomial algorithm for Partition. Leti∈[n] and ps [W] for s∈S. Define T[i, ps1, . . . , psm] as 1 if it is possible to buy books 1 toi by paying exactlyps (discount excluded) in shops; and 0 otherwise. For i = 0, T[0, ps1, . . . , psm] = 1 if and only ifps = 0 for all s ∈S. The following formula allows to fill the table recursively fori≥1:

T[i, ps1, . . . , psm] = max

e∈E,i∈eT[i−1, ps1, . . . , psm] whereps=

ps−w(e) ifs∈e, ps otherwise.

(8)

It remains to be checked whether the table contains a valid solution, which requires us to take the discounts into account. Clearly, an entry T[n, ps1, . . . , psm] = 1 leads to a solution if the following holds:

s∈S

ps

s∈S,ps≥ts

ds≤K.

The running time corresponds exactly to the time needed to fill the table:

any of the nWm cells requires at most m look-ups, which yields the claimed

running time.

Proposition 8. Clever Shopperadmits an FPT algorithm for parameter m when all prices are equal.

Proof. We assume without loss of generality that all prices are equal to 1. Let S⊆S. We writefS :B∪S→Nfor the following function:

fS(b) = 1 forb∈B, fS(s) =tsfors∈S, fS(s) = 0 fors /∈S. We write dS =

s∈Sds and tS =

s∈Sts. An f-star subgraph of G = (B∪S, E) is a subgraphG such that the degree of each vertexu∈B∪S is at mostf(u) inG, and every connected component ofGis isomorphic toK1,pfor some integerp.

LetI = (B∪S, E, w,D, K) be an instance of CleverShopperwithw(e) = 1 for alle∈E. We show thatIis a yes-instance if and only if there existsS⊆S with |B| −dS ≤K such that (B∪S, E) admits an fS-star subgraph withtS

edges. AnFPTalgorithm follows easily from this characterisation: enumerate all subsetsS ofS in time 2|S|, and for each subset, compute a maximum fS-star subgraph in timeO(|E|log|B∪S|) [9].

LetE ⊆E be a solution andS be the set of shops whose threshold ts is reached. Since the total price is |B| −dS, we have|B| −dS ≤K. Since every weight equals 1, all vertices ofShave degree at mosttsinE. LetE⊆E be a subset obtained by keeping exactlytsedges incident to eachs∈S and no edge incident tos /∈S. ThenEis anfS-star subgraph of sizetS.

LetG = (B∪S, E) be anfS-star factor of Gof sizetS withS⊆S, and

|B| −dS ≤K. The degree and size constraints force all vertices in S to have degree exactly ts in G. We build a solution as follows: for each bookb∈B, if E contains an edge (b, s) incident tob, then buybfrom shops, otherwise buyb from any other shop. Overall, at leasttsbooks are purchased from a shops∈S,

so the total price is at most|B| −dS.

4 Approximations

Since variants of Clever Shopperare, by and large, hard to solve exactly, it is natural to look for approximation algorithms. However, our hardness proofs

(9)

can be modified to imply the NP-hardness of deciding whether the total price (including discounts) is 0 or more. For instance, in Proposition1, we can set the discounts to T/2 instead of 1, so the Partition instance reduces to checking whether the optimal solution has cost 0. Therefore, we start with the following bad news:

Corollary 1. Clever Shopperadmits no approximation unlessP=NP.

Since this result seems resilient to most natural restrictions on the input structure (bounded prices, bounded degree, etc.), our proposed angle is to max- imise the total discount rather than minimise the total cost. However, maximis- ing the total discount is only relevant when the base price of the books is the same in all solutions (otherwise the optimal solution might not be the one with maximum discount), i.e., each book b has a fixed price wb, andw({b, s}) =wb

for every {b, s} ∈E. We call this variant Max-Discount Clever Shopper. This “fixed price” constraint is not strong (all reductions from Sect.2 satisfy it). In this setting, Proposition1shows that it isNP-hard to decide whether the optimal discount is 1 or 2. This yields the following corollary:

Corollary 2. Max-Discount Clever Shopper is APX-hard: it does not admit a (2)-approximation unless P=NP.

Whether or not Max-Discount Clever Shopper admits a fixed-ratio approximation remains open.

Proposition 9. Max-Discount Clever Shopper is APX-hard even when each shop sells at most3 books, and each book is available in at most 2 shops.

Proof. We reduce from Max 3-Sat (the problem of satisfying the maximum number of clauses in a 3-satinstance), known to beAPX-hard when each literal occurs exactly twice [2]. Let ϕ=C1∧C2∧ · · · ∧Cm be such a 3-CNF formula over a set X ={x1, x2, . . . , xn} of boolean variables. For every 1≤i≤m and 1≤j≤3, leti,jbe thej-th literal of clauseCi. We obtain an instanceIofMax- Discount Clever Shopperby first building a bipartite graphG= (B∪S, E) as follows (for ease of presentation, Ci, xi andi,j will be used both to denote respectively clauses, variables and literals in 3-CNF formula context, and the corresponding vertices inG):

B={i,j: 1≤i≤mand 1≤j≤3} ∪ {xi: 1≤i≤n}

S={Ci: 1≤i≤m} ∪ {ti, fi: 1≤i≤n}

E=E1 E2,p E2,n E3

where

E1={{i,j, Ci}: 1≤i≤mand 1≤j≤3}

E2,p={{i,j, ti}: 1≤i≤mandi,j is the positive literalxi} E2,n={{i,j, fi}: 1≤i≤mandi,j is the negative literalxi}

E3={{xi, ti},{xi, fi}: 1≤i≤n}.

(10)

Observe that each shop sells exactly 3 books and that each book is sold in exactly 2 shops. We now turn to defining the prices, the thresholds and the discounts.

All shops sell books at a unit price. For the shops Ci, 1 ≤i ≤m, a purchase of value 1 yields a discount of 1. For the shopsti andfi, 1≤i≤n, a purchase of value 3 yields a discount of 2. This discount policy implies that, for every 1≤i≤n, a customer cannot obtain a 2 discount both in shopti and in shopfi

(this follows from the fact that the bookxi is sold by both shopsti andfi).

First, it is easy to see that the largest discount that can be obtained is 2n+m (the upper bound is achieved by obtaining a discount in every shopCi

for 1 i m, and in either the shop ti or the shop fi for 1 i n). On the other side, for any truth assignment τ for ϕsatisfying k clauses, a 2n+k discount can be obtained as follows.

– For any variable xi, 1 i n, if τ(xi) = false, then buy 3 books from shopti, and ifτ(xi) =true then buy 3 books from shopfi. Intuitively, if a variable is true, then all negative literals are “removed” byfi, and all positive literals remain available for the corresponding clauses.

– For any clauseCi=i,1i,2i,3 satisfied by the truth assignmentτ, buy booki,j from shopCi, wherei,j is a literal satisfying the clauseCi. Then it follows that

opt(I) = 2n+ opt(ϕ) = 3m/2 + opt(ϕ) (since 4n= 3m)

3 opt(ϕ) + opt(ϕ) (since 2 opt(ϕ)≥m)

4 opt(ϕ).

Suppose now that we buy all books inB for a total discount ofk. First, we may clearly assume thatk2nsince a total 2ndiscount can always be achieved by buying 3 books either from shop ti or from shop fi, for every 1 i n. Second, we may also assume that, for every 1≤i≤n, we buy either exactly 3 books from shop ti or exactly 3 books from shop fi. Indeed, if there exists an index 1≤i≤nfor which this is false, then buying either exactly 3 books from shop ti or exactly 3 books from shopfi instead results in a totalk discount withk≥k (this follows from the fact that we can get a 2 discount fromti or fi but only a 1 discount from any shopCj, 1≤j≤m). We now obtain a truth assignmentτ forϕas follows: for any variable xi, 1≤i≤n, setτ(xi) =false if we buy 3 books from shop ti, and set τ(xi) = true if we buy 3 books from shop fi (the truth assignmentτ is well-defined since, for 1≤i≤n, we cannot simultaneously buy 3 books from shop ti and 3 books from shopfi because of bookxi). Therefore, a clauseCiis satisfied byτ if and only if the corresponding shopCicontains at least one bookli,jwhich is not bought from some other shop tiorfi. If we letkstand for the number of clauses satisfied byτ, then we obtain k≥k2n. It then follows that

opt(ϕ)−k= opt(I)2n−k≤opt(I)2n−k+ 2n= opt(I)−k. Therefore, our reduction is anL-reduction (i.e., opt(I)≤α1opt(ϕ) and opt(ϕ)−

k≤α2(opt(I)−k)) withα1= 4 andα2= 1.

(11)

Proposition 10. Max-Discount Clever Shopperwhere each shop sells at most kbooks admits a k-approximation.

Proof. LetBsbe the set of books sold by shops. Our approximation algorithm proceeds as follows: start with a set of selected shops S =, a set of available booksB =Band sort the shops by decreasing value ofds. Then for each shops, letBs =Bs∩B. If the books inBs are enough to get the discount (

b∈Bs ≥ts), then assign all books ofBs to shops, addstoS and setB =B\Bs. Finally, assign the remaining books to arbitrary shops that sell them.

We now prove the approximation ratio. For anyb B, if b ∈Bs for some s S then letδ(b) = ds, and δ(b) = 0 otherwise. Thus, for any shop s∈ S, ds= |B1

s|

b∈Bsδ(b) 1k

b∈Bsδ(b) due to the degree-k constraint. Note that for each shop of S, the amount spent ats is at least ts, so the total discount obtained with this algorithm isD≥

s∈Sdsk1

b∈Bδ(b).

We now compare the result of the algorithm with any optimal solution. For such a solution, let D be its total discount,S be the set of shops where pur- chases reach the threshold, and, for any s∈S, let Bs be the (non-empty) set of books purchased in shops. Note thatD=

s∈Sds.

Consider a shops∈S. We show that there exists a book b(s)∈Bs with δ(b(s))≥ds. Ifs∈ S∩S, then we take b(s) to be any book in Bs. Either b(s)∈Bs, in which caseδ(b(s)) =ds, orb(s)∈/ Bs, in which caseb(s) was assigned by the algorithm to a shop with a larger discount, i.e.,δ(b(s))≥ds. If s∈S\S, sinces /∈S, at least one book inBsis not available at the time the algorithm considers shops; letb(s) be such a book. Since it is not available, it has been selected as part ofBsfor some earlier shops(i.e.,ds≤ds). Therefore, b(s)∈Bs∩Bs andδ(b(s)) =ds ≥ds. Since the setsBsare pairwise disjoint for s S, we have

s∈Sδ(b(s))

b∈Bδ(b). Putting it all together, we obtain:

D=

s∈S

ds

s∈S

δ(b(s))

b∈B

δ(b)≤kD.

5 Conclusion

We introduced the CleverShopperproblem, a variant of InternetShopping with free deliveries and shop-specific discounts based on shop-specific thresholds.

We proved a number of hardness results, both in the classical complexity set- ting and from a parameterised complexity point of view. We also gave efficient algorithms for particular cases where restrictions apply to the number of books, the number of shops, or the nature of prices.

An interesting angle for future work is that of designing efficient exact algo- rithms for the general cases in which ourFPTalgorithms are not sufficient. Fur- thermore, it would be of interest to determine whether the Clever Shopper problem is FPTfor parametermaximum price +number of shops.

(12)

References

1. Assmann, S., Johnson, D., Kleitman, D., Leung, J.-T.: On a dual version of the one-dimensional bin packing problem. J. Algorithms5, 502–525 (1984)

2. Berman, P., Karpinski, M., Scott, A.D.: Approximation hardness of short symmet- ric instances of MAX-3SAT. In: Electronic Colloquium on Computational Com- plexity (ECCC) (2003)

3. Blazewicz, J., Kovalyov, M.Y., Musial, J., Urbanski, A.P., Wojciechowski, A.: Inter- net shopping optimization problem. Appl. Math. Comput. Sci.20, 385–390 (2010) 4. Blazewicz, J., Bouvry, P., Kovalyov, M.Y., Musial, J.: Internet shopping with price

sensitive discounts. 4OR12, 35–48 (2014)

5. Blazewicz, J., Cheriere, N., Dutot, P.-F., Musial, J., Trystram, D.: Novel dual dis- counting functions for the internet shopping optimization problem: new algorithms.

J. Sched.19, 245–255 (2016)

6. Bodlaender, H.L., Jansen, B.M.P., Kratsch, S.: Kernelization lower bounds by cross-composition. SIAM J. Discret. Math.28, 277–305 (2014)

7. Cesati, M.: Perfect code is W[1]-complete. Inf. Process. Lett.81, 163–168 (2002) 8. Edmonds, J.: Paths, trees and flowers. Canad. J. Math. 449–467 (1965)

9. Gabow, H.N.: A note on degree-constrained star subgraphs of bipartite graphs.

Inf. Process. Lett.5, 165–167 (1976)

10. Jansen, K., Kratsch, S., Marx, D., Schlotter, I.: Bin packing with fixed number of bins revisited. J. Comput. Syst. Sci.79, 39–49 (2013)

11. Karp, R.M.: Reducibility among combinatorial problems. In: Miller, R.E., Thatcher, J.W. (eds.) Proceedings of a Symposium on the Complexity of Com- puter Computations. The IBM Research Symposia Series, pp. 85–103. Plenum Press, Yorktown Heights (1972)

12. van Bevern, R., Komusiewicz, C., Niedermeier, R., Sorge, M., Walsh, T.: H-index manipulation by merging articles: models, theory, and experiments. Artif. Intell.

240, 19–35 (2016)

Références

Documents relatifs

Avant même sa création, c’est dans cet esprit déjà que des responsables de la Bibliothèque cantonale accompagnaient le chef du Département de l’instruction publique

Access and use of this website and the material on it are subject to the Terms and Conditions set forth at Mark XI Energy Research Project: summary of results, 1978-1981

Towards a goal of creating an interpretable visualization, our proposed in- teractive PPCA (iPPCA) model allows the user to freely move points in the visualization to

The authors proposed that common cognitive representations are involved both in the perception and in the planning of an action, as suggested in recent studies which

SMRs Greening measures Equivalent practices N° BMP GAEC1 buffer strips GAEC4 minimum soil cover GAEC5 minimum land management to limit erosion GAEC6 maintenance

On the positive side, we prove that for every ǫ &gt; 0, a connected graph with minimum degree at least ǫn has bounded rainbow connectivity, where the bound depends only on ǫ, and

We propose AESCB (approximate ESCB), the first algorithm that is both computationally and statistically efficient for this problem: it has a state-of-the-art regret bound and

linear maximization over X can be done in polynomial time in the dimension, so that AESCB is indeed implementable in polynomial time, see the complete version of this work where