# Dynamic Pricing of a Web Service in an Advance Selling Environment

Authors: Ehram Safari; Masoud Babakhani; Seyed Jafar Sadjadi; Kamran Shahanaghi; Khadijeh Naboureh
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Consider a web service with different quality of service levels where users may purchase their required web service through a reservation system. The service provider adjusts prices of web service classes over a prespecified time horizon to manage demand and maximize profit. Users may cancel their services as long as they pay a penalty. One of the important challenges for service providers is capacity limitation of the resources employed in offering the web service. Thus, taking this important proposition into account makes pricing strategies considered by the provider has more credit. Another important factor in determining pricing strategies discussed in the present paper is the market influence which can increase or decrease the price that the provider offers. This paper develops a continuous time optimal control model for identifying pricing strategies for the web service classes. We study the optimality condition of the considered model based on maximum principal and propose an algorithm to obtain the optimal pricing policy. Moreover, we perform numerical analyses to evaluate the effect of some parameters on control and state variables and objective function. In addition, we compare the proposed algorithm with genetic algorithm (GA) and simulated annealing (SA) available in Matlab.


---

## Body

## 1. Introduction

In recent years, web services have achieved popularity as an effective and efficient technology for developing and incorporating web applications. Web services are loosely coupled and reusable software components that semantically encapsulate discrete functionalities and are distributed and programmatically accessible over the standard Internet protocols [1–6]. Unlike developed or licensed packaged applications, web services include specific business functionalities that can be rented over the network (such as Internet) to users by paying a fee [7]. For example, Google’s AdWords web service helps users to create computer codes to connect directly with its AdWords platform. Using web services for system development has several advantages. In addition to the universal interoperability and availability of web services, users acquire lower costs and more frequent software updates. Furthermore, a provider not only provides the service implementations, but also procures the technical supports [8].Despite abundant benefits, there are serious concerns about the determining pricing strategies for web services. It is essential for a service provider to deploy an appropriate pricing method. A pricing method is employed as an effective access control tool by offering adequate motivations to consumers so that they select proper service levels. In other words, as users decide to buy a web service, they consider its quality of service (QoS) as well as its price. As a result, the provider usually offers different service classes of the web service to satisfy users with different requirements. Each web service class has particular QoS, which is defined as a group of service measures representing the degree of user agreement of the service [9]. Common measures of QoS are response time, reliability, and availability [10]. Without a suitable pricing strategy for the web service, any QoS based web service class is unusable; if we determine no price for any class, all users will choose some classes with high priority QoS. In other words, identifying an appropriate price for any web service class should give users an encouragement to link the “right” web service class.Limitation of the resources employed, like storage throughput, network bandwidth, CPU time, is one of the most crucial challenges the service provider encounters in offering the web service to the users. Thus, the provider should manage his/her limited resources in a way to get the most desirability out of his/her accessible resources. The provider may employ technical strategies to manage his/her limited resources. This can lead to some problems like dissatisfaction of the users with different needs, inability of the providers in standing by their commitments due to inability in managing demand, and an accretion of technical complexities in offering the web service. As a result, we can reduce the effects of such problems by categorizing the web service in classes with different QoS for users with different needs and selling it before consumption, and adopting a dynamic pricing mechanism to manage demand for web service classes.One of the appropriate pricing methods for identifying pricing strategy for the web services is dynamic pricing in which the provider adjusts prices to the consumers based on the value that the customers consider to the service. The dynamic pricing models have been used in many industries, such as retailing, manufacturing, airlines, and e-business where the capacity of the resources is fixed in short-term. Accessibility of the necessary information for demand, ease of changing prices, and availability of required decision tools for evaluating the demand data in e-commerce settings motivate us to employ the dynamic pricing as an efficient method to obtain price of the web service [11–14].One of the common methods in selling services is advance selling. This mostly happens because in service environments there is the risk that in the moment of offering service some of the service capacity may not be sold. By applying this method, the provider can manage his/her service capacity better. Moreover, having an advance selling, the service provider can increase his/her profit gained from cancellation revenue. Such selling method can also be applied to the web service and significantly help the provider in increasing profit and better managing resource capacity of the web service.One of the most important factors affecting the online pricing is market influence which is usually determined by using features such as the number of competitors, consumer involvement, and popularity of the product item among consumers. According to the study of the online markets, some researchers have found that the increasing in the number of the competitors reduces the price charged by a provider [15, 16]. In contrast to the suggestion of reduced price differentiation with increased competition, in a segmented market, the prices charged by a retailer can increase with the number of competitors [17]. Furthermore, Venkatesan et al. hypothesized that on average, prices charged by an online service provider would first increase with the number of competitors, and beyond a specific threshold, an increase in the number of competitors would cause to a decrease in the prices charged [18]. Customer search behaviour relates to the consumer involvement. For services with higher average price levels, consumers may carry out increased search efforts because of higher perceived risk levels. Consequently, the providers can set lower prices where the customer search is estimated to be higher. Interestingly, some empirical evidence indicates the opposite to be true [19]. Popular product items are those well accepted and bought by many of the customers. In online markets, the customers commonly have well communication and exchange information quickly via many electronic channels. Therefore, we expect that price for popular products should be lower than that of nonpopular products [19]. Based on what was stated before, considering the market influence on determining pricing strategies is highly important and failing to consider it makes the specified prices uncreditable. In the present paper the market influence is considered as a parameter which affects demand of the web service classes. In other words, the effects of the mentioned features for the market are considered as the market influence parameter in the demand function.Optimal control theory can be applied as an effective tool for studying the price behaviour of the web service over the time horizon. A continuous time method has the advantage of offering the exact solution for the real-world applications. When a discrete time method is used by someone, it is necessary to select reasonable time steps and specify the prices only at the given times. However, the web service provider may need even more flexibility. To deal with this problem, one can choose small time steps. If the time step is small and the time horizon is relatively large, the problem size in terms of the number of variables and the number of constraints will become extremely large. Thus, a considerable amount of effort is required to find the optimal solution.In this paper, we develop and study a nonlinear continuous time optimal control model for the web service pricing problem in which users buy their required web service over a reservation system and utilize it in the future. We note that the users who reserve the web service have the right to cancel their orders before receiving them. Since different users usually have various requirements, providers typically offer multiple web service classes with different quality of service (QoS) levels. The main part of the proposed model is that required resources are shared among all web service classes. Another important factor in determining pricing strategies which is discussed in the present paper is the market influence which can increase or decrease the price that the provider offers. Furthermore, we suppose that at each time, the demand rate for a web service class is a general function of its price, market influence, and time. The canceled orders at timet uniformly spread across the interval [0,t]. Cancellation penalty cost for canceled orders depends on time and the provider dynamically alters his/her proposed prices to manage the arriving demand effectively.Our paper is associated the service with various classes which have particular QoS. Since early 1990, QoS study has started to examine economic-based network resource allocation tools that support usage-based pricing [20–22]. MacKie-Mason and Varian argued that considering pricing approaches to reduce the congestion cost has desirable side effects [23]. Parameswaran et al. concluded that pricing is an essential activity in a fast data communication network and considered that an appropriate pricing pattern would be important to motivate users to select suitable QoS levels [24]. Ibrahim et al. proposed a novel QoS-based charging and resource allocation framework for wireless networks. The framework assigns resources to clients according to their QoS requirements. They also allowed the network operators to follow a wide variety of strategies, including maximizing revenue and using auction or utility-based pricing [25]. Gupta et al. developed a spot pricing model for intradomain expected bandwidth contracts with loss-based QoS guarantees. They created a nonlinear pricing scheme for the cost recovery from earlier work and extended it to price risk. A utility-based option pricing method was developed to deal with the uncertainties in delivering loss guarantees [26]. Zhang et al. presented a complete study for competitive pricing of packet-switching networks with a QoS assurance in terms of an expected per-packet delay. They offered a structure in which service providers presenting multiclass priority-based services compete to maximize their profit while satisfying the expected delay assurance in each class. They first dealt with the price competition with fixed delay assurance and then extended it to the condition where providers compete on price as well as QoS [27].This paper also considers advance selling in the web service pricing problem. Advance selling take places while the service provider allows users to buy at times prior to the spot period [28]. Nagle and Holden used advance selling for matching demand and supply [29]. Desiraju and Shugan viewed advance selling as a tool for implementing price discrimination. They considered the multiperiod pricing of a service in which the price is a function of forecasted capacity to be used in the future [30]. Shugan and Xie showed that advance selling can be more profitable than spot selling especially in the case where consumers are uncertain about their future consumption states [31]. Mesak et al. employed methods of the optimal control theory and calculus of variations to solve a problem in which a service provider wants to maximize the present value of revenue/profit over a planned horizon in continuous time. They studied the role of the threat of competitive entry and discount rate in describing the optimal allocation strategy of capacity over time. Their paper also demonstrated the supremacy of advance selling in continuous time and studied the effect of changes in model parameters on additional capacity [32]. Jing combined economic aspect of grid computing with resource reservation. He proposed a mathematical model which can identify amount of resource booking. He also considered reputation index of service supplier and economic interest in his model and used numeric analysis to show that there exists an optimal point for the advance booking of resource [33]. Lucas et al. provided a new way of booking resources in which cloud users specify the minimum and maximum number of virtual resources required. They dealt with periods of peak load using a universal framework which contains additions and/or modifications of some components at various levels of the cloud architecture [34].In order to solve the proposed model, we use ideas from the control theory and nonlinear optimization. Optimal control theory has been developed to find optimal approaches to control dynamic systems [35–37]. Nonlinear optimal control models are mainly helpful for the dynamic pricing and other management science applications. For instance, we can see these models in the literature of production planning [38–40], dynamic pricing [41–44], fluid networks [45], and finance [46].Esmaeilsabzali and Day considered a web service provider with limited capacity and requested for his/her service. They offered an online algorithm for selecting from arrived requests based on maximum willingness to pay off requesters. They also presented that both online and offline algorithms for the problem are NP-hard [47]. The optimal pricing and location strategy of a web service intermediary (WSI) was studied by Tang and Cheng. They offered the optimal solution in a linear city model and then extended the results to the more general unit circle model. They showed that the optimal strategy can be computed in terms of using delay cost, integration cost, and prices of the constituent web services [48]. An effective method for computing price of web services based on the quality of service (QoS) and user experience was proposed by Wu. The analysis experiment shows that the web service pricing model works very well and makes the service price more realistic and accurate [49]. Pan et al. provided a dynamic pricing strategy for a provider who offers a web service with different QoS levels. They assumed that the provider usually dynamically changes his/her prices and suggests several class services to satisfy needs of different customers. They analytically solved the model and obtained optimal solution for the web service class prices and capacity. Furthermore, their model had no constraint on the web service capacity and thereby obtaining the optimal solution for their model was very straightforward [50]. Zhang et al. addressed competition between two providers who provide similar web service. Each provider should offer a service level (standard or premium) and charge a price for the chosen service level to meet the QoS guarantee. They first studied the case where the providers choose the service level and price simultaneously, and then extended it to a sequential-move situation [51].In general, surveying the above mentioned research shows that researchers have done no study on the web service pricing problem with considered assumptions. Generally, the contributions of this paper are the following.(i)
We first develop a continuous time model for the dynamic pricing of the web service and then the model is discretized.(ii)
We need certain resources to offer the web service. In this paper it is hypothesized that for each resource there is a definite capacity which is shared among the web service classes.(iii)
We consider market influence as an effective factor in identifying pricing strategies of the web service.(iv)
Demand function for each web service class is a general function of time, its price, and market influence. Cancellation rate and ratio of penalty are general functions of time.(v)
We investigate the structure of the optimal pricing strategies for the model based on the maximum principal.(vi)
We provide a heuristic algorithm to obtain the optimal pricing strategies within the time horizon.(vii)
We perform numerical analyses to evaluate the effect of some parameters on the control and state variables and objective function. In addition, we compare the proposed algorithm with GA and SA.The remainder of this paper is organized as follows. Section2 defines the assumptions and notations we will use throughout the paper and then we explain the considered model. In Section 3, we provide some results on the structure of the optimal solution. In Section 4, we provide a heuristic algorithm to obtain the optimal control variables (prices). In Section 5, we perform numerical analyses to study the effect of the demand function, shared resource capacity, and cancellation rate on the control and state variables and objective function. Furthermore, the proposed algorithm is compared with GA and SA.


