Keywords

1 Introduction

In this paper we address a recent situation created by the explosive growth of web systems, which can be accessed from different devices. For these reasons we have developed a framework to support adaptive elements in Web pages. Web pages can be accessed by different platforms with different browsers and through different devices such as laptops, tablets or cellphones. In particular we focus on adaptive menus. The idea is to create a mechanism able to adapt the menus according different devices or browsers to optimize the selection patterns and their implementations. Developers are able to define rules for menu adaptation according to the features of the device and browser in use. We propose a framework using an Adaptive Constraint Programming technique to optimize the decision of developers. Constraint Programming (CP) is a programming paradigm able to find efficient resolution in optimization problems. In Constraint Programming a problem is defined in term of variables and constraints. The variables hold a domain and represent the unknowns of the problem, while the relations among them are modeled as constraints. We formulate an adaptive system for constraint propagation which aims at reducing domains by eliminating those values that do not lead to any solution. This is carried out by a enforcing a local consistency to the problem. The idea is to create a system capable of selecting the best propagator from a portfolio of propagators to solve our specific problem. This paper briefly describes the selected adaptation patterns and their implementation.

2 Constraint Programming

The pioneering works on constraints were motivated mainly by problems arising in the field of picture processing [4]. Artificial Intelligent research, concentrated on difficult combinatorial problems, it has contributed to considerable progress in constraint-based reasoning. Many powerful algorithms were designed that became a basis of current constraint satisfaction algorithms [1].

In computer science, constraint programming is a programming paradigm where in relations between variables are stated in the form of constraints. Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found [5]. This makes constraint programming a form of declarative programming. The constraints used in constraint programming are of various kinds: those used in constraint satisfaction problems [8], those solved by the simplex algorithm, and others strategies. Constraints are usually embedded within a programming language or provided via separate software libraries [2, 7]. Constraint programming can be expressed in the form of constraint logic programming [3], which embeds constraints into a logic program. Whatever the language in which it is implemented, the problems should be modeled as a constraint satisfaction problem (SCP).

2.1 Constraint Satisfaction Problems

A CSP is a formal representation of unknowns variables , and the relations among them is defined as constraints. Formally, a CSP \(\mathcal P\) is defined by a triple \(P=\left\langle \mathcal X,D,C \right\rangle \) where:

  • \(\mathcal X\) is a set of variables \(\mathcal X = \left( x_{1}, x_{2}, \ldots , x_{n} \right) \).

  • \(\mathcal D\) is a set of corresponding domains \(\mathcal D = \left( d_{1}, d_{2}, \ldots , d_{n} \right) \) such that \(x_{i} \in d_{i}\), and \(d_{i}\) is a set of possibles values for \(x_{i}\).

  • \(\mathcal C\) is a set of constraints \(\mathcal C = \left( c_{1}, c_{2}, \ldots , c_{m} \right) \), and a constraint \(c_{j}\) is defined as a subset of the Cartesian product of domains \(d_{j_{1}}\times \cdots \times d_{j_{n_{j}}}\), for \(j =\left\{ 1, \ldots ,m\right\} \).

Then a solution to a CSP is an assignment \(x_{i}\rightarrow a_{i}\) such that \(a_{i} \in d_{i}\) for \(i = \left\{ 1, \ldots ,n \right\} \) and any constraint \(c_{j}\) is violated, for \(j =\left\{ 1, \ldots ,m\right\} \).

3 Framework for Adaptive Web Systems

The diversity of devices available has changed the way we access to web systems. At the same time, it has created a number of challenges for application developers. It has become more and more important to offer solid user experiences to an increasing number of contexts. The developers can create different copies of the same system to work with the different devices or we can create a mechanism to adapt a web system to different devices on real time. To adapt the characteristics of the browsers or devices exists a single code that is able to provide users with increasingly rich user interfaces, based on the characteristics of the platform, but also change the structure of the user interface to adapt to different form factors, in response to different platforms.

The first step is detecting the context of execution. This can be done, either on the server, or directly in the browser. Server side detection explores the user agent string sent by the browser in the HTTP requests. This supports obtaining detailed information about the browser and the device being used.

Fig. 1.
figure 1figure 1

Adaptive constraint propagation.

Client side detection is performed directly in the browser, and a number of JavaScript libraries are available to support it. With these libraries we can get features, such as support for HTML5 or CSS3 in the browser, touch or georeferencing capabilities in the device [6].

We propose a framework using an Adaptive Constraint Programming technique to optimize the pattern selection for an adaptive menu in a web system. The first step is to model de pattern selection as a CSP problem, for this we propose define the variables of the problem as X=set of characteristics, the domain of the variables determines the possible patterns suitable for each characteristic. The constraints determines de possible combination of characteristics to adequate the system to the different browsers or devices.

The proposed framework implements an autonomous technique to allow the CP solver to adapt its own parameters, to selects the best propagation strategies. That is presented in Fig. 1, where the framework uses a strategy independent of the problem domain, that operates at a higher level of abstraction than the solver. It decides which strategy is applied next during the search. This decision is guided by the ranking generator which evaluates the performance of strategies. The ranking generator can be implemented using a genetic algorithm.

4 Conclusion

In conclusion we have proposed a framework able to select the suitable pattern to support adaptive elements in Web pages. The proposed framework uses an Adaptive Constraint Propagation techniques. We propose an adecuate model to adpat the pattern selction to a CSP. Also we present the scheme to representa the Adaptive Constraint Propagation framework.