Mantere & Lindfors : Unit commitment . 247 24.2.1 Simplex algorithm with exclusive condition Pairwise exclusive restriction was defined between two variables so that they are not both allowed to differ from zero at any time . In practise this means that only one of the two exclusive variables are included in the base solution . Zero-one constrain for variable z is obtained by letting x0 ? z = 0 , which is a nonlinear constrain and thus requires exclusive restriction . Standard simplex algorithm performs one pivoting at a time . Because of the variable pairs x0 and z for each plant , the simplex algorithm is not able to efficiently change plants in the base solution . This problem was solved by trying to remove the variable that blocks pivoting due to the exclusive restriction condition from the base solution by double pivoting . In practise this was done by searching horizontally a pivot candidate that could remove the blocking variable so that these two pivot operations evaluated together will improve the object function . Double pivoting improved performance , but it was not able to replace one large plant by two or more smaller plants simultaneously . It had also difficulties in shutting down plants between two peek periods . These problem might be solved by a more general multipivoting . 24.2.2 Simplex algorithm with penalty function Because it seemed difficult to find the global solution by linear programming using excluding conditions , we then tried to solve the problem first using standard linear programming letting 0/1 - variables to have values in the range -LSB- 0 ; 1 -RSB- . After this preliminary solution a postprocessing algorithm tries to transform all z-variables into either one or zero by changing the base and keeping the object function as good as possible . This was done by the penalty function : ctot = cobj + M X i ; j zji ? -LRB- 1 ? zji -RRB- -LRB- 24.1 -RRB- This is possible by scanning all pivot candidates , and then by selecting the best and evaluating it . If we do not find any such pivot element , we increase the penalty parameter M , until all variables z are either zero or one after which we again try to find still better solutions by some new pivoting . With this modification we got quite good solutions while the processing time was not substantially longer than that of the standard simplex method . It seemed that the quality of the solution somewhat depends on the initial penalty parameter M and the way it was increased during the iteration . 24.2.3 Lp solve Lp solve is simplex based program , which solves mixed integer problems using branch and bound method . It operates on both real and integer variables so that 248 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 we do not need any special constraint for variable z. Lp solve worked quite well , and it gave the best solution for all of our 20 test problems , but the processing time increased substantially , when the problem size increased . Lp solve is available via anonymous ftp -LRB- ftp : / / ftp.es.ele.tue.nl / pub/lp solve -RRB- . 24.2.4 Interior point algorithm From interior point algorithms we selected affine scaling primal algorithm , which had an additional penalty function . It was selected because we could use the penalty term M , which was not possible when using the other interior point algorithms . -LSB- 93 -RSB- One problem when using interior point method is to find the right values for the penalties M . The other problem is that the interior point algorithm is not allowed to to reach the limits of the solution space and so we must round the solution to the nearest limit . The constraint matrix has also tendency to be unstable at some points . Therefore it is best to start by finding an initial solution without the zero-one constraint on z e.g. by a simplex method , after which we could try to continue by solving the integer problem . 24.2.5 Genetic algorithms Unit commitment problem has been quite popular topic when applying genetic algorithms in power engineering . According to -LSB- 55 -RSB- at least the following references has used GA -LSB- 89 , 144 , 328 , 329 , 378 , 389 , 431 , 448 , 501 , 503 , 523 -RSB- . Genocop Genocop is a program that solves linear programming problems using genetic algorithm . It is available via Internet -LRB- ftp : / / ftp.uncc.edu/coe/evol -RRB- -LSB- 414 -RSB- . It does not accept integer variables , so that we must again replace the zeroone variable z by the penalty function . The initial solution was searched by a simplex algorithm , after which the mixed integer solution was attacked , just like it was done with the interior point method . The constraints , excluding the power demand one , were easily represented by corresponding penalties in the fitness function . A lot of generations were needed to reach the optimum and often the algorithm was trapped by a local optimum . After having tried to solve the unit commitment problem by Genocop we implemented a special genetic algorithm based method able to handle also zeroone variables . All constraints , except the upper limits of variables , were moved to the fitness function . A special mutation operator changing plants inside a period was used to enchance the performance of this algorithm . Mantere & Lindfors : Unit commitment . 249 24.3 Results Table 24.1 shows the costs -LRB- in FIM -RRB- for each test case evaluated by each method . Plants Periods Exclusive Penalty Lp solve Genocop Interior Point 3 4 1675000 1675000 1675000 1675000 1675000 4 5 7391048 6630500 6630500 6908500 6760500 4 6 5368504 5178500 5178500 5199600 5186000 4 7 6247207 5966399 5966400 6159461 6074400 4 8 5870594 5716999 5717000 5808400 5717000 4 10 5196358 5021002 5020400 5 5 4385610 4202604 4202600 4272200 4206400 5 6 4807026 4517000 4517000 4681400 4602200 5 7 9520046 8816796 8774800 8909600 8818400 5 10 10678381 9325202 9128000 5 14 13849627 12368501 11802500 6 10 16204259 13954019 13447600 6 12 52096195 38571996 37727000 38045800 6 15 29796715 23620010 23610000 7 10 26093451 21423004 21299000 7 12 20967027 17889797 17542200 7 15 23320971 22354914 22223850 7 16 37323422 24047797 24023000 8 18 50733723 36485949 36485960 8 20 45452715 45126750 Table 24.1 : Comparison of schedule cost with different methods . Plants = The amount of electric power plants , Periods = The amount of periods , over which the optimization is done , Exclusive = Simplex-algorithm with exclusive condition , Penalty = Simplex algorithm with penalty function , Lp solve = Lp solve program , Genocop = Genocop program , and Interior point = Interior point method with penalty function . For all 20 test cases Lp solve program gave the best solution , simplex-algorithm with penalty function is a close second . Genocop needed reprogramming of the fitness function for each test case and that is why it was not used to evaluate all cases . The population size was 80 and it was run for 1000 generations . The interior point method could not evaluate reasonable solutions when the program size increased . In table 24.2 the performance times are : with Genocop-program , time of 1000 generations with population size of 80 , with interior point method , time of 30 iteration loops and other algorithms , the time of finding optimal solution . Simplex algorithm with special exclusive restriction , double pivoting and additional penalty function remained fast also after the modifications made . 250 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 case 1 case 2 time -LSB- s -RSB- time -LSB- s -RSB- Plants 5 6 Periods 7 12 Exclusive 1 4 Penalty 1 5 Lp solve 2 311 Genocop 42 171 Interior point 56 574 Table 24.2 : Processing times of different algorithms in seconds in two test cases using 150MHz Pentiumz PC . Lp solve is fast when solving small problems , but the processing time increases rapidly with the problem size , when it is more difficult to reach the zero-one solutions by the branch and bound postprosessing . Genocop took a lot of time already with the small test cases , but the procecessing time do not increase that rapidly with the problem size . This is quite nice for the larger problems for which the linear methods grow quadratically . The interior point method need a lot of hard matrix operations and the processing time is long already with the small cases and unfortunately also increases rapidly with the problem size . 24.4 Conclusions Linear programming , simplex algorithm and integer solving methods are decades old and there has not been substantial development over the last years , unlike in the development of genetic algorithms and the interior point methods . The developed extensions to the simplex method increased substantially its ability to solve non-linear problems like the unit commitment , while still keeping its fine operation speed nearly untouched . For a method to be really good in solving the unit commitment problem , we would expect it to have the speed and liability of the simplex algorithm . Genetic algorithms require special means to solve such a constrained problem . More information -LSB- 399 -RSB- . 24.5 Bibliography See chapter bibliography at the end of this proceedings . Chapter 25 Risk-Sensitive Control of ATM Traffic Alexandru Murgu Department of Mathematics University of Jyv?askyl?a P.O. Box 35 , FIN -LCB- 40351 Jyv?askyl?a , Finland E-mail : murgu@julia.math.jyu.fi Abstract . In broadband ATM networks , the traffic generated by a wide range of sources having diverse characteristics is subject to different performance constraints when passing through the communication system . This is so because the statistical multiplexing of the bursty traffic flows generates buffering delays and losses during the transportation through the network . In this paper we consider a Genetic Algorithm -LRB- GA -RRB- implementation of an adaptive control scheme which offers a higher degree of robustness in handling different classes of traffic and optimizing the network resources based on risk-sensitive arguments . The risk-sensitivity equations are equivalent of the time series aggregation of the traffic patterns . Some numerical results show the performance of the traffic controller for bursty ATM flows . The complete title of this article : \ Risk-Sensitive Traffic Control of ATM Networks Using Time Series GA Modelling '' . The article is available via anonymous ftp at site ftp.uwasa.fi directory cs/2NWGA as file Murgu.ps.Z . 251 252 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 25.1 Aggregated Flows in ATM Networks The classical analysis technique are of limited applicability when we want a description of the modelling uncertainties associated with the stochastic control problems . One such example is the flow control problem in high speed ATM networks with mixed services -LSB- 374 -RSB- . The immediate result of the statistical multiplexing of various traffic pattern into the existing communication links is that the flow patterns are highly correlated in time and due to the finite link capacities , the flow control problem is a nonlinear one . The practical motivation behind of this approach is to find a modelling framework for describing the time aspects occurring in the ATM flow networks in order to improve the utilization of network resources and to get a higher degree of flexibility in handling the most demanding classes of users -LSB- 430 -RSB- . Toward this end , we consider an adaptive control approach for smoothing the traffic among the competing classes of flow patterns . The end-to-end communication performances of a virtual circuit connection for data transmission in a high-speed ATM network -LRB- delay and throughput -RRB- is highly depending upon the cell/packet delivery strategy used in the routing mechanism -LSB- 179 -RSB- . The main difficulty with the endto-end flow control lies on the nonlinearity of the delay-throughput balance and the statistical features of the links along the path -LSB- 432 -RSB- . It is certainly impractical to maintain a database that stores the network status or the information on the existing paths . These difficulties demand a more elaborated modelling of the network flow management . An typical structure of an ATM switching node is depicted in Fig. 25.1 . For communication traffic applications in the ATM networks , it is essential to distinguish certain origin-destination -LRB- O-D -RRB- flows from others , to make sure that the information entities -LRB- cells/packets -RRB- get to their correct destinations . We can do this in either of two ways . First , we can consider the flow from each origin to all destinations as a copy , each copy flow being distinguished by a superscript . Secondly , we may consider each O-D flow from a particular origin to a particular destination as a flow of a separate commodity , denoted by superscript -LRB- k -RRB- . For convenience , we shall use link flow for multicopy flow and chain flows for multicommodity flow . For the multicopy flow description , let ? be the copy flow from O and ? j the flow of this copy to destination node j . The link flow formulation for a multiple O-D networks is given by Ef = g ; = 1 ; 2 ; : : : ; -LRB- 25.1 -RRB- where E is the n ? l node-link incidence matrix , f is the l ? 1 link flow vector with elements equal to the link flows of copy and g is the n ? 1 copy flow vector with the elements gi = 8 < : ? ; if i is the origin of copy flow ?? i ; if i is a destination of copy flow ; otherwise : -LRB- 25.2 -RRB- Alexandru Murgu : Risk-Sensitive Control of ATM Traffic . 253 ATM SwitchInput Buffers Output Buffers 1 2 n-1 n 1 2 m-1 m : : 1 2 3 4 5 Figure 25.1 : The architecture of an ATM switching node . The total link flow and the total network flow are given by superposing the copy flows f = X f -LRB- 25.3 -RRB- ? = X ? = XX i ? i : -LRB- 25.4 -RRB- Copy flows have been labelled according to their origin . For the alternative description of the multiple O-D network flow as a superposition of multicommodity flows , we denote all possible origin-destination pairs by O -LRB- k -RRB- ? D -LRB- k -RRB- , k = 1 ; 2 ; : : : ; q and let m -LRB- k -RRB- j be the chains from O -LRB- k -RRB- to D -LRB- k -RRB- . If g -LRB- k -RRB- is the flow of commodity k from O -LRB- k -RRB- to D -LRB- k -RRB- and h -LRB- k -RRB- j , the chain flow on m -LRB- k -RRB- j , then g -LRB- k -RRB- = X j h -LRB- k -RRB- j : -LRB- 25.5 -RRB- If the links are denoted by i = 1 ; 2 ; : : : ; l and a -LRB- k -RRB- ij = ae 1 ; if link i is on chain m -LRB- k -RRB- j ; otherwise -LRB- 25.6 -RRB- then the link flow f -LRB- k -RRB- j of flow from O -LRB- k -RRB- to D -LRB- k -RRB- is given by f -LRB- k -RRB- i = X j a -LRB- k -RRB- ij h -LRB- k -RRB- j : -LRB- 25.7 -RRB- The total network flow is ? = X k g -LRB- k -RRB- -LRB- 25.8 -RRB- 254 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 and the total link flow fi on link i is fi = X k f -LRB- k -RRB- i = X k X j a -LRB- k -RRB- ij h -LRB- k -RRB- j : -LRB- 25.9 -RRB- The equations -LRB- 25.5 -RRB- and -LRB- 25.7 -RRB- can be written in matrix notation which is an obvious extension of that used above . Thus , -LRB- 25.5 -RRB- becomes g -LRB- k -RRB- = -LRB- e -LRB- k -RRB- -RRB- T h -LRB- k -RRB- -LRB- 25.10 -RRB- where e -LRB- k -RRB- is a column with all entries equal to unity and -LRB- 25.7 -RRB- becomes f -LRB- k -RRB- = A -LRB- k -RRB- h -LRB- k -RRB- -LRB- 25.11 -RRB- where A -LRB- k -RRB- is the link chain matrix . In order to distinguish flow on a tree with one home node from a tree with another home node , we use multicopy flows . It is characteristic for the ATM networks with statistical multiplexing of the flows that the passage of a flow through the network creates delays , incurs costs or in some way affects the behaviour of the traffic patterns -LSB- 596 -RSB- . In order to encode these penalties , we introduce the notion of the link cost cij -LRB- fij -RRB- as an average cost or cost per unit flow by defining the total link cost for a link -LRB- i ; j -RRB- with flow fij as fijcij -LRB- fij -RRB- : -LRB- 25.12 -RRB- The notation indicates that the link cost is a function of the link flow and this function may differ for different links . Furthermore , all flow units in link -LRB- i ; j -RRB- perceive the same link cost . The link cost will be additive , so that the route cost is the sum of the link costs together . If the costs for traversing nodes do not have to be included explicitly , the route cost of unit chain flow on the chain , denoted by the node sequence n1 ; n2 ; : : : ; nr from an origin n1 to a destination nr is given by C -LRB- n1 ; nr -RRB- = r ? 1 X i = 1 c -LRB- ni ; ni +1 -RRB- : -LRB- 25.13 -RRB- Finally , we define the network cost C as the sum of the total link costs for all the links of the network , that is C = X -LRB- i ; j -RRB- fijcij -LRB- fij -RRB- : -LRB- 25.14 -RRB- A prohibited link can be represented by an infinite cost . For multiple O-D networks , the link flows can be regarded as the superposition of chain flows hj , j = 1 ; 2 ; : : : ; m on the O-D chains mj . For flow dependent link cost , the route cost Cj on the jth chain is a function of all chain flows h1 ; h2 ; : : : ; hm since different chains can share the same links . We therefore write Cj -LRB- h1 ; h2 ; : : : ; hm -RRB- = Cj -LRB- h -RRB- -LRB- 25.15 -RRB- Alexandru Murgu : Risk-Sensitive Control of ATM Traffic . 255 for the route cost and C = X j hjCj -LRB- h -RRB- = CTh -LRB- 25.16 -RRB- for the network cost . 25.2 Time Series Modelling of Traffic Flows The basic idea behind this model is to divide the traffic patterns into several classes based on some quality of service requirements which should be smoothly satisfied . This approach is motivated by the complexity of the flow control problem while working with the entire flows . The incoming flow stream is divided among those classes and the specific constraints are assigned to each class . 25.2.1 Entropy Reformulation of Network Flows We consider a general distribution model for the flow control mechanism at the link level based on the concept of entropy . This concept provides a useful unifying basis for a class of distribution models commonly used in communication networks . We introduce the network entropy in terms of the dimensionless quantities aeij obtained by dividing fij by ? . The quantity aeij is interpreted as the joint probability of a flow trip being produced at zone i and attracted to zone j , implying the constraints < = aeij < = 1 -LRB- 25.17 -RRB- X i ; j aeij = 1 : -LRB- 25.18 -RRB- The overall network entropy is then given by H = ? X i ; j aeij ln aeij : -LRB- 25.19 -RRB- The network entropy is a measure of uncertainty and entropy distribution models are based on the principle that an equilibrium distribution maximizes the entropy . Suppose there is no knowledge about the distribution of trips for a network with m origin and n destination nodes . The entropy model is obtained by maximizing the network entropy -LRB- 25.19 -RRB- subject to -LRB- 25.17 -RRB- -LCB- -LRB- 25.18 -RRB- . Travel patterns indicate a general preference for shorter trips than longer trips . 25.2.2 Multivariate Smoothing of Statistical ATM Flows Let us extend the above description of the network flows to a multivariate statistical description in which the flow patterns splits into disjoint clusters based on 256 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 the criterion of a time varying average . The goal of this description is to obtain a scalar measure discriminating between different flow patterns . In order to describe the time dependency of the network cost -LRB- 25.14 -RRB- , we introduce the mean cost of a trip can be defined as c -LRB- t -RRB- = X -LRB- i ; j -RRB- aeij -LRB- t -RRB- cij : -LRB- 25.20 -RRB- We impose this relation , with c regarded as time dependent , as a constraint on the distribution model . In detail , the entropy model -LRB- 25.19 -RRB- can be reformulated as follows maxH = ? X i ; j aeij -LRB- t -RRB- ln aeij -LRB- t -RRB- -LRB- 25.21 -RRB- subject to X j aeij -LRB- t -RRB- = ui -LRB- t -RRB- ; i = 1 ; : : : ; l -LRB- 25.22 -RRB- X i aeij -LRB- t -RRB- = ? j -LRB- t -RRB- ; j = 1 ; : : : ; m -LRB- 25.23 -RRB- X i ; j aeij -LRB- t -RRB- = 1 -LRB- 25.24 -RRB- X i ; j aeij -LRB- t -RRB- cij = c -LRB- t -RRB- : -LRB- 25.25 -RRB- We define the augmented Lagrangian function L -LRB- aeij -LRB- t -RRB- ; > = i ; ? j ; ? ; -RRB- = ? X i ; j aeij -LRB- t -RRB- ln aeij -LRB- t -RRB- ? X i > = i X i aeij -LRB- t -RRB- ? ui -LRB- t -RRB- ! -LRB- 25.26 -RRB- ? X j ? j X i aeij -LRB- t -RRB- ? ? i -LRB- t -RRB- ! ? ? X i ; j aeij -LRB- t -RRB- ? 1 ! ? X i ; j aeij -LRB- t -RRB- cij ? c -LRB- t -RRB- ! : The following result establishes the structure of the solution for the optimization problem associated to -LRB- 25.26 -RRB- . Proposition 25.2.1 . The steady-state optimal values ae?ij -LRB- i.e. , for t ! 1 -RRB- are given by ae?ij = exp -LRB- ? 1 ? ? ? > = i ? ? j ? cij -RRB- -LRB- 25.27 -RRB- Alexandru Murgu : Risk-Sensitive Control of ATM Traffic . 257 where uj = exp -LRB- ? 1 ? ? ? > = i -RRB- X j exp -LRB- ?? j ? cij -RRB- -LRB- 25.28 -RRB- ? j = exp -LRB- ? 1 ? ? ? ? j -RRB- X i exp -LRB- ? > = j ? cij -RRB- -LRB- 25.29 -RRB- 1 = exp -LRB- ? 1 ? ? -RRB- X i ; j exp -LRB- ? > = i ? ? j ? cij -RRB- -LRB- 25.30 -RRB- c = exp -LRB- ? 1 ? ? -RRB- X i ; j cij exp -LRB- ? > = i ? ? j ? cij -RRB- : -LRB- 25.31 -RRB- In order to discriminate among the various flow patterns , the basic idea is to encode in this model the interfering traffic components given by the ATM switches along the virtual path . The classical Markov models are not suitable because the distributed interfering traffic can be highly correlated due to the states of neighbouring nodes of a given path -LSB- 434 -RSB- . The actual connection with a time series model of the entropy equations is to interpret each stage of the communication path as a time delay device , because on traversing successive links , the information entities experience a propagation delay . 25.3 Genetic Algorithm Mapping The main reason for using the genetic algorithm mapping in this traffic control problem is the very large dimension of system of equations -LRB- 25.21 -RRB- -LCB- -LRB- 25.25 -RRB- which arises even in the case of few classes of traffic patterns and few connected links . The dimension reduction is handled through a receding sequence of data batches while minimizing a risk-sensitive index . The adaptive and learning feature of genetic algorithm control provides a less expensive computational strategy -LSB- 200 , 212 -RSB- . The burstiness of the flow pattern constraints the control scheme to perform smoothly and to be robust against any statistics of perturbations -LSB- 327 -RSB- . 25.3.1 Risk-Sensitive Analysis of Batch Control The need of performing a risk-sensitive analysis -LSB- 591 -RSB- for the traffic flow control problem is to determine and to adapt the time schedules to the time varying constraints imposed for each class of flow patterns in -LRB- 25.22 -RRB- -LCB- -LRB- 25.23 -RRB- . Let C be a cost function given in -LRB- 25.16 -RRB- , ss the policy -LRB- i.e. , a complete specification of adaptive decision rules -RRB- and Ess the expectation operator induced by ss . The idea of optimization is to choose such a policy ss in order to minimize EssfCg . Naturally , one might be sensitive to the variability of C as well as to its expectation and then one might choose to minimize EssfL -LRB- C -RRB- g , where L is an increasing nonlinear 258 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 function . The function L can be regarded as an utility function . It is convenient to restore the criterion to its original cost scale by taking the criterion as L ? 1 -LSB- EssfL -LRB- C -RRB- g -RSB- -LRB- which makes sense even if L is decreasing -RRB- . A choice of L which is in many situations the natural one is the exponential function L -LRB- C -RRB- = e ?? C -LRB- 25.32 -RRB- and this criterion becomes ss -LRB- ? -RRB- = ??? 1 log -LSB- Essfe ?? Cg -RSB- -LRB- 25.33 -RRB- where ? is a risk-sensitivity parameter . This choice has at least three advantages : a -RRB- It decouples the expectation and variance of C , so if we expand under the expectation in -LRB- 25.33 -RRB- in powers of C ? EssfCg as far as the second , we find that ss -LRB- ? -RRB- = EssfCg ? 1 2 ? varssfCg + ? ? ? -LRB- 25.34 -RRB- The fact that the coefficient of varssfCg is independent of EssfCg indicates the decoupling of cross-traffic flows . b -RRB- If we make classical LQG assumptions , then exp -LRB- ?? C -RRB- is the exponential of a quadratic function , which fits naturally with Gaussian theory -LSB- 230 , 433 , 437 -RSB- . c -RRB- In the non-LQG case , the exponential choice is tailor-made for an application of large deviation theory . The exponential choice is convenient when parameter ? gives a natural index of risk-sensitivity and the optimizer is effectively risk-seeing , risk-neutral or riskaverse as ? > 0 , ? = or ? < 0 , respectively . The actual value of the parameter ? is a matter of fitting the Genetic Algorithm characteristics with the features of the stochastic control process at hand -LRB- i.e. , statistical properties of cross-traffic flows -RRB- . 25.3.2 Smoothing Control of Multiclass Flows To ensure the robustness to the traffic control scheme , a tracking feature is added to the smoothing controller . This is necessary in order to follow the time variations of traffic patterns and to detect the user class changes . This is done by using an input/output mapping approach to produce an one-step prediction of the class change in the time series modelling the traffic patterns -LSB- 423 , 179 , 432 , 434 , 433 , 437 -RSB- . The approach is based on minimizing a quadratic cost functional which has to capture of robustness measure to the heavy perturbations which may appear in the traffic patterns . In order to characterize Alexandru Murgu : Risk-Sensitive Control of ATM Traffic . 259 the process of changing the traffic class , the Kullback -LCB- Leibler distance or the relative entropy -LSB- 355 -RSB- gives an appropriate measure for the closeness between two propability distributions : K -LRB- f ; g -RRB- = N X k = 1 f -LRB- xk -RRB- ln ? f -LRB- xk -RRB- g -LRB- xk -RRB- ? -LRB- 25.35 -RRB- when in the network there are N classes of traffic . Here , f -LRB- xk -RRB- is an approximate solution of the problem -LRB- 25.21 -RRB- -LCB- -LRB- 25.25 -RRB- and g -LRB- xk -RRB- is a reference solution which is derived in the next . Here , xk is the vector unfolding of the matrix ae = -LRB- aeij -RRB- ij corresponding to class k of traffic . Since any monotonically decreasing function of the cost function can be selected as a fitness function , we consider the following analytical expression : g -LRB- xk -RRB- = exp ? ? 1 2xTk Qxk ? -LRB- 25.36 -RRB- where Q is a symmetric and positive definite matrix . This function corresponds to the utility function in -LRB- 25.32 -RRB- , assuming that the cost in -LRB- 25.16 -RRB- has been approximated locally by a quadratic form and the risk-sensitivity parameter is taken ? = 1 = 2 -LRB- risk-seeking case -RRB- . Based on this measure we introduce the elements of involving genetic computation into the traffic control scheme . The justification of using a genetic algorithm is its efficiency and robustness in the search process of an optimal solution -LSB- 474 -RSB- . It is well known that a genetic algorithm starts working with a randomly generated population and makes use of operators like crossover , selection and mutation for sequentially creating new generations of populations . Genetic Algorithm Mapping 1 . The initialization step consists in sampling N random vectors x10 ; : : : ; xN0 drawn from the initial m-dimensional Gaussian propability function f0 -LRB- x -RRB- / N -LRB- ? ; ? 0 -RRB- , where ? 0 is a positive definite matrix . 2 . At any moment k > = 0 , the selection operator transforms the current population -LRB- x1k ; : : : ; xNk -RRB- into the new population -LRB- x01k ; : : : ; x0Nk -RRB- such that Pr ? x0ik = xjkjx1k ; : : : ; xNk ? = g -LRB- xjk -RRB- NP l = 1 g -LRB- xlk -RRB- : -LRB- 25.37 -RRB- 3 . The mutation operator is represented by a white additive noise ? / N -LRB- 0 ; oe2Im -RRB- . Correspondingly , at any moment k , the current population satisfies a Gaussian distribution , N -LRB- ? k ; ? k -RRB- . 260 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 Proposition 25.3.1 . The sequences of mean vectors and respectively the sequence of covariance matrices are given by the following recursive equations : ? k +1 = oe2Im + -LRB- Q + ?? 1 k -RRB- ? 1 -LRB- 25.38 -RRB- ? k +1 = ? k ? -LRB- Q + ?? 1 k -RRB- ? 1rc -LRB- ? k -RRB- -LRB- 25.39 -RRB- where rc -LRB- x -RRB- is the gradient of the cost function c -LRB- x -RRB- = 1 2xTQx : -LRB- 25.40 -RRB- It can be assumed without loss of generality that ? 0 = Im . Let ? = -LSB- ' 1 ; : : : ; 'm -RSB- be the matrix whose columns are the orthonormal eigenvalues of the matrix Q , ? TQ ? = ? , where ? is the diagonal matrix of the corresponding eigenvalues , ? = 2 6664 > = 1 ? ? ? > = 2 ? ? ? ... ... ... . . ? ? ? > = m 3 7775 ; > = 1 > = ? ? ? > = > = m : -LRB- 25.41 -RRB- For any k > = 1 , we denote by ? k the diagonal matrix of the eigenvalues corresponding to the matrix ? k ? = 2 6664 > = -LRB- k -RRB- 1 ? ? ? > = -LRB- k -RRB- 2 ? ? ? ... ... ... . . ? ? ? > = -LRB- k -RRB- m 3 7775 : -LRB- 25.42 -RRB- In order to simplify the notations , in the following we will use the upper indices to denote the ranks and consequently we write > = kj instead of > = -LRB- k -RRB- j . The next results describe some of statistical properties of the genetic algorithm when implementing the adaptive control for ATM traffic . Theorem 25.3.1 . For any k > = 1 , ? k is a positive definite matrix and ? is its eigenvector matrix . Proof . We prove by induction that for any k > = 1 , > = k +1 j = oe2 + > = kj 1 + > = j > = kj ; 1 < = j < = m -LRB- 25.43 -RRB- and ? TQ ? = ? . Obviously , ? 1 = oe2Im + -LRB- Q + ?? 1 -RRB- ? 1 = oe2Im + -LRB- Q + Im -RRB- ? 1 -LRB- 25.44 -RRB- Alexandru Murgu : Risk-Sensitive Control of ATM Traffic . 261 hence , ? T ? 1 ? = oe2Im + ? T -LRB- Q + Im -RRB- ? 1 ? = oe2Im + -LRB- ? TQ ? + Im -RRB- ? 1 -LRB- 25.45 -RRB- = oe2Im + -LRB- ? + Im -RRB- ? 1 = ? 01 : Therefore , ? 1 ? = ?? 01 , i.e. , ? is the matrix whose columns are the eigenvectors of ? 1 and ? 1 = ? 01 . Moreover , > = 1j = oe2 + 1 1 + > = j ; 1 < = j < = m -LRB- 25.46 -RRB- hence ? 1 is a positive definite matrix . Let us assume that ? k is a positive definite matrix and ? is the matrix whose columns are the eigenvectors of ? k . Then ? T?k +1 ? = oe2Im + ? T -LRB- Q + ?? 1 k -RRB- ? 1 ? -LRB- 25.47 -RRB- = oe2Im + -LRB- ? TQ ? + ? T ?? 1 k ? -RRB- ? 1 = oe2Im + -LRB- ? + ? T ?? 1 k ? -RRB- ? 1 : Since , ?? k ? = ? k , we get ??? 1 k ? = ?? 1 k and therefore ? T?k +1 ? = oe2Im + -LRB- ? + ?? 1 k -RRB- ? 1 = ? 0k +1 : -LRB- 25.48 -RRB- Obviously , ? k +1 ? = ?? 0k +1 00000and hence ? is the matrix of the eigenvectors of ? k +1 and ? 0k +1 = ? k +1 . Moreover , > = k +1 j = oe2 + > = kj 1 + > = j > = kj ; 1 < = j < = m -LRB- 25.49 -RRB- and hence for any k > = 1 and 1 < = j < = m , > = kj > = oe2 . Corollary 25.3.1 . For any k > = , ? T?kQ ? = ? T ?? TQ ? = ? k ? , hence ? kQ ? = ?? k ? . Moreover , ? kQ is a positive definite matrix , ? is its eigenvector matrix and respectively , ? k ? is its eigenvalue matrix . Corollary 25.3.2 . The matrix ? kQ + Im is a positive definite matrix and ? is its eigenvector matrix , while ? k ? + Im is its eigenvalue matrix . Corollary 25.3.3 . For any k > = 1 , ? k +1 = -LRB- ? kQ + Im -RRB- ? 1 ? k. Obviously , we have the following series of equalities ? k +1 = ? k ? -LRB- Q + ?? 1 k -RRB- ? 1Q ? k -LRB- 25.50 -RRB- = ? k ? -LRB- Q + ?? 1 k -RRB- ? 1 -LRB- Q + ?? 1 k ??? 1 k -RRB- ? k = ? k ? -LRB- Im ? -LRB- Q + ?? 1 k -RRB- ? 1 ?? 1 k -RRB- ? k = ? k ? ? k + -LRB- ? k -LRB- Q + ?? 1 k -RRB- -RRB- ? 1 ? k = -LRB- ? kQ + Im -RRB- ? 1 ? k : 262 Proceedings of the 2NWGA , Vaasa , Finland , 19 - 23 August 1996 Theorem 25.3.2 . The sequence -LRB- ? n -RRB- n converges to . Proof . From ? k = -LRB- ? kQ + Im -RRB- ? k +1 , we get ? k +1 ? ? k = ?? kQ?k +1 , hence by positive definiteness of ? kQ we obtain ? Tk +1 -LRB- ? k +1 ? ? k -RRB- = ?? Tk +1 ? kQ?k +1 < : -LRB- 25.51 -RRB- Therefore , ? Tk +1 ? k +1 < ? Tk +1 ? k and by Schwartz inequality we get k?k +1 k2 < k?k +1 k ? k?kk , that is , -LRB- k?nk -RRB- n is a monotone decreasing sequence . Using the result established by Corollary 25.3.2 , we get that the eigenvalues of -LRB- ? kQ + Im -RRB- ? 1 are 1 1 + > = j > = kj ; 1 < = j < = m : -LRB- 25.52 -RRB- Therefore , -LRB- ? kQ + Im -RRB- ? 1 < = 1 1 + oe2 > = m : -LRB- 25.53 -RRB- Since k?k +1 k < = k -LRB- ? kQ + Im -RRB- ? 1k ? k?kk , we obtain k?k +1 k < = 1 1 + oe2 > = m k?kk -LRB- 25.54 -RRB- which implies that k?k +1 k < < = 1 1 + oe2 > = m > = k +1 k ? 0k : -LRB- 25.55 -RRB- Consequently , lim n ! 1 k?nk = and hence , lim n ! 1 ? k = 0 . Corollary 25.3.4 . The optimal solution of the considered problem is the vector , hence the sequence of means corresponding to the populations generated by the genetic algorithm is convergent toward the global optimum . 25.4 Experiment The above presented theoretical analysis is completed with a series of numerical experiment by applying the traffic control scheme to a Markov modulated noisy flow . The disturbances act independently on two correlated flow patterns . The experiment has been design to assess the discriminating and the tracking features of the genetic algorithm implementation of the traffic controller . The cross-traffic flows modelled as noise are produced by a bottleneck node 5 -LRB- Fig. 25.4 -RRB- . Specifically , the cross-traffic from the pairs -LRB- 1 3 -RRB- and -LRB- 2 4 -RRB- represents the interaction between two flows . The switching node 5 should handle the two endto-end connections -LRB- 1 3 -RRB- and -LRB- 2 4 -RRB- and should produce as small perturbations as possible of the traffic patterns due to the cross-traffic while switching . The convergence to stationary values of the genetic algorithm solution has to be fast

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