## 2. Model Formulation

### 2.1. Model Notations

T: Advance selling period.
n: Number of web service classes.
m: Number of required resources.
c
i: Unit web service cost of ith class.
C
a
j: Shared capacity of jth resource.
e
i
(
t
): Cancellation rate of ith class at time t.
M
f
i
(
t
): Market influence on demand function of ith class at time t.
p
i
(
t
): Unit web service selling price of ith class at time t (control variable).
θ
i
(
t
): Ratio of penalty to sales price when a user cancels his reservation at time t of selling period.
S
R
i
(
t
): Sale revenue function of ith web service class at time t (state variable).
R
L
i
(
t
): Reservation level of ith web service class at time t (state variable).
ca
p
i
j: Needed capacity of resource j for unit web service class i.
d
i
(
p
i
,
M
f
i
,
t
): Demand function for web service class i at price pi and time t.
(i)
We denote byp(t), SRt, RLt, θt, et, c,  Mf(t) the vectors with respective components pit, SRit, RLit, θit, eit, ci, Mfit, i=1,…,n.
(ii)
p
*
(
t
), SR*(t), RL*(t) denote the optimal solution.


### 2.2. Assumptions

This paper considers a finite time horizon model. Although we focus on the web service dynamic pricing, our results can be applied to other service management environments. The developed model includes the subsequent features.(i)
The developed model is time-continuous.(ii)
Users get their needed web service through the booking system and utilize it in the future.(iii)
The provider offers the web service classes with various QoS levels.(iv)
For each web service class, the demand function is dependent on the time and its price and the market influence.(v)
Because the demand function is usually decreasing proportional to price, the term∂di/∂pi(pi,Mfi,t)<0 exists. Moreover, it is hypothesized that as the price increases, variations in the demand decrease which means the term ∂2di/∂pi2(pi,Mfi,t)≤0 exists. This happens due to the sensitivity of the customers to the variations of the price in the higher prices of offering the web service.(vi)
In order to offer the web service, we needm resources. The provider shares the capacity of each resource among the web service classes.(vii)
Users can cancel their order through the booking period.(viii)
The canceled orders at timet are spread uniformly in the interval [0,t].(ix)
Users who cancel their orders are asked to charge penalty.(x)
Cancellation rate and ratio of penalty are general functions of time.(xi)
The objective is to maximize the profit.


### 2.3. Model Description

Since users commonly buy the web service before consumption time, this makes the real-world assumption that users may cancel their orders before receiving them. Users who cancel their orders are asked to charge the penalty. For the web service classi, cancellation revenue over the time horizon [0,T] is given by
(1)∫0Tθi(t)ei(t)SRi(t)dt.
Since we assume the canceled orders for each web service class at time t uniformly spread across the interval [0,t], we can multiply θi(t) by SRiteit  to find the penalty of the customers who cancel their reservation for the web service class i at time t. Integrating θi(t)ei(t)SRi(t) over the interval [0,T] clearly provides cancellation revenue for the web service class i.As the use of the web service becomes general, it can be predicted that the provider will not be able to offer service to all the users. The main cause for this is limitation of resources like network bandwidth and CPU time in offering the web service to the users. So it is hypothesized that there is a need form resources to offer the web service and the employed resources are different in each of the web service classes. Moreover, it is hypothesized that the provider takes into account limited capacity for each of the considered resources which the different classes of the web service use commonly.The proposed model can be written as follows:(2)max⁡∑i=1nSRiT+∑i=1n∫0TθiteitSRitdtaaaaaaa-∑i=1nciRLi(T),(3)s.t.SR˙it=dipit,Mfit,tpit-eitSRit∀t∈0,T,i=1,…,n,(4)R˙Lit=dipit,Mfit,t-eitRLit∀t∈0,T,i=1,…,n,(5)∑i=1ncapijRLiT≤Cajj=1,…,m,(6)dipit,Mfit,t≥0∀t∈0,T,i=1,…,n,(7)pit≥0∀t∈0,T,i=1,…,n,(8)SRi0=0,RLi0=0i=1,…,n.
In this control model, the objective function (2) is the total revenue (composed of the sales revenue and cancellation revenue of the web service classes at time T) minus the total cost (composed of the cost of the total reserved web service for different classes at time T). The state equations (3) and (4) illustrate the change of the sales revenue and reservation level at time t, respectively. Sales revenue level change for the web service class i at time t is equal to the revenue that is obtained from selling the web service class i to dipit,t users at price pit minus the revenue that the provider misses due to users’ cancellation. Since it is supposed that the canceled orders at time t uniformly spread across the interval [0,t], we apply expression SRiteit to calculate the provider missed revenue. Reservation level change rate for the web service class i at time t is equal to orders for the web service class i at time t minus the reserved orders that are canceled by the users at time t. Constraint (5) is defined to make sure that the sum of sold resource j for all the web service classes is equal to or less than the shared capacity of the resource j among all the web service classes. Constraints (6) and (7) are used to confirm that demand functions and prices are nonnegative, respectively. Initial value of the state variables is denoted by (8).


### 2.4. Discretized Formulation

The model can be rewritten by discretizing the time horizon. We partition the time interval[0,T] into N subintervals with lengths τ1,τ2,…,τN and we need to obtain the decision variables of the model in times t1,…,tN such that t1=τ1 and for l=2,…,N, we have tl=tl-1+τl. Replacing tl, dt=τl, dSRi(tl)/dt=SRitl-SRitl-1/τl, and dRLi(tl)/dt=RLitl-RLitl-1/τl into (2) to (7) provides the discretized formulation of the model as follows:
(9)max⁡∑i=1nSRitN+∑i=1n∑l=1NθitleitlSRitlτl-∑i=1nciRLi(tN),(10)s.t.SRi(tl)-SRi(tl-1)=di(pi(tl),Mfi(tl),tl)pi(tl)-ei(tl)SRi(tl)τll=1,…,N,i=1,…,n,(11)RLitl-RLitl-1=dipitl,Mfitl,tl-ei(tl)RLi(tl)τll=1,…,N,i=1,…,n,(12)∑i=1ncapijRLitN≤Cajj=1,…,m,(13)dipitl,Mfitl,tl≥0l=1,…,N,i=1,…,n,(14)pitl≥0l=1,…,N,i=1,…,n,(15)SRi0=0,RLi0=0i=1,…,n.
Equation (9) indicates the discretized objective function of the model. The constraints (10), (11), (12), (13), (14), and (15) discretize the constraints (3), (4), (5), (6), (7), and (8), respectively.


## 2.1. Model Notations

T: Advance selling period.
n: Number of web service classes.
m: Number of required resources.
c
i: Unit web service cost of ith class.
C
a
j: Shared capacity of jth resource.
e
i
(
t
): Cancellation rate of ith class at time t.
M
f
i
(
t
): Market influence on demand function of ith class at time t.
p
i
(
t
): Unit web service selling price of ith class at time t (control variable).
θ
i
(
t
): Ratio of penalty to sales price when a user cancels his reservation at time t of selling period.
S
R
i
(
t
): Sale revenue function of ith web service class at time t (state variable).
R
L
i
(
t
): Reservation level of ith web service class at time t (state variable).
ca
p
i
j: Needed capacity of resource j for unit web service class i.
d
i
(
p
i
,
M
f
i
,
t
): Demand function for web service class i at price pi and time t.
(i)
We denote byp(t), SRt, RLt, θt, et, c,  Mf(t) the vectors with respective components pit, SRit, RLit, θit, eit, ci, Mfit, i=1,…,n.
(ii)
p
*
(
t
), SR*(t), RL*(t) denote the optimal solution.


## 2.2. Assumptions

This paper considers a finite time horizon model. Although we focus on the web service dynamic pricing, our results can be applied to other service management environments. The developed model includes the subsequent features.(i)
The developed model is time-continuous.(ii)
Users get their needed web service through the booking system and utilize it in the future.(iii)
The provider offers the web service classes with various QoS levels.(iv)
For each web service class, the demand function is dependent on the time and its price and the market influence.(v)
Because the demand function is usually decreasing proportional to price, the term∂di/∂pi(pi,Mfi,t)<0 exists. Moreover, it is hypothesized that as the price increases, variations in the demand decrease which means the term ∂2di/∂pi2(pi,Mfi,t)≤0 exists. This happens due to the sensitivity of the customers to the variations of the price in the higher prices of offering the web service.(vi)
In order to offer the web service, we needm resources. The provider shares the capacity of each resource among the web service classes.(vii)
Users can cancel their order through the booking period.(viii)
The canceled orders at timet are spread uniformly in the interval [0,t].(ix)
Users who cancel their orders are asked to charge penalty.(x)
Cancellation rate and ratio of penalty are general functions of time.(xi)
The objective is to maximize the profit.


## 2.3. Model Description

Since users commonly buy the web service before consumption time, this makes the real-world assumption that users may cancel their orders before receiving them. Users who cancel their orders are asked to charge the penalty. For the web service classi, cancellation revenue over the time horizon [0,T] is given by
(1)∫0Tθi(t)ei(t)SRi(t)dt.
Since we assume the canceled orders for each web service class at time t uniformly spread across the interval [0,t], we can multiply θi(t) by SRiteit  to find the penalty of the customers who cancel their reservation for the web service class i at time t. Integrating θi(t)ei(t)SRi(t) over the interval [0,T] clearly provides cancellation revenue for the web service class i.As the use of the web service becomes general, it can be predicted that the provider will not be able to offer service to all the users. The main cause for this is limitation of resources like network bandwidth and CPU time in offering the web service to the users. So it is hypothesized that there is a need form resources to offer the web service and the employed resources are different in each of the web service classes. Moreover, it is hypothesized that the provider takes into account limited capacity for each of the considered resources which the different classes of the web service use commonly.The proposed model can be written as follows:(2)max⁡∑i=1nSRiT+∑i=1n∫0TθiteitSRitdtaaaaaaa-∑i=1nciRLi(T),(3)s.t.SR˙it=dipit,Mfit,tpit-eitSRit∀t∈0,T,i=1,…,n,(4)R˙Lit=dipit,Mfit,t-eitRLit∀t∈0,T,i=1,…,n,(5)∑i=1ncapijRLiT≤Cajj=1,…,m,(6)dipit,Mfit,t≥0∀t∈0,T,i=1,…,n,(7)pit≥0∀t∈0,T,i=1,…,n,(8)SRi0=0,RLi0=0i=1,…,n.
In this control model, the objective function (2) is the total revenue (composed of the sales revenue and cancellation revenue of the web service classes at time T) minus the total cost (composed of the cost of the total reserved web service for different classes at time T). The state equations (3) and (4) illustrate the change of the sales revenue and reservation level at time t, respectively. Sales revenue level change for the web service class i at time t is equal to the revenue that is obtained from selling the web service class i to dipit,t users at price pit minus the revenue that the provider misses due to users’ cancellation. Since it is supposed that the canceled orders at time t uniformly spread across the interval [0,t], we apply expression SRiteit to calculate the provider missed revenue. Reservation level change rate for the web service class i at time t is equal to orders for the web service class i at time t minus the reserved orders that are canceled by the users at time t. Constraint (5) is defined to make sure that the sum of sold resource j for all the web service classes is equal to or less than the shared capacity of the resource j among all the web service classes. Constraints (6) and (7) are used to confirm that demand functions and prices are nonnegative, respectively. Initial value of the state variables is denoted by (8).


