Dynamic Pricing of a Web Service in an Advance Selling Environment

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.


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][2][3][4][5][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][12][13][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 time  uniformly spread across the interval [0, ].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][21][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 utilitybased 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][36][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][39][40], dynamic pricing [41][42][43][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.
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 (  /  )(  , Mf  , ) < 0 exists.Moreover, it is hypothesized that as the price increases, variations in the demand decrease which means the term ( 2   / 2  )(  , Mf  , ) ≤ 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 need  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 time  are spread uniformly in the interval [0, ].
(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.

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 class , cancellation revenue over the time horizon [0, ] is given by Since we assume the canceled orders for each web service class at time  uniformly spread across the interval [0, ], we can multiply   () by SR  ()  () to find the penalty of the customers who cancel their reservation for the web service class  at time .Integrating   ()  ()SR  () over the interval [0, ] clearly provides cancellation revenue for the web service class .
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 for  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.
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 ) minus the total cost (composed of the cost of the total reserved web service for different classes at time ).The state equations ( 3) and ( 4) illustrate the change of the sales revenue and reservation level at time , respectively.Sales revenue level change for the web service class  at time  is equal to the revenue that is obtained from selling the web service class  to   (  (), ) users at price   () minus the revenue that the provider misses due to users' cancellation.Since it is supposed that the canceled orders at time  uniformly spread across the interval [0, ], we apply expression SR  ()  () to calculate the provider missed revenue.Reservation level change rate for the web service class  at time  is equal to orders for the web service class  at time  minus the reserved orders that are canceled by the users at time .Constraint ( 5) is defined to make sure that the sum of sold resource  for all the web service classes is equal to or less than the shared capacity of the resource  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).

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: ( () ,  () , ) ≥ 0, where  is planned time horizon, () ∈  1 is the vector of state trajectories at time , () ∈  1 is the vector of control trajectories at time , the functions  from  1 ×  1 ×  into ,  from  1 ×  into ,  from  1 ×  1 ×  into  1 ,  from  1 ×  1 ×  into   , and  from  1 ×  into   are continuously differentiable with respect to all their argument.It is supposed that each element of the functions  depends explicitly on the control  and state .More exactly, the subsequent full rank condition must be held: Condition (20) denotes that the gradients with respect to  of all the active constraints  ≥ 0 must be linearly independent.
To express the maximum principle, it is essential to define the Hamiltonian function as follows: where 1 ∈  1 , whose components are termed adjoint variables.We also define the Lagrangian function as where 1 ∈   is a row vector, whose components are termed Lagrangian multipliers.
Theorem 1 (necessary condition).The necessary conditions for  * with the corresponding state trajectory  * 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: Satisfying With the transversality conditions where  ∈   is constant vector.At each  ∈ [0, ] and for all  satisfying ( * , , ) ≥ 0, the Lagrange multiplier is such that and the complementary slackness conditions are Theorem 2 (sufficiency).Let ( * ,  * , 1, 1, ) satisfy the necessary conditions in Theorem 1.
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 () must be linearly independent.The mixed inequality constraints for this problem are as follows:  = ((), (, )).Based on (20), it is needed to show that the rank  = (/(), diag()) is 2.The Matrix  ∈  2 × 3 can be written as follows: To demonstrate the rank  = 2, we can see the follwoing: since there are 2 rows in , the rank is at most 2.If there is no binding constraint on the constraint sets ( 6) and ( 7), the last 2 columns are nonzero and linearly independent; as a result the rank of matrix is 2.For each  such that   () = 0, column  +  is the zero vector, however, it can be substituted with column  to gain a set of linearly independent columns.Similarly, for each  such that   (  (), ) = 0, since   (  (), Mf  (), )/  > 0, it can replace column  + 2 with column .It is necessary to note that the constraint sets ( 6) and ( 7) cannot be bound simultaneously.
Proof.Equation ( 38) is a linear first-order differential equation.Its standard form is λ () −   ()  () = −  ()  (), based on the available standard solution for the first order differential equation in [53], we have where    () =  − ∫   () , recalling (40) gives   () = (1/ where To achieve the optimal solution, these partial derivatives are set to zero as follows: Furthermore, by substituting ( 42) and ( 44) into (47), one can get To prove uniqueness of  *  () satisfying ( 6), (7), and (48).It is sufficient to show that  2 / Let the maximum price be   () at time , such that   (  (), Mf  (), ) = 0.If  *  lies within the interval [0,   ()], then it is the optimal control.Otherwise,  *  locates in the boundary of the set of feasible controls, that is, 0 or   (), depending on which value corresponds to the higher value of the optimization problem (36).
According to Proposition 7, 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  increases, the optimal price of the web service class  increases.
Proof.Suppose that 1  and 2  are two cost values for the unit web service class  such that 1  < 2  .To prove this proposition, one can show that the corresponding prices 1  and 2  have the following relationship: Removing the resource capacity constraint (5) and using (48) where   () =  ∫   () .
Proof.The proof of this proposition is similar to Proposition 11.

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   ,  = 1, . . ., .It employs (45) to find the solution for the determined multipliers.For the specified multipliers   ,  = 1, . . ., , 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   ,  = 1, . . .,  and repeat the algorithm from the beginning.At th iteration of the proposed algorithm, the solution    (),  ∈ [0, ],  = 1, . . ., , is first calculated by using ( 45 In this method, if    < 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    ≥ 0, then constraint ( 5) is not violated and the value of the multipliers must be decreased.
Furthermore, the parameters  +1  are updated as follows: 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  and  − 1, then the value of  +1  is gradually enlarged according to the fact that the value of the multiplier    may be rather distant from its optimal value.If constraint (5) varies between infeasibility and feasibility, then the value of  +1  is decreased to move the multiplier value    towards its optimal value.
According to Theorem 2, since the Hessian matrix of Hamiltonian function (29) with respect to (, 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 ∑  =1 SR  () − ∑  =1   RL  () in ( 2) is concave, constraints ( 6) and ( 7) are quasi-concave in (, 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.

Numerical Result
We implement the proposed algorithm for a time horizon [0, ].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 class  ( = 1, . . ., 2) be linear in terms of price with a time-dependent maximal demand and market influence,   (  (), ) =   () −     () + Mf  .The demand requirement   (  (), )/  = −  < 0 and  2   ()/ 2  = 0 are satisfied.The maximal demand   (), ( = 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   (),  = 1, 2 are constant through interval [0,  − 1] and variable on interval ( − 1, ] which can be given as Other selected inputs for Example 1 are summarized in Table 1. To 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 resource CAP = cap 1  * 1 () + cap 2  * 2 () 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. Indicated curves in figures are labelled as follows:  optimal pricing path for the example  and web service class ;  optimal demand path for the example  and web service class ;  optimal reservation level path for the example  and web service class ;  optimal sales revenue path for the example  and web service class .

Impact of the
As we can see in Figure 1, 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.Moreover, it is illustrated in Figure 1 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 Figure 1 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.
Table 2 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.It can be concluded from Figure 2 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.

Impact of the Cancellation
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.
Table 3 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. Figure 3 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.

Impact of the Resource
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.
Table 4 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.4 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  Mathematical Problems in Engineering his/her price for managing demand and maximizing resource utilization.

Impact of the Market
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.
Table 4 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.

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][56][57][58][59][60][61][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:  = 100,  1 =  2 = ⋅ ⋅ ⋅ =   = 10/ and   =   × 10/,  = 1, . . ., .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 8 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.

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.

Figure 1 :
Figure 1: The optimal price, demand, reservation level, and sales revenue path for Examples 1-3 over the considered time horizon.
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.
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, taken CAP and 0.5CAP.

Figure 2 :
Figure 2: The optimal price, demand, reservation level, and sales revenue path for Examples 1, 4, and 5 over the considered time horizon.

Figure 3 :
Figure 3: The optimal price, demand, reservation level, and sales revenue path for Examples 1, 6, and 7 over the considered time horizon.

Figure 4 :
Figure 4: The optimal price, demand, reservation level, and sales revenue path for Examples 8 to 11 over the considered time horizon.

Table 1 :
Selected value for the input parameters of the web service classes.

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 Examples 1 to 3.

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 Examples 1, 4, and 5.

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 Examples 1, 6, and 7.

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 Examples 8 to 11.

Table 6 :
The value of GA parameters.

Table 7 :
The value of SA parameters.

Table 8 :
The objective function value of Examples 1 to 11 for the proposed algorithm, GA, SA, and PS.