atm networks
genetic algorithms
traffic control


Speeding Up Inferences in Large Knowledge Bases Alon Y. Levy AT&T Bell Laboratories 600 Mountain Ave. , Room 2C-406 , Murray Hill , NJ , 07974 levy@research.att.com Richard E. Fikes KSL , Stanford University 701 Welch Road , Bldg. . C Palo Alto , California 94304 -LRB- fikes@cs.stanford.edu -RRB- Yehoshua Sagiv Dept. of Computer Science Hebrew University Jerusalem , Israel -LRB- sagiv@cs.huji.ac.il -RRB- Abstract Speeding up inferences made from large knowledge bases is a key to scaling up AI systems . The query-tree is a powerful tool for analyzing KBs containing Horn rules which takes into consideration the semantics of interpreted predicates that appear in the rules -LRB- e.g. , order and sort predicates -RRB- . It is a finite structure that encodes all derivations of a given set of queries and tells us which rules and ground facts can be used in deriving answers to the queries and which can be ignored . This paper investigates experimentally the impact of several methods of employing the query-tree on speeding up inference . Speedups are obtained by creating specialized indices that point only to relevant facts in the KB and by following only sequences of rule applications that are allowed by the query-tree . The experiments show that significant speedups -LRB- often orders of magnitude -RRB- are obtained by employing the query-tree . Moreover , we show that the speedups improve as the size of the KB grows , indicating that the methods will scale up to large KBs . 1 Introduction Speeding up inferences made from large knowledge bases -LRB- KBs -RRB- is a key to scaling up artificial intelligence systems . The query-tree -LSB- 7 , 8 -RSB- is a powerful tool for analyzing KBs containing Horn clause rules as well as more expressive extensions -LSB- 6 -RSB- . It is a finite AND-OR tree that encodes all derivations of a given set of queries using the rules of the KB . As a result , it tells us which rules and ground facts can be used in deriving answers to the given queries and which rules and ground facts can be ignored . The query-tree is a member of a family of static-analysis tools , that includes compilation graphs -LSB- 1 -RSB- , problem-state graphs -LSB- 2 -RSB- , connection graphs -LSB- 4 , 12 -RSB- , definability graphs -LSB- 15 -RSB- , rule-goal graphs -LSB- 16 -RSB- and fold/unfold transformations -LSB- 14 -RSB- . The main characteristic distinguishing the query-tree from other structures is completeness in the presence of recursion -LRB- but not function symbols -RRB- 1 and some interpreted predicates -LRB- e.g. , order constraints -LRB- < , = , < > and <=-RRB- and sort constraints -RRB- . Therefore , the query-tree tells us exactly which formulas and which sequences of rule applications may contribute answers to the given queries . In comparison , other structures only give partial information , since they may indicate that a formula is relevant even if it can never be used in any derivation . Interpreted constraints play a key role in many applications -LRB- e.g. , engineering , medical diagnosis , and operations research -RRB- and considering the semantics of these predicates gives us significant leverage in pruning the KB . This paper investigates experimentally the impact on speeding up inference of several methods of employing the query-tree . The first method , given a set of queries , builds a query-tree to determine which rules and ground atomic facts are relevant to the queries . We then create specialized indices that only point to the relevant rules and ground facts , and use these indices during inference . The second method of using the tree is based on the observation that it also tells us which sequences of rule applications and database lookups can result in answers to the queries . Consequently , we can focus inference further by following the sequences allowed by the query-tree . The experiments show that the first method produces significant speedups and that these speedups can be substantially improved by employing the 1If the rules are not recursive , then the query-tree is complete even in the presence of function symbols . second method ; the cost of building the query-tree and preprocessing the KB -LRB- to create the specialized indices -RRB- is negligible . We present an analysis of the factors affecting the resulting speedups , and in particular , we show that the speedups improve as the size of the KB grows . Finally , we present another method for speeding up inference by showing how the query-tree can be used in conjunction with some forms of meta-level knowledge . Specifically , we consider meta-level knowledge of the form : The formula OE must be used in deriving any answer to the query . Meta-knowledge of this form may be used , for example , in order to find the new answers that can be inferred after adding a new formula to the KB . We present an algorithm that uses the query-tree and meta-knowledge statements -LRB- of the above form -RRB- to further prune the search during the inference process . This result is another illustration of the versatility of the query-tree in incorporating many different types of knowledge in order to prune the search space . 2 The Query-Tree This section briefly describes the query-tree and its possible uses . We begin with a few preliminaries . We assume that our KB -LRB- knowledge base -RRB- consists of a set P of Horn clause rules and a set G of ground atomic facts . We distinguish three sets of predicates in the KB : base predicates , derived predicates , and constraint predicates . The base predicates are those that appear in the ground facts of G . The derived predicates are those that appear in the consequents of the rules .2 For convenience , we assume that base predicates are disjoint from derived predicates . The constraint predicates3 -LRB- e.g. , sort predicates and order predicates such as = , 6 = , > = , > -RRB- are interpreted , i.e. , their semantics are considered when deciding which formulas are irrelevant to the query . Hereafter , by a constraint , we mean a conjunction of constraint literals . The constraint predicates can also be used to specify restrictions , denoted by C , on the possible ground formulas in the KB -LRB- e.g. , AgeOf -LRB- x ; y -RRB- -RRB- y < = 150 -RRB- . A query is an atom that could be either completely ground -LRB- e.g. , is P -LRB- a ; b -RRB- 2Base and derived predicates are often called EDB and IDB predicates , respectively . 3Essentially , a constraint formula with n free variables represents a -LRB- possibly infinite -RRB- nary relation . We assume that constraint formulas are closed under projection and join ; we also assume that equivalence -LRB- and , hence , satisfiability -RRB- of constraint formulas is decidable . entailed by P -LSB- G ? -RRB- or may have free variables -LRB- e.g. , find some , or all , x and y , such that P -LRB- x ; y -RRB- is entailed -RRB- . We build a query-tree for a given atom Q . The resulting query-tree can be used for all queries that match Q. Hence , we can tailor the query-tree to either one specific query or a class of queries . The query-tree for Q represents all possible derivations of ground atoms that match Q . It is an AND-OR tree consisting of goal nodes and rule nodes -LRB- see Figure 1 -RRB- , and it is built from the rules of the KB and a given set of restrictions C on the ground facts stored in the KB . The root of the tree is a goal node for Q. Henceforth , we refer to the goal node for a goal g as simply \ goal node g '' and the rule node for a rule r as simply \ rule node r '' . The children of a goal node g are the rules that unify with g . The children of a rule node r are the goal nodes created from the atoms in the antecedent of r after unifying r with g . If a KB has recursive rules , such a simple minded construction may result in an infinite tree . Therefore , we attach a label to each node in the tree . The label of a node describes the constraint that needs to be satisfied by tuples at that node . The labels induce an equivalence relation on goal nodes in the query tree , and we make the tree finite by expanding -LRB- i.e. , creating children for -RRB- a goal node g only if there is not already an expanded equivalent of g . The details of the construction of the query-tree and the computation of the labels are described in -LSB- 7 , 5 -RSB- . The following is a simple example that illustrates the query-tree . Example 2.1 : The base predicates step and bigstep describe links between points in a space . The derived predicate path denotes the paths that can be constructed by composing single links . The derived predicate goodPath denotes paths that go from points that are designated as start points to points that are designated as end points . Start and end points are given by base predicates . r1 : startPoint -LRB- x -RRB- ^ path -LRB- x ; y -RRB- ^ endPoint -LRB- y -RRB- -RRB- goodPath -LRB- x ; y -RRB- . r2 : link -LRB- x ; y -RRB- -RRB- path -LRB- x ; y -RRB- . r3 : link -LRB- x ; z -RRB- ^ path -LRB- z ; y -RRB- -RRB- path -LRB- x ; y -RRB- . r4 : step -LRB- x ; y -RRB- -RRB- link -LRB- x ; y -RRB- . r5 : bigStep -LRB- x ; y -RRB- -RRB- link -LRB- x ; y -RRB- . The following are known constraints on the ground facts that may exist in the KB : startPoint -LRB- x -RRB- -RRB- -LRB- 1 < x < 9 -RRB- . step -LRB- x ; y -RRB- -RRB- -LRB- x < y -RRB- . endPoint -LRB- x -RRB- -RRB- -LRB- 4 < x < 7 -RRB- . bigStep -LRB- x ; y -RRB- -RRB- -LRB- x < 1 ^ y > 9 -RRB- . The query-tree for goodPath -LRB- x ; y -RRB- is shown in Figure 1 . Note that Node 3 of the tree is an expanded equivalent of Node 7 and , hence , Node 7 was not expanded . Rule r5 is not included in the tree , because if it were , its label would be unsatisfiable -LRB- since the constraints on start and end points entail that a good path can not include a big step -RRB- . -LRB- 1 -RRB- goodPath -LRB- x ; y -RRB- f1 < x < y < 7 ; y > 4g r1hhhhhhhh -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- 2 -RRB- startP oint -LRB- x -RRB- f1 < x < 7g -LRB- 4 -RRB- endP oint -LRB- y -RRB- f4 < y < 7g -LRB- 3 -RRB- path -LRB- x ; y -RRB- PPPPPP ? ? ? ? ? ? f1 < x < y < 7 ; y > 4g r2 r3PPPP ? ? ? ? -LRB- 5 -RRB- link -LRB- x ; y -RRB- f1 < x < y < 7 ; y > 4g ? ? ? ? -LRB- 6 -RRB- link -LRB- x ; z -RRB- f1 < x < z < 7g -LRB- 7 -RRB- path -LRB- z ; y -RRB- f1 < z < y < 7 ; y > 4g r4 r5 r4 -LRB- 8 -RRB- step -LRB- x ; y -RRB- f1 < x < y < 7 ; y > 4g -LRB- 9 -RRB- step -LRB- x ; z -RRB- f1 < x < z < 7g Figure 1 : An example query-tree The query-tree encodes all symbolic4 derivation trees s such that s can be constructed as follows . The root of s is the same as the root of the querytree , and the two roots are corresponding nodes . Recursively , a goal node g of s with corresponding node g0 in the query-tree is expanded with one of the children of either g0 or the expanded equivalent of g0 . A derivation tree d is said to be an instance of a symbolic derivation tree s if d is obtained from s by substituting constants for variables , and furthermore , at every node of d , the constants satisfy the label associated with that node . See Figure 2 for an example . 2.1 Properties of the Query-Tree In this section , we describe the properties of the query-tree that are pertinent to speeding up inference and explain how they can be used . The following is a fundamental property of the query tree . 4 \ Symbolic '' means that variables are used instead of constants . goodPath -LRB- x ; y -RRB- -LRB- 1 -RRB- hhhh -LRB- -LRB- -LRB- -LRB- -LRB- 2 -RRB- startP oint -LRB- x -RRB- endP oint -LRB- y -RRB- -LRB- 4 -RRB- path -LRB- x ; y -RRB- -LRB- 3 -RRB- hhhhhh -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- path -LRB- z ; y -RRB- -LRB- 7 -RRB- l ink -LRB- x ; z -RRB- -LRB- 6 -RRB- step -LRB- x ; z -RRB- -LRB- 9 -RRB- link -LRB- z ; y -RRB- -LRB- 5 -RRB- step -LRB- z ; y -RRB- -LRB- 8 -RRB- -LRB- a -RRB- -LRB- b -RRB- goodPath -LRB- 3 ; 6 -RRB- hhhh -LRB- -LRB- -LRB- -LRB- startP oint -LRB- 3 -RRB- endP oint -LRB- 6 -RRB- path -LRB- 3 ; 6 -RRB- hhhhhh -LRB- -LRB- -LRB- -LRB- -LRB- -LRB- path -LRB- 5 ; 6 -RRB- l ink -LRB- 3 ; 5 -RRB- step -LRB- 3 ; 5 -RRB- link -LRB- 5 ; 6 -RRB- step -LRB- 5 ; 6 -RRB- Figure 2 : Part -LRB- a -RRB- is a symbolic derivation tree encoded by the query-tree of Example 2.1 . The numbers in parentheses denote the corresponding nodes in the query-tree . Note that Node 7 was expanded with the child of Node 3 . Part -LRB- b -RRB- shows an instance of -LRB- a -RRB- . Note that in every node , the ground atom satisfies the constraints required at that node . Property 1 Given a set of rules P , a set of restrictions C on base predicates , and an atomic query Q , the following are equivalent . 1 . D is a derivation tree for Q that consists of rules in P and ground facts -LRB- of base predicates -RRB- that satisfy C. 2 . D is an instantiation of some symbolic derivation tree encoded in the query-tree . Property 1 takes into consideration the semantics of the constraint predicates and is an \ if an d only if '' -LRB- i.e. , completeness -RRB- result even in the presence of recursion -LRB- but with no function symbols -RRB- , order constraints , and sort constraints -LRB- for a finite sort hierarchy -RRB- ; hence , it is stronger than any result obtained by other static-analysis tools . If there is no recursion , the querytree is always complete . Note that the time to construct the query-tree depends only on the rules of the KB and the constraints imposed on the base predicates , but is independent of the actual ground facts stored in the KB . Therefore , the query-tree is especially suitable for KBs with a large number of ground facts . Also note that for a fixed arity , the time to construct the query-tree is linear in the number of rules . Property 1 implies5 the following corollary . 5Technically , we have to assume that all the nodes of the query tree are reachable from the root ; this detail is taken care of in -LSB- 7 -RSB- . Property 2 A rule is relevant to the given query only if it appears in the query tree . Similarly , a ground fact is relevant only if it matches some goal node of the query tree and also satisfies the constraint label of that node . Property 2 also holds if Part 1 of Property 1 implies Part 2 , but not viceversa . This is important , because for some types of constraints -LRB- e.g. , linear constraints -RRB- , it is not possible to create a finite query tree for which Property 1 holds .6 However , we can construct a finite query tree that has Property 2 which could be used to speed up inference as we now describe . To use Property 2 , we create an index for each base predicate in order to retrieve all and only those ground facts that satisfy some constraint label associated with a goal node of that predicate . For instance , in Example 2.1 , we create for the step predicate an index for retrieving all ground facts step -LRB- x ; y -RRB- , such that 1 < x < y < 7 . Similarly , we create an index that points to the relevant rules -LRB- in Example 2.1 , that index points to all rules except rule r5 -RRB- . Note that the time to construct a specialized index on the ground facts is linear -LRB- or at most n log n -RRB- in the size of the knowledge base . Since the query-tree encodes all the derivations of the query , we can further exploit it by following the tree during inference . To do so , we first create a separate index for each goal node of a base predicate in the tree and then modify the inference mechanism so that only paths allowed by the query-tree are followed . Specifically , we associate each subgoal in our search with a goal node of the query-tree . A subgoal of a derived predicate is expanded only with rules that are children of its associated node in the query-tree -LRB- or its expanded equivalent -RRB- . For a subgoal of a base predicate , we retrieve ground facts using the index created for the corresponding goal node of the query-tree . The following example illustrates the savings achieved by this approach . Example 2.2 : Consider the following rules from one of the KBs used in the experiments . r1 : cheapMeal -LRB- d1 ; w1 -RRB- ^ meat -LRB- d1 -RRB- ^ expensiveMeal -LRB- d2 ; w2 -RRB- ^ dessert -LRB- d2 -RRB- -RRB- dessertMeal -LRB- d1 ; w1 ; d2 ; w2 -RRB- r2 : dish -LRB- x ; z -RRB- ^ z < = 15 ^ compatible -LRB- x ; y -RRB- -RRB- cheapMeal -LRB- x ; y -RRB- r3 : dish -LRB- x ; z -RRB- ^ z > 15 ^ compatible -LRB- x ; y -RRB- -RRB- expensiveMeal -LRB- x ; y -RRB- r4 : beef -LRB- x -RRB- ^ redW ine -LRB- y -RRB- -RRB- compatible -LRB- x ; y -RRB- r5 : dessert -LRB- x -RRB- ^ sweetW ine -LRB- y -RRB- -RRB- compatible -LRB- x ; y -RRB- 6Specifically , when the rules contain recursion through function symbols , it is not possible to create a query-tree that satisfies Property 1 . See -LSB- 5 -RSB- for details . The sort predicates meat , beef , and dessert are used as constraints -LRB- dessert is disjoint from the other two -RRB- . The relation dish consists of the available dishes and their prices . The query-tree for dessertMeal is shown in Figure 3 . One source of savings from following the tree is the fact that in each of the two goal nodes of predicate compatible , only one of the two rules -LRB- i.e. , r4 and r5 -RRB- for this predicate has to be used . Another savings is due to the fact that , although all the ground facts of dish are relevant , in one goal node of dish only beef dishes with prices less than 15 are relevant , while in the other goal node of dish only expensive dessert dishes are relevant . Much of the impact of using the query-tree comes from the fact that it is built using only partial knowledge of the contents of the KB . As described above , it is built using only the rules in the KB and high level restrictions on the ground facts . However , we can divide the KB in other ways as well . For example , if a base relation has only a few facts in the KB , we can use them in building the query-tree . Alternatively , if there are many rules defining a derived relation , we can treat the relation as a base predicate , thus ignoring these rules . The utility of using the query-tree depends on the tradeoff between the time taken to preprocess the KB and the run-time savings . The preprocessing time includes the time taken to build the query-tree and create the specialized indices . The payoff at run-time comes from pruning branches of the search space . Using the specialized indices is especially useful when performing retrievals with uninstantiated variables . For example , ordinarily in applying r2 , we would have to look up each of the dish facts and check whether z < = 15 . With a specialized index , we are guaranteed that all the facts we find satisfy this constraint . The experiments described in the next section are designed to test the tradeoff between preprocessing costs and run-time savings . 3 Experimental Results The impact of the savings achieved by using the query-tree was tested using a depth-first backward chainer on Horn clause rules .7 Given a knowledge base 7The performance of the backward chainer used in the experiments compared favorably with that of Epikit -LRB- a commercial implementation of MRS -LSB- 11 -RSB- -RRB- . Furthermore , the speedups attained by removing irrelevant formulas -LRB- BC2 below -RRB- were also tested using dessertMeal -LRB- d1 ; w1 ; d2 ; w2 -RRB- fbeef -LRB- d1 -RRB- ; dessert -LRB- d2 -RRB- g r1HHH ? ? ? cheapMeal -LRB- d1 ; w1 -RRB- f beef -LRB- d1 -RRB- g expensiveMeal -LRB- d2 ; w2 -RRB- fdessert -LRB- d2 -RRB- g r2 @@ ? ? r3 @@ ? ? dish -LRB- d1 ; z -RRB- f beef -LRB- d1 -RRB- ; z < = 15g fdessert -LRB- d2 -RRB- ; z1 > 15g dish -LRB- d2 ; z1 -RRB- compatibl e -LRB- d1 ; w1 -RRB- compatible -LRB- d2 ; w2 -RRB- r4 @@ ? ? r5 @@ ? ? beef -LRB- d1 -RRB- dessert -LRB- d2 -RRB- r edW ine -LRB- w1 -RRB- sweetW ine -LRB- w2 -RRB- Figure 3 : Avoiding search paths using the query-tree ? and a query Q -LRB- i.e. , an atom with constants and/or free variables -RRB- , we built a query-tree for Q and then created two sets of indices for ground facts stored in ? . In one set , I1 , there was a single index for each base predicate that pointed to all the relevant ground facts of that predicate . In the second set , I2 , there was an index for each goal-node of a base predicate that pointed to all the ground facts that satisfied the label of the node . Note that the original KB had an index that facilitated direct access to all ground facts of each base predicate -LRB- be they relevant or irrelevant facts -RRB- . We measured three running times : BC1 , a backward chainer on ? using the original indices of the KB , BC2 , a backward chainer on ? using the indices of I1 , i.e. , ignoring irrelevant formulas , and BC3 , a backward chainer using the indices of I2 and only following paths allowed by the query-tree . We tested over 20 query schemas taken from four domains . Examples 1 & 2 use the rules given above in Example 2.1 . Examples 3 -LCB- 6 are taken from a travel knowledge base -LRB- using real airline data -RRB- . Examples 7 -LCB- 8 use a KB describing wines and dishes and compatibility between them -LRB- gleaned from -LSB- 10 -RSB- -RRB- , while the last two examples use a KB describing relationships between students , advisors , and institutions -LRB- using a database of Ph.D. grad - the backward chainer of Epikit , and the speedups attained there were even better than those reported here . In the experiments , we tested several rule and goal orderings . The results are shown for the ordering that consistently yielded the best speedups for all three / versions of the backward chainer . uates in computer science -RRB- . The first and fourth domains usually yield deep recursive search trees , even though the number of rules is small . The second domain is non-recursive and yields shallow but bushy -LRB- i.e. , large branching factor -RRB- search trees . In the third domain , search trees have a low branching factor -LRB- which was from student to advisor -RRB- . Table 1 presents the results of the experiments for the case where we are looking for all solutions to a query -LRB- e.g. , find all x ; y such that goodPath -LRB- x ; y -RRB- is derivable -RRB- . In the table , Filtering Time includes the time taken to build the query-tree and create all the indices -LRB- both I1 and I2 -RRB- . Percent irrelevant is the percent of ground formulas in the knowledge base that were deemed irrelevant -LRB- and therefore not included in I1 -RRB- . The next columns show the time taken to find all the solutions to the query . The respective running times of BC1 , BC2 and BC3 are shown , as well as the ratios of running times . In addition to measuring running times , the number of nodes expanded in the search was also counted . The last two columns show the ratios of the number of nodes expanded by BC2 and BC3 compared to BC1 . The results show significant speedups for both BC2 and BC3 . For BC2 , the speedups were usually in excess of a factor of 3 , ranging up to 31 -LRB- mean : 10.4 -RRB- . The results show that by following the query-tree using BC3 , we often get additional improvements . The speedups of BC3 over BC1 were usually in excess of 5 , ranging up to 1190 -LRB- mean : 41 , excluding test # 6 -RRB- .8 In terms of nodes expanded , the average speedup for BC2 was 10 , while the average speedup for BC3 was 37 -LRB- excluding test # 6 -RRB- . The results clearly show that if we are looking for all solutions to the query , building the query-tree and the specialized indices will yield significant savings . Table 2 presents the results of the experiments for the case in which we use the query-tree built for a query schema to solve ground queries or to find the first solution to a query with free variables -LRB- i.e. , the query-tree was built for goodPath -LRB- x ; y -RRB- and the query is goodPath -LRB- 3 ; 6 -RRB- , or we are trying to find the first binding for x and y -RRB- . The second and third columns show the ratios of the number of nodes expanded for ground queries . The next columns show the node ratios of finding the first solution to the query . The next column compares the preprocessing time and the time to find solutions to the query . It shows the number of calls -LRB- each looking for the next solution -RRB- 8Test # 6 was excluded from the mean because the speedups it yielded were exceptionally high . KB size Filtering Percent Solution time -LRB- sec . -RRB- Nodes Time irrelevant expanded Facts Rules -LRB- sec . -RRB- BC1 BC2 BC1 BC2 BC3 BC1 BC3 BC1 BC2 BC1 BC3 1 . 350 6 1.8 63 2780 182 15 183 15 10.5 10.5 2 . 350 6 1.8 63 618 231 2.7 233 2.7 2.5 2.5 3 . 200 18 6.5 69 372 14 27 8.6 43 22 28 4 . 200 18 5.6 69 25 5.5 4.5 4.5 5.6 4.7 6 5 . 200 18 20.7 64 3975 205 19 13 306 17 295 6 . 200 18 14.7 68 1278 41 31 1.1 1190 31 1630 7 . 1300 47 25 59 8740 8720 1 363 24 1 14 8 . 1300 47 11.6 60 50 42 1.2 11 4.5 1.2 2.8 9 . 150 17 0.8 59 35 7.5 4.6 7.5 4.6 4.5 4.5 10 . 150 17 0.6 59 2.8 0.4 7.6 0.4 7.6 4.8 4.8 Table 1 : Experimental results - finding all solutions . after which the preprocessing time equals the time to answer the queries . The last column shows the number of solutions found for the query . The results indicate that often the preprocessing pays off after a very small number of solutions and therefore that it is beneficial to build a query-tree even in cases when we are searching for few solutions . Ground queries Find first solution solutions needed number of BC1 BC2 BC1 BC3 BC1 BC2 BC1 BC3 to break even solutions 1 . 5.8 6.1 85 85 1 187 2 . 1.8 1.8 4.5 4.5 1 187 3 . 33 74 2.5 2.6 1 49 4 . 4.6 7 6.1 6.2 6 37 5 . 15 290 1 1 1 12 6 . 33 1550 31 1630 1 7 . 1 2 1.4 25 115 41000 8 . 1.1 1.4 1.6 4.5 81 420 9 . 1.3 1.3 123 123 2 353 10 . 1 1 4.8 4.8 1 Table 2 : Experimental results - ground queries and finding the first solution . In the full paper , we present the complete analysis of the results . Briefly , the speedups depended on three factors : the size of the knowledge base , the percent of irrelevant formulas , and the form of the rules . The results showed that the speedups grew significantly as the percent of irrelevant formulas grew -LRB- e.g. , in Example 4 , when 91 % of the formulas were deemed irrelevant , the speedup obtained by BC3 was a factor of 330 -RRB- . The speedups also increased with the size of the knowledge base when the percent of irrelevant formulas remained constant . This is explained by the fact that the cost of backward chaining is more than linear in the number of formulas . Therefore , the effect of removing some constant percent of formulas will be greater when the overall number of formulas is greater . These results are significant in that they suggest that our methods will scale up to large knowledge bases and be even more effective there . 4 Exploiting Meta-level Knowledge The query-tree can also be used to incorporate some forms of meta-level knowledge in order to speed up inferences . An example of such knowledge is a claim stating that a certain formula OE1 must be used in the derivation of the query . For example , if a formula is added to the knowledge base , and we want to determine whether we can find additional answers to a query , we know9 that the new formula must be used in derivations of new answers . For example , suppose we added the formula step -LRB- 4 ; 5 -RRB- to the KB in Example 2.1 , and we are looking for the new answers to goodPath . Formulas of the form step -LRB- x ; y -RRB- where 4 < x < 5 -LRB- or 4 < y < 5 -RRB- can not be used in derivations of new answers and therefore can be ignored . Intuitively , if we are given that a formula OE1 must be used in a derivation , and the formulas OE1 and OE2 can never appear in the same derivation of the query -LRB- i.e. , OE1 and OE2 are mutually exclusive in derivations -RRB- , then OE2 is irrelevant to the query and can therefore be ignored in the same fashion described in the previous sections . Since the query-tree encodes all the possible derivations of the query , it can also be used to determine which formulas are exclusive to a given formula . In the full paper we describe an algorithm -LRB- and prove its correctness -RRB- that uses the query-tree to find which formulas are exclusive w.r.t. a given formula OE . 9In Horn clause rule knowledge bases 5 Conclusions The query-tree is a general tool for analyzing Horn-rule knowledge bases and speeding up inferences made from them . It gets its power from two main sources . The first is that it considers the semantics of interpreted predicates . These predicates play a key role in many applications and often , their analysis is what enables the pruning of significant portions of the knowledge base . Second , the query-tree is built by considering only part of the knowledge base . Consequently , techniques based on the query-tree will scale up to large knowledge bases , and the conclusions derived by the query-tree are valid also when changes are made to the uninspected parts of the KB . In this paper , we have described experimental results which show that using the querytree to filter the knowledge base and to control inference yields significant , often orders of magnitude , speedups in inference . In our experiments , the speedups were obtained by creating new indices on the ground facts in the KB . In contrast , previous experimental work -LRB- e.g. , EBL -LSB- 9 -RSB- and compilation graphs -LSB- 1 -RSB- -RRB- focussed on the utility of compressing sequences of rules . The query-tree and specialized indices are built with respect to a specific set of queries , and we have significant flexibility in specifying this set . Therefore , the utility of using the query-tree will be maximized if we can identify sets of queries that occur most frequently and are specific enough for the constraints to be useful . For example , we can build a query-tree for goodPath -LRB- 1 ; y -RRB- or for goodPath -LRB- x ; y -RRB- . The latter covers a larger set of queries , but in the former the constraints enable us to filter more facts from the KB . Deciding which query-trees to build and which indices to maintain raises many of the same issues that arise in solution caching . In fact , maintaining specialized indices can be viewed as an intermediate form of solution caching . Although we experimented with a particular depth first backward chainer , the techniques described apply to a wide range of reasoning algorithms . The filtering of the KB which was based on determining which formulas are irrelevant to the query -LRB- i.e. , BC2 -RRB- is done before we answer the query and is therefore independent of the particular algorithm used to make inferences . To exploit the additional focus obtained by following the query-tree -LRB- i.e. , BC3 -RRB- , we only need to map every node in our search to a node in the query-tree , and this can be done in a wide variety of inference algorithms . An interesting direction for future research is to combine the query-tree with other optimization methods . For example , Greiner -LSB- 3 -RSB- and Smith -LSB- 13 -RSB- addressed the issue of finding optimal strategies for rule and goal-ordering . In doing so , they used a tree-like representation of the possible derivations . The query-tree can be used to extend their results to KBs with recursion and to incorporate the semantics of interpreted predicates . Furthermore , the labels on the nodes in the query-tree can be used to estimate the relative number of solutions under each node , thereby suggesting a possible ordering of subgoals . Smith uses such numbers in his algorithm for subgoal ordering . References -LSB- 1 -RSB- Maurice Bruynooghe , Danny De-Schreye , and B. Krekels . Compiling control . Journal of Logic Programming , pages -LRB- 6 -RRB- 135 -LCB- 162 , 1989 . -LSB- 2 -RSB- Oren Etzioni . Acquiring search-control knowledge via static analysis . Artificial Intelligence , 62 , 1993 . -LSB- 3 -RSB- Russell Greiner . Finding optimal derivation strategies in a redundant knowledge base . Artificial Intelligence , 50 -LRB- 1 -RRB- :95 -LCB- 116 , 1991 . -LSB- 4 -RSB- Robert Kowalski . A proof procedure using connection graphs . Journal of the ACM , pages 22 -LRB- 4 -RRB- : 572 -LCB- 595 , 1975 . -LSB- 5 -RSB- Alon Y. Levy . Irrelevance Reasoning in Knowledge Based Systems . PhD thesis , Stanford University , Stanford , CA , 1993 . -LSB- 6 -RSB- Alon Y. Levy , Inderpal Singh Mumick , Yehoshua Sagiv , and Oded Shmueli . Equivalence , query-reachability and satisfiability in datalog extensions . In Proceedings of the Twelfth ACM SIGACT-SIGMOD - SIGART Symposium on Principles of Database Systems , Washington D.C. , 1993 . -LSB- 7 -RSB- Alon Y. Levy and Yehoshua Sagiv . Constraints and redundancy in datalog . In The Proceedings of the Eleventh ACM SIGACT-SIGMOD - SIGART Symposium on Principles of Database Systems , San Diego , CA. , 1992 . -LSB- 8 -RSB- Alon Y. Levy and Yehoshua Sagiv . Exploiting irrelevance reasoning to guide problem solving . In Proceedings of the 13th International Joint Conference on Artificial Intelligence , pages 138 -LCB- 144 , 1993 . -LSB- 9 -RSB- Steve Minton . Quantitative results concerning the utility of explanation based learning . In Proceedings of the Seventh National Conference on Artificial Intelligence , 1988 . -LSB- 10 -RSB- Irma S. Rombauer and Marion Rombauer-Becker . Joy of Cooking . Bobbs Merrill Company Inc. , N.Y.C. , N.Y , 1975 . -LSB- 11 -RSB- Stuart Russell . The complete guide to MRS. Technical Report KSL-85 - 12 , Knowledge Systems Laboratory , Department of Computer Science , Stanford University , CA , 1985 . -LSB- 12 -RSB- Susan Sickel . A search technique for clause interconnectivity graphs . IEEE Transactions on Computers , C-25 -LRB- 8 -RRB- :823 -LCB- 835 , 1976 . -LSB- 13 -RSB- David Smith . Controlling Inference . PhD thesis , Stanford University , Stanford , CA , 1986 . -LSB- 14 -RSB- Donald A. Smith and Timothy J. Hickey . Partial evaluation of a CLP language . In Proceedings of the International Symposium on Logic Programming , pages 119 -LCB- 138 , 1990 . -LSB- 15 -RSB- Devika Subramanian . A Theory of Justified Reformulations . PhD thesis , Stanford University , Stanford , CA , 1989 . -LSB- 16 -RSB- Jeffery D. Ullman . Principles of Database and Knowledge-base Systems , Volumes I , II . Computer Science Press , Rockville MD , 1989 .

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O