## 2.4. Discretized Formulation

The model can be rewritten by discretizing the time horizon. We partition the time interval[0,T] into N subintervals with lengths τ1,τ2,…,τN and we need to obtain the decision variables of the model in times t1,…,tN such that t1=τ1 and for l=2,…,N, we have tl=tl-1+τl. Replacing tl, dt=τl, dSRi(tl)/dt=SRitl-SRitl-1/τl, and dRLi(tl)/dt=RLitl-RLitl-1/τl into (2) to (7) provides the discretized formulation of the model as follows:
(9)max⁡∑i=1nSRitN+∑i=1n∑l=1NθitleitlSRitlτl-∑i=1nciRLi(tN),(10)s.t.SRi(tl)-SRi(tl-1)=di(pi(tl),Mfi(tl),tl)pi(tl)-ei(tl)SRi(tl)τll=1,…,N,i=1,…,n,(11)RLitl-RLitl-1=dipitl,Mfitl,tl-ei(tl)RLi(tl)τll=1,…,N,i=1,…,n,(12)∑i=1ncapijRLitN≤Cajj=1,…,m,(13)dipitl,Mfitl,tl≥0l=1,…,N,i=1,…,n,(14)pitl≥0l=1,…,N,i=1,…,n,(15)SRi0=0,RLi0=0i=1,…,n.
Equation (9) indicates the discretized objective function of the model. The constraints (10), (11), (12), (13), (14), and (15) discretize the constraints (3), (4), (5), (6), (7), and (8), respectively.


## 3. Solution Approach

### 3.1. Maximum Principle for Optimal Control Problems with Mixed Inequality Constraints

In this section, the maximum principle for optimal control problems with mixed inequality constraints will be expressed. For further facts see [35, 52]. Let us consider the following optimal control problem with mixed inequality constraints:
(16)max⁡∫0TF(x(t),u(t),t)dt+M(x(T)),(17)x˙t=fxt,ut,t,(18)g(x(t),u(t),t)≥0,(19)a(x(T),T)≥0,
where T is planned time horizon, x(t)∈En1 is the vector of state trajectories at time t, u(t)∈Em1 is the vector of control trajectories at time t, the functions F from En1×Em1×E into E, M from En1×E into E, f from En1×Em1×E into En1, g from En1×Em1×E into Ed, and a from  En1×E  into El are continuously differentiable with respect to all their argument. It is supposed that each element of the functions g depends explicitly on the control u and state x. More exactly, the subsequent full rank condition must be held:
(20)rank⁡∂g∂u,diag⁡(g)=d.
Condition (20) denotes that the gradients with respect to u of all the active constraints g≥0 must be linearly independent.To express the maximum principle, it is essential to define the Hamiltonian function as follows:(21)Hx,u,λ1,t=Fx,u,t+λ1fx,u,t,
where λ1∈En1, whose components are termed adjoint variables. We also define the Lagrangian function as
(22)Lx,u,λ1,μ1,t=Hx,u,λ1,t+μ1gx,u,t,
where μ1∈Ed is a row vector, whose components are termed Lagrangian multipliers.Theorem 1 (necessary condition).
The necessary conditions foru* with the corresponding state trajectory x* to be an optimal solution are that there should exist continuous and piecewise continuously differentiable functions λ1, piecewise continuous functions μ1 such that the following conditions hold:
(23)x˙*t=fx*t,u*t,t.
Satisfying
(24)λ˙1=-Lxx*,u*,λ1,μ1,t.
With the transversality conditions
(25)λ1T=Mxx*T,T+αaxxT,T,α≥0,αaxT,T=0,
where α∈El is constant vector.
At eacht∈[0,T] and for all u satisfying g(x*,u,t)≥0, the Lagrange multiplier is such that
(26)∂L∂uu=u*=∂H∂u+μ1∂g∂uu=u*=0
and the complementary slackness conditions are
(27)μ1≥0,μ1g(x*,u*,t)=0.Theorem 2 (sufficiency).
Let(x*,u*,λ1,μ1,α) satisfy the necessary conditions in Theorem 1. If H(x,u,λ1,t) is concave in (x,u) at each t∈[0,T], M in (16) is concave in x,g in (18) is quasi-concave in (x,u),a in (19) is quasi-concave in x, then (x*,u*) is optimal.


### 3.2. Optimality Condition for the Proposed Model

