3.2 Solving Method
The proposed solving method is shown in Algorithms
1, 2 and 3. Algorithm 1 returns the Pareto set accord-
ing to the CP-net (qualitative preferences) and the set
of constraints. This is basically a backtrack search
algorithm assigning variables sorted in a topological
order. Once the Pareto set is obtained, 2 and 3 are
then applied to determine weights to each optimal
solution (based on the quantitative preferences) and
to return an ordering of these solutions.
To better describe the solving method, let us con-
sider the example depicted in Figure 1. The WCP-
net is defined as a set of two variables (Memory and
Screen), each with its own preference table. For the
variable Memory, the client prefers 12 GB of mem-
ory three times more than 8 GB. For the screen vari-
able, when the memory value is 12 GB, the client
prefers a 13-inch screen two times more than a 15-
inch. For a memory of 8 GB, the client prefers a 15-
inch screen four times more than a 13-inch. The rela-
tion and level among attributes can be clearly defined
as well. For instance, the variable memory (parent)
is preferred five times more than the variable screen
(child). Quantitative preferences are defined as a set
of two variables (Processor and HardDrive), each one
with its preference table. For the variable Processor,
the client has a preference for a 2.7 GHz processing
speed at a value level of 8 and a 2.9 GHz speed at a
value level of 4. For the HardDrive variable, the client
shows a value level of 5 for a 1TB and a value level
of 2 for a 2TB. We will show through the following
equations how to compute the weighted values of the
qualitative data represented as a WCP-net for the two
variables Memory and Screen in order to sum those
weights with the values level of the quantitative pref-
erences. WM and WS represent the weights for vari-
ables Memory and Screen respectively.
WM + WS = 1 (1)
WM + WS = 5WS + WS = 6WS = 1 (2)
WS = 0.16 (3)
WM = 0.84 (4)
(12GB, 13 − inch) = (0 × 0.84) + (0 × 0.16) = 0
(5)
(12GB, 15 − inch) = (0 × 0.84) + (2 × 0.16) = 0.32
(6)
(8GB, 13 − inch) = (3 × 0.84) + (4 × 0.16) = 3.16
(7)
(8GB, 15 − inch) = (3 × 0.84) + (0 × 0.16) = 2.52
(8)
The best outcome has less weight according to the
WCP-net and the quantitative preferences (12 GB, 13-
inch, 2.9 GHz, 2 TB) = (0+4+2) = 6. The worst out-
come has a high weight (8 GB, 13-inch, 2.7 GHz,
1 TB) = (3.16 + 8 + 5) =16.16. It is assumed that
there are two hard constraints, a global constraint
being the client’s budget, and a local constraint be-
ing the available attributes such as speed, screen size
and hard drive capacity. The maximum price and lo-
cal constraints can be expressed as incompatible tu-
ples among different components of the product such
as laptop. As an example, the two component (12
GB, 15-inch) and (2.7 GHz, 2 TB) are incompatible.
Therefore any tuple in the optimal solution with those
components will not be listed as a set of optimal solu-
tions because they do not satisfy the local constraints.
Once the set of qualitative data with a weighted exten-
sion to CP-nets along with quantitative preferences is
obtained, the list of optimal solutions has to satisfy the
hard constraints. For example, tuple (12 GB, 13-inch,
2.9 GHz, 2 TB) satisfies the local constraints.
Algorithm 1: WPrefC method - finding Pareto set.
Input: CP-net N and a set of constraints C
Output: The Pareto Set S (initially empty)
1. let > be topological ordering over N
2. let T be a stack
3. push {} into T
4. while (T is not empty)
5. n ← pop first element
6. if (n is complete assignment)
7. if (n is not dominated by any element in S )
8. add n to S
9. else
10. for every value v
i
of next variable V
i
w. r. t. >
11. if (n ∪ (V
i
, v
i
) is consistent with C )
12. push n ∪ (V
i
, v
i
) into T
13. Return S
4 SYSTEM DESCRIPTION
Our online shopping system has been developed using
the following software:
1. Programming environment: Microsoft Visual Stu-
dio 2013 (ASP.NET - C Sharp).
2. Programming languages: Visual C Sharp
2012/2013 (ASP.NET MVC 5 Web Application),
HTML and JavaScript.
Managing Weighted Preferences with Constraints in Interactive Applications
257