Internet Shopping, Towards Bi-Criteria Optimization

Internet Shopping, Towards Bi-Criteria Optimization Nathana¨el Cheriere Training course performed between May 13 and July 12, 2013 in team MOAIS from ...
Author: Spencer Bridges
0 downloads 2 Views 558KB Size
Internet Shopping, Towards Bi-Criteria Optimization Nathana¨el Cheriere Training course performed between May 13 and July 12, 2013 in team MOAIS from INRIA Grenoble

Supervisors Denis Trystram ([email protected]) Pierrre-Fran¸cois Dutot ([email protected]) Abstract This report focus on the Internet Shopping Problem, an optimization problem where the objective is to minimize the total cost of products bought on various websites while taking into account shipment costs and possible discounts. A new heuristic is introduced which provides approximated solutions and both an upper bound and an optimality result in a simplified case are proved. A more realistic model is used to create a benchmark on which the algorithm is tested and compared to previous solutions. To extend the study, the bi-criteria optimization on both the delivery times and the cost is explored, an algorithm is given and some examples are analysed. Keywords: Internet shopping problem, optimization, bi-criteria optimization, algorithms

1

1

Introduction

With the increasing importance of online shops, anyone have access to a huge variety of websites to buy items. But those have not only different prices but also various delivery fees or price sensitive discounts such as 5% off if more than 200e of products are bought or free shipping if a certain amount of money is spent in the shop. Choosing where to buy to save the maximum of money is difficult as soon as more than a couple of items are concerned. The Internet Shopping Problem introduced by Blazewicz et al. [2] in 2010, is the model for this variety of situation: one tries to get the products she/he wants for the minimum possible price. They proved the problem to be NP-hard and provided some heuristics with practical results within a few percent of an optimal solution. But this problem can be extended by taking into account shipments delays as well. Indeed, saving money is important for many families, but it is not the only constraint as delivery time may also be important. As an example, someone can wish to buy a gift for a birthday: she/he wants the present to be delivered before the party and not after. In that case, time becomes the main criterion but it is still possible to save some money within the time constraint. Improving on the results from Blazewicz et al., we provide here a new heuristic which overcomes some of the weaknesses of the previous ones, and extend the theoretical approach with proven approximation upper bound and an insight into how to optimize the delivery times as well as the overall cost. The report is structured as follows. Notations are defined in the end of this section. Section 2 focus on the state of the art, mainly results proven by Blazewicz et al. in their articles. Section 3 presents the new algorithm, provide an upper bound for the solutions provided and an optimality result in a particular case. In section 4 the model for the benchmark is introduced and tests of the algorithms are studied. Section 5 presents an extension of the problem: the delivery time is taken into account and must be optimized like the cost, a new heuristic is proposed and some examples are analysed.

Notations and Problem Let consider a buyer who wants to buy a set of items which are sold in at least one of a set of online shops but not necessarily in all of them. They have each a different discount strategy such as price sensitive discount and some delivery fees: the objective is to minimize the total cost of the products bought.

2

Here are some useful variables and function: Data for the problem M = {1, ..., m} - Set of internet shops indexed by i N = {1, ..., n} - Set of items to buy indexed by j Ni ⊂ N - set of products available in shop i pij - Standard price of product j in shop i. If the product is unavailable pij = ∞ (di , ti ) - delivery fee and time of shop i. If many delivery options are available, the whole shop can be duplicated as many times as needed to take into account all possibilities. fi (T ) - discount function such as fi (T ) = gi (T )+hi (T ) with gi concave, nondecreasing and gi (0) = 0, hi a step function decreasing (so hi (0) = 0) and ∃β > 0, ∀T ≥ 0, β ∗ x ≤ fi (T ) ≤ T Variables used pmax (j) = maxi∈M |pij 6=∞ pij pmax (E) =

P

j∈E

pmax (j) - E is a subset of N