In this section, we first prove that the mixed inequality constraint qualification holds. Then, we create the Hamiltonian and Lagrangian functions and apply the maximum principal to present some important results.Lemma 3.
The mixed inequality constraint qualification holds.Proof.
The constraint qualification illustrates that the gradients of the entire active mixed inequality constraints (6) and (7) with respect to p(t) must be linearly independent. The mixed inequality constraints for this problem are as follows: z=pt,dp,t. Based on (20), it is needed to show that the rank M=∂z/∂pt,diag⁡z is 2n. The Matrix M∈R2n×R3n can be written as follows:(28)M=1p1(t)⋱⋱1pn(t)∂d1∂p1d1(p1(t),t)⋱⋱∂dn∂pndn(pn(t),t).To demonstrate the rank M=2n, we can see the follwoing: since there are 2n rows in M, the rank is at most 2n. If there is no binding constraint on the constraint sets (6) and (7), the last 2n columns are nonzero and linearly independent; as a result the rank of matrix is 2n. For each i such that pi(t)=0, column n+i is the zero vector, however, it can be substituted with column i to gain a set of linearly independent columns. Similarly, for each i such that di(pi(t),t)=0, since ∂di(pi(t),Mfi(t),t)/∂pi>0, it can replace column n+2i with column i. It is necessary to note that the constraint sets (6) and (7) cannot be bound simultaneously.The maximum principle defines the necessary conditions for optimum control variables. Using (21), the Hamiltonian function for this problem can be illustrated as follows:
(29)HSRt,RLt,pt,λt,λ′t,t=∑i=1nθitSRiteit+∑i=1nλi(t)di(pi(t),Mfi(t),t)pi(t)-ei(t)SRi(t)+∑i=1nλi′tdipit,Mfit,t-eitRLit.
The adjoint variables λ(t)=(λ1,…,λn) and λ′(t)=(λ1′,…,λn′) dualize, respectively, the state equations (3) and (4) at time t.Furthermore, using (22), the Lagrangian function for this problem can be written as follows:
(30)L(SR(t),RL(t),p(t),λ(t),λ′(t),μ,η,t)=H(SR(t),RL(t),p(t),λ(t),λ′(t),t)+∑i=1nμitdipit,Mfit,t+∑i=1nηitpit.
The Lagrange multipliers μ(t)=(μ1,…,μn) and η(t)=(η1,…,ηn) relax, respectively, the constraints (6) and (7) at time t. However, since left side of constraints (6) and (7) for each web service class is only dependent on its price, market influence and time, we can remove these constraints from Lagrangian function and use them to create feasible solution space. Therefore, Lagrangian function can be rewritten as
(31)L(SR(t),RL(t),p(t),λ(t),λ′(t),μ,η,t)=HSRt,RLt,pt,λt,λ′t,t.
According to the maximal principal Theorem 1, at the optimal solution (i)
The state trajectories satisfy(32)SR˙i*t=di*pi*t,Mfit,tpi*t-eitSRi*t∀t∈0,Ti=1,…,n,(33)R˙Li*t=di*pi*t,Mfit,t-eitRLi*t∀t∈0,Ti=1,…,n,(34)∑i=1ncapijRLi*(T)≤Cajj=1,…,m,(35)SRi*0=0,RLi*0=0i=1,…,n.(ii)
The optimal control on[0,T] is calculated as follows:
(36)p*(t)=argmax⁡pt∈DtLSR*t,RL*t,p*t,λt,λ′t,t,whereD(t) is the set of admissible controls p(t) such that:
(37)pi*t≥0i=1,…,n,dipi*t,Mfit,t≥0i=1,…,n.(iii)
Using (24), for every t∈[0,T], the continuous vector of the adjoint variable λ(t) fulfills the following differential equation:
(38)λ˙it=-LSRi(SR*(t),RL*(t),p*(t),λ(t),λ′(t),t)=-eitθit-λiti=1,…,n.Furthermore, the following differential equation holds for the adjoint vectorλ′(t):
(39)λ˙i′t=-LRLi(SR*(t),RL*(t),p*(t),λ(t),λ′(t),μ(t),t)=eitλi′ti=1,…,n.(iv)
Using (25), The transversality conditions can be formed as follows:
(40)λiT=∂∑j=1nSRj*T-cjRLj*T∂SRi*=1i=1,…,n,(41)λi′T=∂(∑j=1nSRj*(T)-cjRLj*(T))∂RLi+∑j=1mαj∂Caj-∑i=1ncapijRLi*T∂RLi=-(ci+∑j=1mαjcapij),i=1,…,n,αj≥0,αjCaj-∑i=1ncapijRLi*T=0,j=1,…,m.Proposition 4.
For each web service classi at time t, the optimal trajectory λi(t) is given by
(42)λit=1mi′tmi′T+∫tTθiseismi′sds,
where mi′(t)=e-∫ei(t)dt.Proof.
Equation (38) is a linear first-order differential equation. Its standard form is λ˙i(t)-ei(t)λi(t)=-θi(t)ei(t), based on the available standard solution for the first order differential equation in [53], we have
(43)λi(T)mi′(T)-λi(t)mi′(t)=-∫tTθi(s)ei(s)mi′(s)ds,
where mi′(t)=e-∫ei(t)dt, recalling (40) gives λi(t)=1/mi′t(mi′(T)+∫tTθi(s)ei(s)mi′(s)ds).Proposition 5.
For each web service classi at time t, the adjoint variable λi′(t) is given by
(44)λi′t=-ci+∑j=1mαjcapije-∫tTeisds,
where αj≥0, αj(Caj-∑i=1ncapijRLi*(T))=0, j=1,…,m.Proof.
From differential equation (39), we have λ˙i′(t)/λi′(t)=ei(t), integrating with respect to t gives ln⁡(λi′(t))tT=∫tTei(s)ds, recalling (41) gives λi′(t)=-(ci+∑j=1mαjcapij)e-∫tTei(s)ds.Proposition 6.
At each timet∈[0,T], for obtained λ′(t), λ(t) and α=(α1,…,αn) from necessary condition, the unique optimum control solution can be given by
(45)piopt(t)=pi*(t)0≤pi*(t)≤Pi(t)Pi(t)pit>Pit,
where pi*(t) and Pi(t) can be obtained from the equations di(pi*(t),Mfi(t),t) + (pi*t + -(ci+∑j=1mαjcapij)/(1 + ∫tTθiteite∫tTeitdtdt))∂dipi*t,Mfit,t/∂pi=0 and di(Pi(t),Mfi(t),t)=0, respectively.Proof.
In order to obtain the optimal control variables as function ofλ′(t), λ(t) and α, the optimization problem (36) is solved. It is also noticed that the Lagrangian function is separable across the web service classes and in pi(t). To find optimal solution of problem, the partial derivative of Lagrangian function with respect to control variable pi(t) can be obtained as
(46)∂L∂pi(SR(t),RL(t),p(t),λ(t),λ′(t),t)=λit∂dipit,Mfit,t∂pipitdipit,Mfit,t+∂dipit,Mfit,t∂pipit+λi′(t)∂di(pi(t),Mfi(t),t)∂pi.
To achieve the optimal solution, these partial derivatives are set to zero as follows:
(47)λi(t)di(pi*(t),Mfi(t),t)+(λi(t)pi*(t)+λi′(t))×∂dipi*t,Mfit,t∂pi=0.
Furthermore, by substituting (42) and (44) into (47), one can get
(48)di(pi*(t),Mfi(t),t)+pi*t+-ci+∑j=1mαjcapij1+∫tTθiteite∫tTeitdtdt×∂di(pi*(t),Mfi(t),t)∂pi=0.
To prove uniqueness of pi*(t) satisfying (6), (7), and (48). It is sufficient to show that ∂2L/∂pi2<0. In (48), Since di(pi*(t),Mfi(t),t)≥0 and ∂di(pi*(t),Mfi(t),t)/∂pi<0, we can verify that pi*(t)+λi′t/λit≥0, then,
(49)∂2L∂pi2=∂2H∂pi2=2λi(t)∂di(pi*(t),Mfi(t),t)∂pi(t)+(λi(t)pi*(t)+λi′(t))∂2dipi*t,Mfit,t∂pi2<0.
Let the maximum price be Pi(t) at time t, such that di(Pi(t),Mfi(t),t)=0. If pi* lies within the interval [0,Pi(t)], then it is the optimal control. Otherwise, pi* locates in the boundary of the set of feasible controls, that is, 0 or Pi(t), depending on which value corresponds to the higher value of the optimization problem (36).Note, that by settingeit=0, ∀t∈0,T, i=1,…,n, we obtain the optimality condition for the corresponding model which ignores the cancellation assumption:
(50)di(piWC(t),Mfi(t),t)+piWCt-ci+∑j=1mαjcapij×∂di(piWC(t),Mfi(t),t)∂pi=0.
Referring to the optimal price of the web service class i  piWC at time t, and ignoring resource capacity constraint (5),   it can be concluded that ignoring cancellation assumption leads to overpricing.Proposition 7.
If the capacity constraint (5) is removed from the model, then one has
(51)piWCt>pi*t.Proof.
Removing the resource capacity constraint (5), the value of expression ∑j=1mαjcapij will be zero. Thus, comparing (47) and (50), it can be observed that
(52)di(pi*(t),Mfi(t),t)+pi*t-ci1+∫tTθiteite∫tTeitdtdt×∂di(pi*(t),Mfi(t),t)∂pi=dipiWCt,Mfit,t+piWCt-ci×∂di(piWC(t),Mfi(t),t)∂pi=0,
while taking into account that ∂di(pi(t),Mfi(t),t)/∂pi<0,
(53)di(piWC(t),Mfi(t),t)+(piWC(t)-ci(1+∫tTθi(t)ei(t)e∫tTei(t)dtdt))×∂di(piWC(t),Mfi(t),t)∂pi=di(piWC(t),Mfi(t),t)+piWCt-ci+ci-ci1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi=ci-ci1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi<0.
Next, by denoting
(54)fpit=di(pi(t),Mfi(t),t)+pit-ci1+∫tTθiteite∫tTeitdtdt×∂di(pi(t),Mfi(t),t)∂pi
and recalling (49), we conclude that ∂f(pi(t))/∂pi<0. Thus, from conditions (52) and (53), we have f(piWC(t))<f(pi*(t)), which with respect to the last inequality needs that piWC(t)>pi*(t).According to Proposition7, the optimal prices derived from the model ignoring the order cancellation assumption is not optimal and the proposed model is required to account properly for the effects of order cancellation.Proposition 8.
For the model without resource capacity constraint (5), when the unit cost of the web service class i increases, the optimal price of the web service class i increases.Proof.
Suppose thatc1i and c2i are two cost values for the unit web service class i such that c1i<c2i. To prove this proposition, one can show that the corresponding prices p1i and p2i have the following relationship:
(55)p1i<p2i.
Removing the resource capacity constraint (5) and using (48), we have
(56)di(p1i(t),t)+p1it-c1i1+∫tTθiteite∫tTeitdtdt×∂di(p1i(t),Mfi(t),t)∂pi=di(p2i(t),t)+p2it-c2i1+∫tTθiteite∫tTeitdtdt×∂dip2it,Mfit,t∂pi=0.
By assuming that ∂di(pi(t),Mfi(t),t)/∂pi<0, it can be stated
(57)di(p1i(t),Mfi(t),t)+(p1i(t)-c2i(1+∫tTθi(t)ei(t)e∫tTei(t)dtdt))×∂di(p1i(t),Mfi(t),t)∂pi=di(p1i(t),Mfi(t),t)+p1it-c2i+c1i-c1i1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi=c1i-c2i1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi>0.
Next by defining
(58)fpit=di(pi(t),Mfi(t),t)+pit-c2i1+∫tTθiteite∫tTeitdtdt×∂di(pi(t),Mfi(t),t)∂pi
recalling (49), again, we can derive that ∂f(pi(t))/∂pi<0. Therefore, from (56), (57), and (60), we have f(p2i(t))<f(p1i(t)), which with respect to the last inequality needs that p2i(t)>p1i(t).Proposition 9.
For the model with no resource capacity constraint (5), if ∂di(pi(t),Mfi(t),t)/∂Mfi>0 and ∂di(pi(t),Mfi(t),t)/∂Mfi∂pi>0, then the optimal price of the web service class i at time t increases by increasing the market influence.Proof.
Suppose thatMf1i(t) and Mf2i(t) are two market influences for the web service class i such that Mf1i(t)<Mf2i(t). Now, we must prove the prices p1i(t) and p2i(t) corresponding to Mf1i(t) and Mf2i(t) have the following relationship:
(59)p1it<p2it.
Using (48), for the prices p1i(t) and p2i(t) we have
(60)di(p1i(t),Mf1i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf1it,t∂pi=0,(61)di(p2i(t),Mf2i(t),t)+p2it-ci1+∫tTθiteite∫tTeitdtdt×∂dip2it,Mf2it,t∂pi=0.
By assuming that ∂di(pi(t),Mfi(t),t)/∂pi<0, ∂di(pi(t),Mfi(t),t)/∂Mf1i>0 and ∂di(pi(t),Mfi(t),t)/∂Mfi∂pi>0, substituting p1i(t) with p2i(t) into (61), we have
(62)di(p1i(t),Mf2i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf2it,t∂pi.
Therefore,
(63)di(p1i(t),Mf2i(t),t)-di(p1i(t),Mf1i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf2it,t∂pi-∂dip1it,Mf1it,t∂pi>0.
Next by describing
(64)fpit=di(pi(t),Mf2i(t),t)+pit-ci1+∫tTθiteite∫tTeitdtdt×∂dipit,Mf2it,t∂pi.
Similar to (58), again, we conclude that ∂f(pi(t))/∂pi<0. Using (61) and (63) and (64) we have f(p2i(t))<f(p1i(t)), which with respect to the last inequality needs that p2i(t)>p1i(t).Proposition 10.
For the model with no resource capacity constraint (5), if ∂di(p1i(t),Mfi(t),t)/∂Mfi<0 and ∂di(p1i(t),Mfi(t),t)/∂Mfi∂pi<0, then the optimal price of the web service classi decreases by increasing the market influence.Proof.
The proof of this Proposition is similar to Proposition9.Proposition 11.
For each web service classi at time t, the optimal sales revenue SRi*(t) is given by
(65)SRi*(t)=1mi(t)∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
where mi(t)=e∫ei(t)dt.Proof.
The state equation (32) is the first-order differential equation and we have SR˙i*(t)=di(pi*(t),Mfi(t),t)pi*(t)-ei(t)SRi*(t), thus,
(66)SRi*(s)mi(s)0t=∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
where mi(t)=e∫ei(t)dt, therefore
(67)SRi*(t)mi(t)-SRi*(0)mi(0)=∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
since Ri*(0)=0, thus
(68)SRi*t=1mit∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds.Proposition 12.
For each web service classi at time t, the optimal reservation level RLi*(t) is given by
(69)RLi*(t)=1mi(t)∫0tdi(pi*(s),Mfi(t),s)mi(s)ds,
where mi(t)=e∫ei(t)dt.Proof.
The proof of this proposition is similar to Proposition11.


## 3.1. Maximum Principle for Optimal Control Problems with Mixed Inequality Constraints

In this section, the maximum principle for optimal control problems with mixed inequality constraints will be expressed. For further facts see [35, 52]. Let us consider the following optimal control problem with mixed inequality constraints:
(16)max⁡∫0TF(x(t),u(t),t)dt+M(x(T)),(17)x˙t=fxt,ut,t,(18)g(x(t),u(t),t)≥0,(19)a(x(T),T)≥0,
where T is planned time horizon, x(t)∈En1 is the vector of state trajectories at time t, u(t)∈Em1 is the vector of control trajectories at time t, the functions F from En1×Em1×E into E, M from En1×E into E, f from En1×Em1×E into En1, g from En1×Em1×E into Ed, and a from  En1×E  into El are continuously differentiable with respect to all their argument. It is supposed that each element of the functions g depends explicitly on the control u and state x. More exactly, the subsequent full rank condition must be held:
(20)rank⁡∂g∂u,diag⁡(g)=d.
Condition (20) denotes that the gradients with respect to u of all the active constraints g≥0 must be linearly independent.To express the maximum principle, it is essential to define the Hamiltonian function as follows:(21)Hx,u,λ1,t=Fx,u,t+λ1fx,u,t,
where λ1∈En1, whose components are termed adjoint variables. We also define the Lagrangian function as
(22)Lx,u,λ1,μ1,t=Hx,u,λ1,t+μ1gx,u,t,
where μ1∈Ed is a row vector, whose components are termed Lagrangian multipliers.Theorem 1 (necessary condition).
The necessary conditions foru* with the corresponding state trajectory x* to be an optimal solution are that there should exist continuous and piecewise continuously differentiable functions λ1, piecewise continuous functions μ1 such that the following conditions hold:
(23)x˙*t=fx*t,u*t,t.
Satisfying
(24)λ˙1=-Lxx*,u*,λ1,μ1,t.
With the transversality conditions
(25)λ1T=Mxx*T,T+αaxxT,T,α≥0,αaxT,T=0,
where α∈El is constant vector.
At eacht∈[0,T] and for all u satisfying g(x*,u,t)≥0, the Lagrange multiplier is such that
(26)∂L∂uu=u*=∂H∂u+μ1∂g∂uu=u*=0
and the complementary slackness conditions are
(27)μ1≥0,μ1g(x*,u*,t)=0.Theorem 2 (sufficiency).
Let(x*,u*,λ1,μ1,α) satisfy the necessary conditions in Theorem 1. If H(x,u,λ1,t) is concave in (x,u) at each t∈[0,T], M in (16) is concave in x,g in (18) is quasi-concave in (x,u),a in (19) is quasi-concave in x, then (x*,u*) is optimal.


## 3.2. Optimality Condition for the Proposed Model

In this section, we first prove that the mixed inequality constraint qualification holds. Then, we create the Hamiltonian and Lagrangian functions and apply the maximum principal to present some important results.Lemma 3.
The mixed inequality constraint qualification holds.Proof.
The constraint qualification illustrates that the gradients of the entire active mixed inequality constraints (6) and (7) with respect to p(t) must be linearly independent. The mixed inequality constraints for this problem are as follows: z=pt,dp,t. Based on (20), it is needed to show that the rank M=∂z/∂pt,diag⁡z is 2n. The Matrix M∈R2n×R3n can be written as follows:(28)M=1p1(t)⋱⋱1pn(t)∂d1∂p1d1(p1(t),t)⋱⋱∂dn∂pndn(pn(t),t).To demonstrate the rank M=2n, we can see the follwoing: since there are 2n rows in M, the rank is at most 2n. If there is no binding constraint on the constraint sets (6) and (7), the last 2n columns are nonzero and linearly independent; as a result the rank of matrix is 2n. For each i such that pi(t)=0, column n+i is the zero vector, however, it can be substituted with column i to gain a set of linearly independent columns. Similarly, for each i such that di(pi(t),t)=0, since ∂di(pi(t),Mfi(t),t)/∂pi>0, it can replace column n+2i with column i. It is necessary to note that the constraint sets (6) and (7) cannot be bound simultaneously.The maximum principle defines the necessary conditions for optimum control variables. Using (21), the Hamiltonian function for this problem can be illustrated as follows:
(29)HSRt,RLt,pt,λt,λ′t,t=∑i=1nθitSRiteit+∑i=1nλi(t)di(pi(t),Mfi(t),t)pi(t)-ei(t)SRi(t)+∑i=1nλi′tdipit,Mfit,t-eitRLit.
The adjoint variables λ(t)=(λ1,…,λn) and λ′(t)=(λ1′,…,λn′) dualize, respectively, the state equations (3) and (4) at time t.Furthermore, using (22), the Lagrangian function for this problem can be written as follows:
(30)L(SR(t),RL(t),p(t),λ(t),λ′(t),μ,η,t)=H(SR(t),RL(t),p(t),λ(t),λ′(t),t)+∑i=1nμitdipit,Mfit,t+∑i=1nηitpit.
The Lagrange multipliers μ(t)=(μ1,…,μn) and η(t)=(η1,…,ηn) relax, respectively, the constraints (6) and (7) at time t. However, since left side of constraints (6) and (7) for each web service class is only dependent on its price, market influence and time, we can remove these constraints from Lagrangian function and use them to create feasible solution space. Therefore, Lagrangian function can be rewritten as
(31)L(SR(t),RL(t),p(t),λ(t),λ′(t),μ,η,t)=HSRt,RLt,pt,λt,λ′t,t.
According to the maximal principal Theorem 1, at the optimal solution (i)
The state trajectories satisfy(32)SR˙i*t=di*pi*t,Mfit,tpi*t-eitSRi*t∀t∈0,Ti=1,…,n,(33)R˙Li*t=di*pi*t,Mfit,t-eitRLi*t∀t∈0,Ti=1,…,n,(34)∑i=1ncapijRLi*(T)≤Cajj=1,…,m,(35)SRi*0=0,RLi*0=0i=1,…,n.(ii)
The optimal control on[0,T] is calculated as follows:
(36)p*(t)=argmax⁡pt∈DtLSR*t,RL*t,p*t,λt,λ′t,t,whereD(t) is the set of admissible controls p(t) such that:
(37)pi*t≥0i=1,…,n,dipi*t,Mfit,t≥0i=1,…,n.(iii)
Using (24), for every t∈[0,T], the continuous vector of the adjoint variable λ(t) fulfills the following differential equation:
(38)λ˙it=-LSRi(SR*(t),RL*(t),p*(t),λ(t),λ′(t),t)=-eitθit-λiti=1,…,n.Furthermore, the following differential equation holds for the adjoint vectorλ′(t):
(39)λ˙i′t=-LRLi(SR*(t),RL*(t),p*(t),λ(t),λ′(t),μ(t),t)=eitλi′ti=1,…,n.(iv)
Using (25), The transversality conditions can be formed as follows:
(40)λiT=∂∑j=1nSRj*T-cjRLj*T∂SRi*=1i=1,…,n,(41)λi′T=∂(∑j=1nSRj*(T)-cjRLj*(T))∂RLi+∑j=1mαj∂Caj-∑i=1ncapijRLi*T∂RLi=-(ci+∑j=1mαjcapij),i=1,…,n,αj≥0,αjCaj-∑i=1ncapijRLi*T=0,j=1,…,m.Proposition 4.
For each web service classi at time t, the optimal trajectory λi(t) is given by
(42)λit=1mi′tmi′T+∫tTθiseismi′sds,
where mi′(t)=e-∫ei(t)dt.Proof.
Equation (38) is a linear first-order differential equation. Its standard form is λ˙i(t)-ei(t)λi(t)=-θi(t)ei(t), based on the available standard solution for the first order differential equation in [53], we have
(43)λi(T)mi′(T)-λi(t)mi′(t)=-∫tTθi(s)ei(s)mi′(s)ds,
where mi′(t)=e-∫ei(t)dt, recalling (40) gives λi(t)=1/mi′t(mi′(T)+∫tTθi(s)ei(s)mi′(s)ds).Proposition 5.
For each web service classi at time t, the adjoint variable λi′(t) is given by
(44)λi′t=-ci+∑j=1mαjcapije-∫tTeisds,
where αj≥0, αj(Caj-∑i=1ncapijRLi*(T))=0, j=1,…,m.Proof.
From differential equation (39), we have λ˙i′(t)/λi′(t)=ei(t), integrating with respect to t gives ln⁡(λi′(t))tT=∫tTei(s)ds, recalling (41) gives λi′(t)=-(ci+∑j=1mαjcapij)e-∫tTei(s)ds.Proposition 6.
At each timet∈[0,T], for obtained λ′(t), λ(t) and α=(α1,…,αn) from necessary condition, the unique optimum control solution can be given by
(45)piopt(t)=pi*(t)0≤pi*(t)≤Pi(t)Pi(t)pit>Pit,
where pi*(t) and Pi(t) can be obtained from the equations di(pi*(t),Mfi(t),t) + (pi*t + -(ci+∑j=1mαjcapij)/(1 + ∫tTθiteite∫tTeitdtdt))∂dipi*t,Mfit,t/∂pi=0 and di(Pi(t),Mfi(t),t)=0, respectively.Proof.
In order to obtain the optimal control variables as function ofλ′(t), λ(t) and α, the optimization problem (36) is solved. It is also noticed that the Lagrangian function is separable across the web service classes and in pi(t). To find optimal solution of problem, the partial derivative of Lagrangian function with respect to control variable pi(t) can be obtained as
(46)∂L∂pi(SR(t),RL(t),p(t),λ(t),λ′(t),t)=λit∂dipit,Mfit,t∂pipitdipit,Mfit,t+∂dipit,Mfit,t∂pipit+λi′(t)∂di(pi(t),Mfi(t),t)∂pi.
To achieve the optimal solution, these partial derivatives are set to zero as follows:
(47)λi(t)di(pi*(t),Mfi(t),t)+(λi(t)pi*(t)+λi′(t))×∂dipi*t,Mfit,t∂pi=0.
Furthermore, by substituting (42) and (44) into (47), one can get
(48)di(pi*(t),Mfi(t),t)+pi*t+-ci+∑j=1mαjcapij1+∫tTθiteite∫tTeitdtdt×∂di(pi*(t),Mfi(t),t)∂pi=0.
To prove uniqueness of pi*(t) satisfying (6), (7), and (48). It is sufficient to show that ∂2L/∂pi2<0. In (48), Since di(pi*(t),Mfi(t),t)≥0 and ∂di(pi*(t),Mfi(t),t)/∂pi<0, we can verify that pi*(t)+λi′t/λit≥0, then,
(49)∂2L∂pi2=∂2H∂pi2=2λi(t)∂di(pi*(t),Mfi(t),t)∂pi(t)+(λi(t)pi*(t)+λi′(t))∂2dipi*t,Mfit,t∂pi2<0.
Let the maximum price be Pi(t) at time t, such that di(Pi(t),Mfi(t),t)=0. If pi* lies within the interval [0,Pi(t)], then it is the optimal control. Otherwise, pi* locates in the boundary of the set of feasible controls, that is, 0 or Pi(t), depending on which value corresponds to the higher value of the optimization problem (36).Note, that by settingeit=0, ∀t∈0,T, i=1,…,n, we obtain the optimality condition for the corresponding model which ignores the cancellation assumption:
(50)di(piWC(t),Mfi(t),t)+piWCt-ci+∑j=1mαjcapij×∂di(piWC(t),Mfi(t),t)∂pi=0.
Referring to the optimal price of the web service class i  piWC at time t, and ignoring resource capacity constraint (5),   it can be concluded that ignoring cancellation assumption leads to overpricing.Proposition 7.
If the capacity constraint (5) is removed from the model, then one has
(51)piWCt>pi*t.Proof.
Removing the resource capacity constraint (5), the value of expression ∑j=1mαjcapij will be zero. Thus, comparing (47) and (50), it can be observed that
(52)di(pi*(t),Mfi(t),t)+pi*t-ci1+∫tTθiteite∫tTeitdtdt×∂di(pi*(t),Mfi(t),t)∂pi=dipiWCt,Mfit,t+piWCt-ci×∂di(piWC(t),Mfi(t),t)∂pi=0,
while taking into account that ∂di(pi(t),Mfi(t),t)/∂pi<0,
(53)di(piWC(t),Mfi(t),t)+(piWC(t)-ci(1+∫tTθi(t)ei(t)e∫tTei(t)dtdt))×∂di(piWC(t),Mfi(t),t)∂pi=di(piWC(t),Mfi(t),t)+piWCt-ci+ci-ci1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi=ci-ci1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi<0.
Next, by denoting
(54)fpit=di(pi(t),Mfi(t),t)+pit-ci1+∫tTθiteite∫tTeitdtdt×∂di(pi(t),Mfi(t),t)∂pi
and recalling (49), we conclude that ∂f(pi(t))/∂pi<0. Thus, from conditions (52) and (53), we have f(piWC(t))<f(pi*(t)), which with respect to the last inequality needs that piWC(t)>pi*(t).According to Proposition7, the optimal prices derived from the model ignoring the order cancellation assumption is not optimal and the proposed model is required to account properly for the effects of order cancellation.Proposition 8.
For the model without resource capacity constraint (5), when the unit cost of the web service class i increases, the optimal price of the web service class i increases.Proof.
Suppose thatc1i and c2i are two cost values for the unit web service class i such that c1i<c2i. To prove this proposition, one can show that the corresponding prices p1i and p2i have the following relationship:
(55)p1i<p2i.
Removing the resource capacity constraint (5) and using (48), we have
(56)di(p1i(t),t)+p1it-c1i1+∫tTθiteite∫tTeitdtdt×∂di(p1i(t),Mfi(t),t)∂pi=di(p2i(t),t)+p2it-c2i1+∫tTθiteite∫tTeitdtdt×∂dip2it,Mfit,t∂pi=0.
By assuming that ∂di(pi(t),Mfi(t),t)/∂pi<0, it can be stated
(57)di(p1i(t),Mfi(t),t)+(p1i(t)-c2i(1+∫tTθi(t)ei(t)e∫tTei(t)dtdt))×∂di(p1i(t),Mfi(t),t)∂pi=di(p1i(t),Mfi(t),t)+p1it-c2i+c1i-c1i1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi=c1i-c2i1+∫tTθiteite∫tTeitdtdt×∂dipiWCt,Mfit,t∂pi>0.
Next by defining
(58)fpit=di(pi(t),Mfi(t),t)+pit-c2i1+∫tTθiteite∫tTeitdtdt×∂di(pi(t),Mfi(t),t)∂pi
recalling (49), again, we can derive that ∂f(pi(t))/∂pi<0. Therefore, from (56), (57), and (60), we have f(p2i(t))<f(p1i(t)), which with respect to the last inequality needs that p2i(t)>p1i(t).Proposition 9.
For the model with no resource capacity constraint (5), if ∂di(pi(t),Mfi(t),t)/∂Mfi>0 and ∂di(pi(t),Mfi(t),t)/∂Mfi∂pi>0, then the optimal price of the web service class i at time t increases by increasing the market influence.Proof.
Suppose thatMf1i(t) and Mf2i(t) are two market influences for the web service class i such that Mf1i(t)<Mf2i(t). Now, we must prove the prices p1i(t) and p2i(t) corresponding to Mf1i(t) and Mf2i(t) have the following relationship:
(59)p1it<p2it.
Using (48), for the prices p1i(t) and p2i(t) we have
(60)di(p1i(t),Mf1i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf1it,t∂pi=0,(61)di(p2i(t),Mf2i(t),t)+p2it-ci1+∫tTθiteite∫tTeitdtdt×∂dip2it,Mf2it,t∂pi=0.
By assuming that ∂di(pi(t),Mfi(t),t)/∂pi<0, ∂di(pi(t),Mfi(t),t)/∂Mf1i>0 and ∂di(pi(t),Mfi(t),t)/∂Mfi∂pi>0, substituting p1i(t) with p2i(t) into (61), we have
(62)di(p1i(t),Mf2i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf2it,t∂pi.
Therefore,
(63)di(p1i(t),Mf2i(t),t)-di(p1i(t),Mf1i(t),t)+p1it-ci1+∫tTθiteite∫tTeitdtdt×∂dip1it,Mf2it,t∂pi-∂dip1it,Mf1it,t∂pi>0.
Next by describing
(64)fpit=di(pi(t),Mf2i(t),t)+pit-ci1+∫tTθiteite∫tTeitdtdt×∂dipit,Mf2it,t∂pi.
Similar to (58), again, we conclude that ∂f(pi(t))/∂pi<0. Using (61) and (63) and (64) we have f(p2i(t))<f(p1i(t)), which with respect to the last inequality needs that p2i(t)>p1i(t).Proposition 10.
For the model with no resource capacity constraint (5), if ∂di(p1i(t),Mfi(t),t)/∂Mfi<0 and ∂di(p1i(t),Mfi(t),t)/∂Mfi∂pi<0, then the optimal price of the web service classi decreases by increasing the market influence.Proof.
The proof of this Proposition is similar to Proposition9.Proposition 11.
For each web service classi at time t, the optimal sales revenue SRi*(t) is given by
(65)SRi*(t)=1mi(t)∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
where mi(t)=e∫ei(t)dt.Proof.
The state equation (32) is the first-order differential equation and we have SR˙i*(t)=di(pi*(t),Mfi(t),t)pi*(t)-ei(t)SRi*(t), thus,
(66)SRi*(s)mi(s)0t=∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
where mi(t)=e∫ei(t)dt, therefore
(67)SRi*(t)mi(t)-SRi*(0)mi(0)=∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds,
since Ri*(0)=0, thus
(68)SRi*t=1mit∫0tdi(pi*(s),Mfi(t),s)pi*(s)mi(s)ds.Proposition 12.
For each web service classi at time t, the optimal reservation level RLi*(t) is given by
(69)RLi*(t)=1mi(t)∫0tdi(pi*(s),Mfi(t),s)mi(s)ds,
where mi(t)=e∫ei(t)dt.Proof.
The proof of this proposition is similar to Proposition11.


## 4. Heuristic Algorithm

In what follows, we describe the heuristic algorithm which is utilized to derive the optimal solution for the problem based on Everett’s approach [54] for identifying the multipliers αj, j=1,…,m. It employs (45) to find the solution for the determined multipliers. For the specified multipliers αj, j=1,…,m, if constraint (5) and condition (41) are satisfied, then the obtained solution is optimal and the algorithm will end. Otherwise, it is necessary to update the value of multipliers αj, j=1,…,m and repeat the algorithm from the beginning.Atkth iteration of the proposed algorithm, the solution pjk(t), t∈[0,T], j=1,…,n, is first calculated by using (45) for given multipliers αjks, j=1,…,m. Later on, it follows that σjk=Caj-∑i=1ncapijRLiT, j=1,…,m. According to the calculated σjk, the value of the multipliers αjk, j=1,…,m may be determined as follows:(i)
For allj∈{1,…,m}, if σjk≥0 then αjk+1=max⁡{ε′,(1-ρjk)αjk}, where ε′ has a positive value near zero. It ensures that αjk+1 stays nonnegative.(ii)
For allj∈{1,…,m}, if σjk<0 then αjk+1=(1+ρjk)αjk.In this method, ifσjk<0, then constraint (5) is not satisfied, and the value of multipliers must be increased in order to penalize the additional violation. In the same way, if σjk≥0, then constraint (5) is not violated and the value of the multipliers must be decreased.Furthermore, the parametersρjk+1 are updated as follows:ifσjkσjk-1>0 then ρjk+1=ε1ρjk,ifσjkσjk-1<0 then ρjk+1=ε2ρjk,ifσjkσjk-1=0 then ρjk+1=ρjk,where the parameters ε1 and ε2 are constant, and also ε1>1 and ε2<1. If the capacity constraint (5) is violated at the iterations of k and k-1, then the value of ρjk+1 is gradually enlarged according to the fact that the value of the multiplier σjk may be rather distant from its optimal value. If constraint (5) varies between infeasibility and feasibility, then the value of ρjk+1 is decreased to move the multiplier value σjk towards its optimal value.According to Theorem2, since the Hessian matrix of Hamiltonian function (29) with respect to (p,SR,RL) is a negative definite matrix, we clearly conclude that the Hamiltonian function is concave. Furthermore, It can be evidently stated that the expression ∑i=1nSRi(T)-∑i=1nciRLi(T) in (2) is concave, constraints (6) and (7) are quasi-concave in (p,SR,RL), constraint (5) is quasi-concave in (SR,RL). Therefore the obtained solution satisfied the conditions of Theorem 1 is optimal. In other words, the optimal solution of the primal and dual problems is equal.The proposed heuristic algorithm has the following steps:Step 1: Set Input parameters;Step 2: Setαj=0, j=1,…,m and calculate λit, λi′t, i=1,…,n using (42) and (44);Step 3: Calculate the price of the web service classi, pi,i=1,…,n using (45);Step 4: Compute the reservation level of the web service classes using (69);Step 5: If for allj∈{1,…,m}, the constraint (5) holds then go to 16;Step 6: For allj∈{1,…,m}, Set αj1=ε′ and ρj1=ε′′;Step 7: Setk=1;Step 8: Calculateλi′t, i=1,…,n using (44);Step 9: Calculate the price of the web service classes using (45);Step 10: Compute the reservation level of the web service classes using (69);Step 11: Setσjk=Caj-∑i=1ncapijRLiT, j=1,…,m;Step 12: For allj∈{1,…,m}, if σjk<0 then set αjk+1=max⁡{ε′,(1-ρjk)αjk}; else set αjk+1=(1+ρjk)αjk;Step 13: For allj∈{1,…,m}, if σjkσjk-1>0 then ρjk+1=ε1ρjk; else if σjkσjk-1<0 then ρjk+1=ε2ρjk; else ρjk+1=ρjk;Step 14: Ifσjk<ϑ; go to 16; else go to 15;Step 15: Setk=k+1 and go to 8;Step 16: End.


## 5. Numerical Result

We implement the proposed algorithm for a time horizon[0,T]. We plan to explore the effect of input parameters, that is, the demand function, shared resource capacity, cancellation rate, and market influence on the price, sales revenue, reservation level, total revenue, total cancellation revenue, and profit. Considered examples include two web service classes and one resource. Furthermore, the parameters of the algorithm are considered as ε′=0.01, ε′′=0.1, ε1=1.2, ε2=0.8, and ϑ=10-5. The proposed heuristic has been coded in Maple 15 on a PC with an AMD Dual core (2.31 GHz) CPU and 1 GB of RAM.In order to analyze the effect of various parameters, we firstly create Example 1 and then use it to form other examples. In other words, next examples are distinct from Example 1 in only one parameter which we want to identify its impact. Assume the demand function of the web service classi(i=1,…,2) be linear in terms of price with a time-dependent maximal demand and market influence, di(pi(t),t)=αi(t)-βipi(t)+Mfi. The demand requirement ∂di(pi(t),t)/∂pi=-βi<0 and ∂2di(t)/∂pi2=0 are satisfied. The maximal demand αit,(i=1,2) in a similar manner in the reference [42] is a quadratic function of the time and increasing in the first half of time horizon and decreasing in the second half of time horizon to study the impact of demand peak on the problem. Furthermore, we assume that QoS of the web service class 2 is better than the web service class 1. As a result, the cost and required resource of the unit web service class 2 and the maximal demand of web service class 2 are greater than the web service class 1. Furthermore, we suppose that the cancellation ratios θit, i=1,2 are constant through interval [0,T-1] and variable on interval (T-1,T], which can be given as
(70)θit=0.3t∈0,T-1tTt∈T-1,T,i=1,2.
Other selected inputs for Example 1 are summarized in Table 1.Table 1
Selected value for the input parameters of the web service classes.
d
i
(
p
i
,
t
)
c
i
e
i
ca
p
i
1
M
f
i
Web service class 1
(
20
+
5
t
-
1
2
t
2
)
-
p
1
(
t
)
8
0.2
0.1
0
Web service class 2
2(20+5t-12t2)-2p2(t)
16
0.2
0.2
0To set the capacity of the considered resource in Example 1, at first we solve it without considering capacity constraint. Then, according to the prices obtained, the optimal final reservation level for the web service classes is calculated and based on that, the maximum required total capacity of the considered resourceCAP=cap1I1*(T)+cap2I2*(T) is attained. Evidently, if the shared capacity of the resource remains greater than or equal to CAP, the strategies obtained are optimal. We utilize 0.75CAP as the total shared capacity of the considered resource for Example 1.


### 5.1. Impact of the Demand Function

We consider two following examples which are different from Example 1 in the demand functions. In Example 2,d1(p1,t) and d2(p2,t) of Example 1 have been doubled, while in Example 3, we triple the demand functions d1(p1,t) and d2(p2,t) of Example 1.Indicated curves in figures are labelled as follows:pli optimal pricing path for the example l and web service class i; dli optimal demand path for the example l and web service class i; Ili optimal reservation level path for the example l and web service class i; Rli optimal sales revenue path for the example l and web service class i.As we can see in Figure1, the price of web service classes increases as demand function doubles or trebles. During the time horizon, the prices first increase then decrease due to nature of the demand functions. Also, the price of the web service class 2 is equal for Examples 2 and 3 at the end of the time horizon. The main reason for that is lack of enough capacity for selling the web service class 2. In other words, as selling the web service class 1 gains more profit to the provider of the service at the end of the time horizon, the seller of the service refrains from selling the web service class 2. Another point here is that if the demand curve for one web service moves in a positive direction due to different reasons such as an increase in using the web service and its popularity, the provider of the service increases the price of the web service classes to manage the demand, its constant capacity, and increase the profit.The optimal price, demand, reservation level, and sales revenue path for Examples 1–3 over the considered time horizon.
(a)
(b)
(c)
(d)Moreover, it is illustrated in Figure1 that as the demand function moves in the positive direction, at first the sales of the web service classes increases, but decreases at the end of the time horizon. For instance, in Examples 2 and 3 the amount of sales gets equal to zero at the end of the time horizon. The main reason for such a collapse in sales is that the web service is sold over the capacity at the beginning of the time horizon and profit is gained for the provider through the penalties paid for the customers’ cancellation of their orders.Another conclusion derived from Figure1 is that as the demand function moves in the positive direction, the level of revenue gained from the sales and reservation level of the web service increase for class 1 while for class 2 they increase at the beginning of the time horizon, then decrease.Table2 shows the optimal total sales revenue, cancellation revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 2, and 3. According to that table, as demand function doubles or trebles, there is, respectively, an accretion equal to 23% and 36% for the total sale revenue, 42% and 66% for the total cancellation revenue, 24% and 38% for the total revenue, and 77% and 120% for the profit gained. Besides, according to this table, the ratio of the profit to the total revenue for Examples 1 to 3 is, respectively, equal to 31%, 45%, and 50% which indicates that accretion of the demand results in considerable accretion of the profit. Furthermore, the ratio of the total cancellation revenue to the profit is, respectively, 19%, 15%, and 14% for Examples 1, 2, and 3.Table 2
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1 to 3.
Example1
Example2
Example3
Sales revenue
1891
2331
2572
Cancellation revenue
118
168
197
Total revenue
2009
2499
2768
Profit
632
1120
1391
Profit/total revenue
31%
45%
50%
Cancellation revenue/profit
19%
15%
14%


### 5.2. Impact of the Cancellation Rate

To analyze the effect of fluctuations in cancellation rates, Examples 3 and 4 are considered which are different from Example 1 in merely the cancellation rate. The cancellation rates of the web service classes for Examples 3 and 4 are, respectively, 0.1 and 0.0. Thus, to analyze the effect of fluctuations in the cancellation rate, Examples 1, 4, and 5 are compared.It can be concluded from Figure2 that as the cancellation rate decreases, the service provider increases the price to augment his/her own profit. In other words, as the cancellation rate increases, the provider decreases his/her price to let more people purchase web service classes. In fact, as some of them cancel their orders, the total cancellation revenue increases which in turn raises the profit of the provider.The optimal price, demand, reservation level, and sales revenue path for Examples 1, 4, and 5 over the considered time horizon.
(a)
(b)
(c)
(d)The reservation level grows as the cancellation rate increases through time. Moreover, when the cancellation rate is zero, the service provider refrains from selling the web service class 2 at the beginning and end of the selling horizon because it gains great profit for the provider.As the cancellation rate increases, the reservation level increases for the web service class 1, but decreases for the web service class 2. The main reason for this is constancy of the resource capacity for Examples 1, 4, and 5. In other words, as the cancellation rate increases for the web service provider it is predicted that they sell more expensive web service class since it gains more profit for them. As a result, due to the constancy of capacity, there is a decline in the reservation level for the web service class 1 as the sales of the web service increases for class 2.Table3 denotes the total sales revenue, cancellation revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 4, and 5. Based on Table 3, for Examples 4 and 5, respectively, there is a growth equal to 17% and 36% for the total sales revenue, 13% and 28% for the total revenue, and 42% and 89% for the profit obtained. Furthermore, it can be observed that the ratio of the profit to the total revenue for Examples 4 and 5 is equal to 39% and 46% which indicates that accretion of the cancellation rate results in considerable accretion of the profit. The ratio of the total cancellation revenue to the profit is, respectively, 6% and 0% for Examples 4 and 5.Table 3
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1, 4, and 5.
Example1
Example4
Example5
Sales revenue
1891
2219
2570
Cancellation revenue
118
60
0
Total revenue
2009
2278
2570
Profit
632
900
1192
Profit/total revenue
31%
39%
46%
Cancellation revenue/profit
19%
7%
0%


### 5.3. Impact of the Resource Capacity

To investigate the effect of fluctuations in resource capacity, Examples 5 and 6 are taken into account which are different from Example 1 only in resource capacity. Resource capacities for Examples 6 and 7 are, respectively, takenCAP and 0.5CAP.Figure3 shows quite well that by the accretion of the level of resource capacity the price for the web service classes decreases. In other words, as the capacity increases, the provider raise his/her profit by decreasing his/her price. For all the considered examples the prices increase at first, then decrease. The main reason for this can be found in the type of the demand function.The optimal price, demand, reservation level, and sales revenue path for Examples 1, 6, and 7 over the considered time horizon.
(a)
(b)
(c)
(d)The amount of sales revenue decreases as the capacity decreases. In Example 6, which has the least capacity, the provider avoids selling the web service 2 at the end of time horizon. This, in turn, leads to an increase in the optimal consumption of the desired resources.As the level of the resource capacity increases, the reservation level and sales revenue level increase. However, it should be mentioned that this increase in the reservation level and sales revenue level continues until there is no unused capacity. In case there is extra capacity, accretion in the capacity will actually have no effect on the fluctuations of the level of reservation and revenue.Table4 summarizes the total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 6, and 7. As the capacity of considered resource is, respectively, dropped by 25% and 50% for Examples 1 and 6, there is a 15% and 36% decrease in the sales revenue, 10% and 25% in the cancellation revenue, 15% and 35% in the total revenue, and 5% and 11% in the profit.Table 4
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1, 6, and 7.
Example1
Example6
Example7
Sales revenue
2234
1437
1891
Cancellation revenue
131
98
118
Total revenue
2365
1535
2009
Profit
605
540
575
Profit/total revenue
26%
35%
31%
Cancellation revenue/profit
22%
18%
19%


### 5.4. Impact of the Market Influence

To evaluate market influence on the pricing strategies of the web service, Examples 8 to 11 are considered which are different from Example 1 only in demand functions. In general, for each example, the demand function for web service classes 1 and 2 is shown by30-p1(t)+Mf1, 30-p2(t)+Mf2, respectively. Demand functions of Examples 8 to 11 are different only in the value of the market influence. Therefore, the market influence value in the demand function of the web service classes 1 and 2 for Examples 8 to 11 can be mentioned as in Example 8  Mf1=(20+5t-(1/2)t2), Mf2=(20+5t-(1/2)t2); in Example 9  Mf1=(20+5t-(1/2)t2)/2, Mf2=(20+5t-(1/2)t2)/2; in Example 10  Mf1=(20+5t-(1/2)t2)/4, Mf2=(20+5t-(1/2)t2)/4; in Example 8  Mf1=(20+5t-(1/2)t2)/8, Mf2=(20+5t-(1/2)t2)/8.Figure4 depicts that as the market influence increases, the service provider increases the price to augment his/her own profit. In other words, as the market influence augments, the demand increases and the provider increases his/her price for managing demand and maximizing resource utilization.The optimal price, demand, reservation level, and sales revenue path for Examples 8 to 11 over the considered time horizon.
(a)
(b)
(c)
(d)As the market influence increases, the reservation level increases for the web service class 1 but decreases for the web service class 2. The main reason for this is constancy of resource capacity for Examples 8 to 11. In other words, as the market influence increases for the web service provider it is anticipated that he/she sells more web service class 1 since it gains more profit. As a result, due to the constancy of capacity, there is an increase in the reservation level for web service class 1 as the sales of the web service declines for the web service class 2.Table4 shows the sales revenue, cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 8 to 11. According to Table 5, for Examples 8, 9, 10, and 11, as the market influence decreases, the sales revenue, cancellation revenue, and total revenue decline. Additionally, it can be detected that the ratio of the profit to the total revenue for Examples 8, 9, and 10 and 11 is equal to 70%, 58%, 49%, and 43%. The ratio of the total cancellation revenue to the profit is, respectively, 9%, 10%, 12%, and 14 for Examples 8, 9, 10, and 11.Table 5
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples8 to 11.
Example8
Example9
Example10
Example11
Sales revenue
4331
3058
2520
2269
Cancellation revenue
286
197
158
139
Total revenue
4616
3256
2678
2409
Profit
3238
1880
1300
1031
Profit/total revenue
70%
58%
49%
43%
Cancellation revenue/profit
9%
10%
12%
14%


### 5.5. Comparison the Proposed Algorithm with GA and SA

This section is provided for comparison the results of the proposed algorithm with those of the existing metaheuristics such as GA and SA. Further information about GA and SA can be found in references [55–62]. Examples 1 to 11 can be first modelled by the discretized model described in Section 2.3 and then solved by the existing solvers for GA and SA in MATLAB. In this performed experiment, we consider the value of parameters for the discretized model as follows: N=100, τ1=τ2=⋯=τN=10/N and tl=ql×10/N, l=1,…,N. Furthermore, Primary experiments denote that selecting the value of the parameters for GA and SA based on Tables 6 and 7, respectively, generates better results in comparison with other values.Table 6
The value of GA parameters.
Parameter
Value
Population size
20
Scaling function
Rank
Elite count
5
Selection function
Roulette
Crossover fraction
0.85
Mutation fraction
0.15
Crossover function
Two point crossover
Mutation function
Gaussian
Stopping criteria
100 generationsTable 7
The value of SA parameters.
Parameter
Value
Annealing function
Boltzmann annealing
Temperature update function
Exponential temperature update
Stopping criteria
500 iterations
Initial temperature
100
Acceptance criteria
Simulated annealing acceptanceTable8 denotes that the performance of the proposed is better than that of GA and SA. The main reason is that the proposed model considers the entire pricing strategies within the time horizon. Contrarily, the other approaches offer optimal prices in only 100 points. Furthermore, Table 7 shows that SA generates inferior results with respect to other algorithms.Table 8
The objective function value of Examples 1 to 11 for the proposed algorithm, GA, SA, and PS.
Examples
The proposed algorithm
GA
SA
Example1
632
600
6586
Example2
1120
1100
1090
Example3
1391
1375
1360
Example4
900
860
850
Example5
1192
1170
1160
Example6
605
580
573
Example7
540
533
522
Example8
3238
3202
3194
Example9
1880
1870
1865
Example10
1300
1295
1280
Example11
1031
1015
1005


## 5.1. Impact of the Demand Function

We consider two following examples which are different from Example 1 in the demand functions. In Example 2,d1(p1,t) and d2(p2,t) of Example 1 have been doubled, while in Example 3, we triple the demand functions d1(p1,t) and d2(p2,t) of Example 1.Indicated curves in figures are labelled as follows:pli optimal pricing path for the example l and web service class i; dli optimal demand path for the example l and web service class i; Ili optimal reservation level path for the example l and web service class i; Rli optimal sales revenue path for the example l and web service class i.As we can see in Figure1, the price of web service classes increases as demand function doubles or trebles. During the time horizon, the prices first increase then decrease due to nature of the demand functions. Also, the price of the web service class 2 is equal for Examples 2 and 3 at the end of the time horizon. The main reason for that is lack of enough capacity for selling the web service class 2. In other words, as selling the web service class 1 gains more profit to the provider of the service at the end of the time horizon, the seller of the service refrains from selling the web service class 2. Another point here is that if the demand curve for one web service moves in a positive direction due to different reasons such as an increase in using the web service and its popularity, the provider of the service increases the price of the web service classes to manage the demand, its constant capacity, and increase the profit.The optimal price, demand, reservation level, and sales revenue path for Examples 1–3 over the considered time horizon.
(a)
(b)
(c)
(d)Moreover, it is illustrated in Figure1 that as the demand function moves in the positive direction, at first the sales of the web service classes increases, but decreases at the end of the time horizon. For instance, in Examples 2 and 3 the amount of sales gets equal to zero at the end of the time horizon. The main reason for such a collapse in sales is that the web service is sold over the capacity at the beginning of the time horizon and profit is gained for the provider through the penalties paid for the customers’ cancellation of their orders.Another conclusion derived from Figure1 is that as the demand function moves in the positive direction, the level of revenue gained from the sales and reservation level of the web service increase for class 1 while for class 2 they increase at the beginning of the time horizon, then decrease.Table2 shows the optimal total sales revenue, cancellation revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 2, and 3. According to that table, as demand function doubles or trebles, there is, respectively, an accretion equal to 23% and 36% for the total sale revenue, 42% and 66% for the total cancellation revenue, 24% and 38% for the total revenue, and 77% and 120% for the profit gained. Besides, according to this table, the ratio of the profit to the total revenue for Examples 1 to 3 is, respectively, equal to 31%, 45%, and 50% which indicates that accretion of the demand results in considerable accretion of the profit. Furthermore, the ratio of the total cancellation revenue to the profit is, respectively, 19%, 15%, and 14% for Examples 1, 2, and 3.Table 2
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1 to 3.
Example1
Example2
Example3
Sales revenue
1891
2331
2572
Cancellation revenue
118
168
197
Total revenue
2009
2499
2768
Profit
632
1120
1391
Profit/total revenue
31%
45%
50%
Cancellation revenue/profit
19%
15%
14%


## 5.2. Impact of the Cancellation Rate

To analyze the effect of fluctuations in cancellation rates, Examples 3 and 4 are considered which are different from Example 1 in merely the cancellation rate. The cancellation rates of the web service classes for Examples 3 and 4 are, respectively, 0.1 and 0.0. Thus, to analyze the effect of fluctuations in the cancellation rate, Examples 1, 4, and 5 are compared.It can be concluded from Figure2 that as the cancellation rate decreases, the service provider increases the price to augment his/her own profit. In other words, as the cancellation rate increases, the provider decreases his/her price to let more people purchase web service classes. In fact, as some of them cancel their orders, the total cancellation revenue increases which in turn raises the profit of the provider.The optimal price, demand, reservation level, and sales revenue path for Examples 1, 4, and 5 over the considered time horizon.
(a)
(b)
(c)
(d)The reservation level grows as the cancellation rate increases through time. Moreover, when the cancellation rate is zero, the service provider refrains from selling the web service class 2 at the beginning and end of the selling horizon because it gains great profit for the provider.As the cancellation rate increases, the reservation level increases for the web service class 1, but decreases for the web service class 2. The main reason for this is constancy of the resource capacity for Examples 1, 4, and 5. In other words, as the cancellation rate increases for the web service provider it is predicted that they sell more expensive web service class since it gains more profit for them. As a result, due to the constancy of capacity, there is a decline in the reservation level for the web service class 1 as the sales of the web service increases for class 2.Table3 denotes the total sales revenue, cancellation revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 4, and 5. Based on Table 3, for Examples 4 and 5, respectively, there is a growth equal to 17% and 36% for the total sales revenue, 13% and 28% for the total revenue, and 42% and 89% for the profit obtained. Furthermore, it can be observed that the ratio of the profit to the total revenue for Examples 4 and 5 is equal to 39% and 46% which indicates that accretion of the cancellation rate results in considerable accretion of the profit. The ratio of the total cancellation revenue to the profit is, respectively, 6% and 0% for Examples 4 and 5.Table 3
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1, 4, and 5.
Example1
Example4
Example5
Sales revenue
1891
2219
2570
Cancellation revenue
118
60
0
Total revenue
2009
2278
2570
Profit
632
900
1192
Profit/total revenue
31%
39%
46%
Cancellation revenue/profit
19%
7%
0%


## 5.3. Impact of the Resource Capacity

To investigate the effect of fluctuations in resource capacity, Examples 5 and 6 are taken into account which are different from Example 1 only in resource capacity. Resource capacities for Examples 6 and 7 are, respectively, takenCAP and 0.5CAP.Figure3 shows quite well that by the accretion of the level of resource capacity the price for the web service classes decreases. In other words, as the capacity increases, the provider raise his/her profit by decreasing his/her price. For all the considered examples the prices increase at first, then decrease. The main reason for this can be found in the type of the demand function.The optimal price, demand, reservation level, and sales revenue path for Examples 1, 6, and 7 over the considered time horizon.
(a)
(b)
(c)
(d)The amount of sales revenue decreases as the capacity decreases. In Example 6, which has the least capacity, the provider avoids selling the web service 2 at the end of time horizon. This, in turn, leads to an increase in the optimal consumption of the desired resources.As the level of the resource capacity increases, the reservation level and sales revenue level increase. However, it should be mentioned that this increase in the reservation level and sales revenue level continues until there is no unused capacity. In case there is extra capacity, accretion in the capacity will actually have no effect on the fluctuations of the level of reservation and revenue.Table4 summarizes the total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 1, 6, and 7. As the capacity of considered resource is, respectively, dropped by 25% and 50% for Examples 1 and 6, there is a 15% and 36% decrease in the sales revenue, 10% and 25% in the cancellation revenue, 15% and 35% in the total revenue, and 5% and 11% in the profit.Table 4
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples1, 6, and 7.
Example1
Example6
Example7
Sales revenue
2234
1437
1891
Cancellation revenue
131
98
118
Total revenue
2365
1535
2009
Profit
605
540
575
Profit/total revenue
26%
35%
31%
Cancellation revenue/profit
22%
18%
19%


## 5.4. Impact of the Market Influence

To evaluate market influence on the pricing strategies of the web service, Examples 8 to 11 are considered which are different from Example 1 only in demand functions. In general, for each example, the demand function for web service classes 1 and 2 is shown by30-p1(t)+Mf1, 30-p2(t)+Mf2, respectively. Demand functions of Examples 8 to 11 are different only in the value of the market influence. Therefore, the market influence value in the demand function of the web service classes 1 and 2 for Examples 8 to 11 can be mentioned as in Example 8  Mf1=(20+5t-(1/2)t2), Mf2=(20+5t-(1/2)t2); in Example 9  Mf1=(20+5t-(1/2)t2)/2, Mf2=(20+5t-(1/2)t2)/2; in Example 10  Mf1=(20+5t-(1/2)t2)/4, Mf2=(20+5t-(1/2)t2)/4; in Example 8  Mf1=(20+5t-(1/2)t2)/8, Mf2=(20+5t-(1/2)t2)/8.Figure4 depicts that as the market influence increases, the service provider increases the price to augment his/her own profit. In other words, as the market influence augments, the demand increases and the provider increases his/her price for managing demand and maximizing resource utilization.The optimal price, demand, reservation level, and sales revenue path for Examples 8 to 11 over the considered time horizon.
(a)
(b)
(c)
(d)As the market influence increases, the reservation level increases for the web service class 1 but decreases for the web service class 2. The main reason for this is constancy of resource capacity for Examples 8 to 11. In other words, as the market influence increases for the web service provider it is anticipated that he/she sells more web service class 1 since it gains more profit. As a result, due to the constancy of capacity, there is an increase in the reservation level for web service class 1 as the sales of the web service declines for the web service class 2.Table4 shows the sales revenue, cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples 8 to 11. According to Table 5, for Examples 8, 9, 10, and 11, as the market influence decreases, the sales revenue, cancellation revenue, and total revenue decline. Additionally, it can be detected that the ratio of the profit to the total revenue for Examples 8, 9, and 10 and 11 is equal to 70%, 58%, 49%, and 43%. The ratio of the total cancellation revenue to the profit is, respectively, 9%, 10%, 12%, and 14 for Examples 8, 9, 10, and 11.Table 5
The optimal total sales revenue, total cancellation revenue, total revenue, profit, ratio of the profit to the total revenue, and ratio of the total cancellation revenue to the profit for Examples8 to 11.
Example8
Example9
Example10
Example11
Sales revenue
4331
3058
2520
2269
Cancellation revenue
286
197
158
139
Total revenue
4616
3256
2678
2409
Profit
3238
1880
1300
1031
Profit/total revenue
70%
58%
49%
43%
Cancellation revenue/profit
9%
10%
12%
14%


## 5.5. Comparison the Proposed Algorithm with GA and SA

This section is provided for comparison the results of the proposed algorithm with those of the existing metaheuristics such as GA and SA. Further information about GA and SA can be found in references [55–62]. Examples 1 to 11 can be first modelled by the discretized model described in Section 2.3 and then solved by the existing solvers for GA and SA in MATLAB. In this performed experiment, we consider the value of parameters for the discretized model as follows: N=100, τ1=τ2=⋯=τN=10/N and tl=ql×10/N, l=1,…,N. Furthermore, Primary experiments denote that selecting the value of the parameters for GA and SA based on Tables 6 and 7, respectively, generates better results in comparison with other values.Table 6
The value of GA parameters.
Parameter
Value
Population size
20
Scaling function
Rank
Elite count
5
Selection function
Roulette
Crossover fraction
0.85
Mutation fraction
0.15
Crossover function
Two point crossover
Mutation function
Gaussian
Stopping criteria
100 generationsTable 7
The value of SA parameters.
Parameter
Value
Annealing function
Boltzmann annealing
Temperature update function
Exponential temperature update
Stopping criteria
500 iterations
Initial temperature
100
Acceptance criteria
Simulated annealing acceptanceTable8 denotes that the performance of the proposed is better than that of GA and SA. The main reason is that the proposed model considers the entire pricing strategies within the time horizon. Contrarily, the other approaches offer optimal prices in only 100 points. Furthermore, Table 7 shows that SA generates inferior results with respect to other algorithms.Table 8
The objective function value of Examples 1 to 11 for the proposed algorithm, GA, SA, and PS.
Examples
The proposed algorithm
GA
SA
Example1
632
600
6586
Example2
1120
1100
1090
Example3
1391
1375
1360
Example4
900
860
850
Example5
1192
1170
1160
Example6
605
580
573
Example7
540
533
522
Example8
3238
3202
3194
Example9
1880
1870
1865
Example10
1300
1295
1280
Example11
1031
1015
1005


## 6. Conclusion

In this paper, we have studied a web service-pricing problem with limited resources constraint over a definite time horizon. We have considered a provider who offers access to a web service with different QoS where users may purchase their required web service through a reservation system. The service provider adjusts the prices of the web service classes over a prespecified time horizon to manage demands and to maximize profit. Users have the right with no obligation to cancel their services as long as they pay a penalty. One of the important challenges for service providers is capacity limitation of the resources employed in offering the web service like network bandwidth and CPU time, which finds meaning when popularity of using web services increases. Thus, taking this important proposition into account makes pricing strategies considered by the provider has more credit. This paper has developed a continuous-time optimal control model for identifying pricing strategy for the web service classes where the demand of the service class depends on its price, market influence, and time. We have studied the optimality condition of the considered model based on the maximum principal and propose an algorithm to obtain the optimal pricing policy. Moreover, we have conducted numerical analyses to evaluate the effect of the demand function, shared resource capacity, and cancellation rate on the price, reservation level, sales revenue of the web service classes, and objective function. In addition, we have compared the proposed algorithm with genetic algorithm (GA) and simulated annealing (SA) available in MATLAB.This problem can be generalized to a condition where merely two web service providers offer a similar web service. Moreover, it can be supposed that the price offered by one of the providers affects the price offered by the other. This problem can also be examined when demand function and other parameters related to others is stochastic. Then, it can be solved using robust optimization methods. Finally, this time-continuous model can be adapted for dynamic pricing in different fields like grid computing, cloud computing, and other services and acceptable results be attained.



---

*Source: 783149-2015-02-22.xml*