## 2 Problem formulation

The Internet shopping problem with price-sensitive discounts, denoted as IS, is formulated as follows.

A customer wants to buy products of a given set $$N=\{1,\ldots ,n\}$$ in a given set of Internet shops $$M=\{1,\ldots ,m\}$$ at the minimum total final price. The input parameters and decision variables are:

• $$d_i$$—price of delivery of all products from shop $$i$$ to the customer;

• $$p_{ij}$$—standard price of product $$j$$ in shop $$i$$;

• $$N_i$$—subset of products of the set $$N$$ in shop $$i$$;

• $$M_j$$—subset of eligible shops in which product $$j$$ can be bought;

• $$S_i$$—subset of products selected by the customer in shop $$i$$ (decision variable), $$N=\cup _{i=1}^m S_i$$ and $$S_i\cap S_j=\phi , i\ne j$$, for a feasible solution;

• $$T_i(S_i)=d_i+\sum _{j\in S_i}p_{ij}$$—total delivery and standard price in shop $$i$$ for a given set of products $$S_i\subseteq N_i$$;

• $$f_i(T)$$—discounting function for the final price, a concave increasing differentiable or concave piecewise linear function of total delivery and standard price $$T$$ in shop $$i$$, defined at all points $$T\ge 0, f_i(0)=0$$.

A mathematical programming formulation for the problem IS is:

\begin{aligned}&\min \ \ \ \sum _{i=1}^m f_i(d_iy_i+\sum _{j\in N_i} p_{ij}x_{ij}),\\&\text{ s.t. } \ \sum _{i\in M_j} x_{ij}=1,\ j=1,\ldots ,n,\\&0\le x_{ij}\le y_i,\ j\in N_i,\ i=1,\ldots ,m,\\&x_{ij}\in \{0,1\},\ y_i\in \{0,1\},\ j\in N_i,\ i=1,\ldots ,m. \end{aligned}

where $$x_{ij}=1$$ if and only if product $$j$$ is selected in shop $$i$$ and $$y_i=1$$ if and only if at least one product is selected in shop $$i$$.

## 3 Approximability

Among other results in Blazewicz et al. (2014) and partially in Blazewicz and Musial (2011), two heuristics, denoted as G1 and G2, for the problem IS were suggested and computer experiments with them were provided.

Heuristic G1 considers products in a certain order. It is run for various product orders and the best solution is presented to the customer. Let the products be ordered $$1,\ldots ,n$$. Values of total delivery and standard price for all shops are initially set as $$T_i=d_i, i=1,\ldots ,m$$. In iteration $$j$$, product $$j$$ is selected in its eligible shop $$i\in M_j$$ with the minimum value $$f_i(T_i+p_{ij})$$, and the corresponding $$T_i$$-value is reset such that $$T_i:=T_i+p_{ij}$$.

An example was given, and it was stated that for this example heuristic G1 provides a solution whose value is $$n$$ times worse than the optimum. This statement is incorrect. In the example, there are two shops, no discounts and $$d_1=0, p_{1j}=W-1, d_2=W, p_{2j}=0, j=1,\ldots ,n$$.

It was claimed that for any product sequence, heuristic G1 will select all the products in shop 1, which will cost $$nW-n$$, while an optimal solution is to select all the products in shop 2, what will cost $$W$$. The first part of this claim is incorrect, because heuristic G1 will select the first product in shop 1 and all other products in shop 2 with the total cost of $$2W-1$$.

The example and the approximation ratio of $$n$$ will work for a different heuristic, in which the $$T_i$$-values are not updated, that is, product $$j$$ is selected in the eligible shop with the minimum value $$d_i+p_{ij}$$.

Regarding heuristic G1, consider another example, in which there are $$m-1$$ products and $$m$$ shops. The input parameters are: $$d_i=0, p_{ij}=W-1, i=1,\ldots ,m-1, d_m=W, p_{mj}=0, j=1,\ldots ,m-1$$. Then for any product sequence, heuristic G1 will select one product in each of the shops $$1,\ldots ,m-1$$, which will cost $$(m-1)(W-1)$$, while an optimal solution is to select all the products in shop $$m$$, what will cost $$W$$. Thus, heuristic G1 can provide a solution, whose value is $$m-1$$ times worse than the optimum.

Further results on the approximability of the problem IS can be obtained from its relation to the (Weighted) Set Cover problem.

The (Weighted) Set Cover (Vazirani 2001): Given a set $$S$$, a family $$F$$ of subsets of $$S$$ such that $$\cup _{X\in F}X=S$$, and subset weights $$w_X\ge 0, X\in F$$, find a sub-family $$G\subseteq F$$ such that $$\cup _{X\in G}X=S$$ and the total weight $$\sum _{X\in G}w_X$$ is minimized.

The problem (Weighted) Set Cover is a special case of the problem IS with no discounts, studied in Blazewicz et al. (2010), which is obtained by associating each shop $$i$$ with its set of eligible products $$N_i$$ and defining $$N=S, M=F, f_i(T)=T$$ for all $$i, d_i=w_X$$ if $$N_i=X\in F$$ and $$p_{ij}=0$$ for all $$i$$ and $$j$$. It is clear that the set of shops in which at least one product is selected in an optimal solution of the obtained problem IS presents an optimal solution of the original problem SC. The optimal values of both problems coincide.

By this fact, the problem IS with no discounts cannot be approximated in polynomial time with the ratio $$c\ln n$$ for some constant $$c, 0<c<1$$, unless $$\mathcal P=NP$$, which is established for the (Weighted) Set Cover problem by Raz and Safra (1997).

On the positive side, the problem IS with no discounts is equivalent to the Facility Location Problem, for which Hochbaum (1982) presented an $$O(n^3)$$ time algorithm with the approximation ratio $$1+\ln n$$. Note that there is no contradiction with the above-mentioned inapproximability ratio of $$c\ln n$$, because the latter $$c$$ is $$<$$1.

A better approximation is possible for the so-called metric case, which is satisfied for the problem IS with no discounts if $$p_{ij}+p_{i^{\prime }j}+p_{i^{\prime }j^{\prime }}\ge p_{ij^{\prime }}$$ for any products $$j$$ and $$j^{\prime }$$ and any shops $$i$$ and $$i^{\prime }$$. In the metric case, the problem IS with no discounts can be solved in a quasilinear time of $$n$$ with the approximation ratio 1.488 by the algorithm of Li (2011).