tmin (j) = mini∈M |j∈Ni ti - minimum time to get j delivered Si - Basket, set of all items bought in shop i, Si = {j ∈ Ni |xik = 1} (

di + j∈Si pij if Si 6= ∅ Ti (Si ) = Total price of items bought in the 0 elseway shop i. If no Si is specified Ti = Ti ({j ∈ Ni |xij = 1}). (

1 0

(

1 if x = y 0 elseway

xij =

δxy =

P

if item j is bought in shop i - decision variable otherwise

With those notations the mathematical description of the Internet Shopping Problem can be written as: min

X

fi (Ti (Si ))

i∈M

∀j ∈ N,

X i∈M

3

xij = 1

2 2.1

State of the art Theoretical results

The Internet Shopping Problem is close to the Facility Location Problem, even if they are not sub-cases each from the other the Uncapacitated Facility Location Problem is a particular case of both[1]. Using this fact, the Internet Shopping Problem has been proved to be NP-hard[2] in the general case. It is also APX-hard like the Non-Metric Uncapacitated Facility Location Problem[9]. Moreover, unless every problem in NP can be solved in O(nO(log log n) ), the approximation factor is greater than 1 + ln n.

2.2

Branch And Bound, PCS and PCS+

Finding an exact solution to this problem takes an exponential time but to be able to compare the result of heuristics to an optimal solution, a Branchand-Bound algorithm has been implemented with some improvements to skip solutions that are not optimal. Furthermore, it is interesting to compare the new heuristic to existing algorithms that are already in use in price comparison sites available on Internet like PCS and its improved version PCS+. PCS always chooses the shop in which the product is the cheapest, while PCS+ selects the shop with the minimum price plus delivery fee for every item.

2.3

Existing heuristics

Algorithm 1 G1 Require: Number of shops m Require: Number of products n Require: Products available in shop i, Ni Require: Order function on the products σ Require: Functions fi Require: Prices pij Require: Delivery fee di Output: Array of baskets S 1: N := {1..n} 2: for i := 1 to m do 3: S[i] := ∅ 4: end for 5: for j := 1 to n do P 6: Select k ∈ M such as i∈M fi (Ti (V [i]) + δik pkσ(j) ) minimal and σ(j) ∈ Nk 7: S[k] := S[k] ∪ {σ(j)} 8: end for 9: return S

4

Two greedy heuristics were suggested in Jacek Blazewicz et al.[1]: The first one G1 (Algorithm 1) puts each item j in the basket Si that will minimize the total cost and then repeats this operation for all the products. The order in which the items are picked up is important and especially the first one, so it must be given as a parameter. G1 is fast: its complexity is O(nm) which is good to quickly give a feasible solution but it is very dependent on the first item chosen. Besides, in some cases the approximation can be n times worse than the optimal solution[1] so G2 (Algorithm 2) has been designed to counter balance this problem. G2, unlike G1, starts by choosing a shop in which items should be bought: the one chosen have the lowest average price of items including delivery fees. P For each shop i the valuation Vi = (di + j∈Ni pij )/|Ni | is calculated, then from the shop k which has the lowest valuation Vk , the set S of the α% cheapest available items are taken. Then those items are removed from the shops ∀i ∈ M, N i := N i\S and dk is updated to the value dk = 0 because the delivery fee for shop k has already been paid. Algorithm 2 G2 Require: Number of shops m Require: Number of products n Require: Products available in shop i Ni Require: Functions fi Require: Prices pij Require: Delivery fee di Require: Parameter α Output: Array of baskets S 1: while N 6= ∅ do 2: for i ∈ M do 3: if S[i] = ∅ thenP 4: V [i] := (di + j∈Ni ∩N pij )/|Ni ∩ N | 5: else P 6: V [i] := ( j∈Ni ∩N pij )/|Ni ∩ N | 7: end if 8: end for 9: Select k such as V [k] = min{i∈M |Ni ∩N 6=∅} V [i] 10: for c := 1 to max(1, α ∗ |Nk ∩ N |) do 11: Select l such as pil = minj∈N i∩N pij 12: S[k] := S[k] ∪ {l} 13: N := N \{l} 14: end for 15: end while 16: return S

5

The complexity of G2 is O(n2 m) which is slightly more than for G1. Nonetheless, it is still linear in the number of shops, the value that should be the biggest for an average consumer. These two heuristics provide efficient results. However, to get the best out of them, both must be used with many parameters and then take the best solution obtained. Because of these observations and the fact that they need some parameters, a new algorithm has been created.

3 3.1

A new algorithm G3

The idea behind the new heuristic that is proposed, denoted as G3 (Algorithm 3), is to make groups of products to maximize the ratio Vi of how much is saved to how much it costs at its maximum in all the shops. In order to do so, for every shop, the item with the biggest ratio is put aside into a temporary basket Ci . If by adding another product this ratio can be increased, the product is also taken into Ci and this process continues until there is no more item available in the shop or if the ratio cannot be increased any more. Then the shop k with the highest ratio Vk is chosen and all the items in Ck are placed in Bi to be bought from this shop. This step is repeated until all the products of the shopping list are bought. The expression for Vi takes into account the basket Bi containing all what has already been chosen for this shop before and the temporary basket Ci : fi (Ti (Bi ∪ Ci )) − fi (Ti (Bi )) Vi (Ci , Bi ) = 1 − pmax (Ci ) G3 has a complexity in O(n3 m) which is more than G1 (Algorithm 1) and G2 (Algorithm 2) but G3 does not need any extra tuning and does not depend on the order of items. G3 has some interesting properties such as an upper bound and optimality in some particular cases.

3.2

An upper bound for the approximation

Theorem 1. For an instance of the Internet Shopping Problem with n products and m shops, with an optimal solution of cost c∗ , and ∀i ∈ M, ∀x ∈ P [0, i∈M maxj∈Ni pij ], fi (x) ≥ βx, the cost of the solution suggested by G3 (Algorithm 3) cG3 is such as: cG3 ≤ (n − 1) max di + i∈M

6

c∗ β

Algorithm 3 G3 Require: Number of shops m Require: Number of products n Require: Products available in shop i, Ni Require: Functions fi Require: Prices pij and pmax (j) Require: Delivery fee di Output: Array of baskets S 1: N := {1, .., n} 2: while N 6= ∅ do 3: for i = 1 to m do 4: Ci := ∅ 5: vali := 0 6: ∀j ∈ N ∩ Ni , r[j] := Vi ({j}, S[i]) 7: Select k such as r[k] = maxj∈Ni ∩N rj 8: repeat 9: Ci := Ci ∪ {k} 10: vali := r[k] 11: ∀j ∈ N ∩ Ni \Ci , r[j] := Vi (Ci ∪ {j}, S[i]) 12: Select k such as r[k] = max{j∈Ni ∩N \Ci } rj 13: until N ∩ Ni \Ci = ∅ or r[k] < vali 14: end for 15: Select k such as valk = max{i∈{1..m}|Ci 6=∅} vali 16: S[k] := S[k] ∪ Ck 17: N := N \Ck 18: end while 19: return S

Proof. Let S ∗ be an optimal solution. Let us consider the k-th iteration of G3, for each previous iteration l, the products C (l) were chosen from shop i(l) , so all is left to find a shop for S the products N (k) = N \ 1

Suggest Documents