scieee AI-readable full text Open interactive document viewer

Mixed acceleration techniques for solving quickly stochastic shortest-path markov decision processes

García Hernández, Ma de Guadalupe,Ruiz Pinales, José,Onaindia de la Rivaherrera, Eva,Ledesma-Orozco, S,Aviña-Cervantes, J.G.,Alvarado-Méndez, E.,Reyes-Ballesteros, A

Abstract

In this paper we propose the combination of accelerated variants of value iteration mixed with improved prioritized sweeping for the fast solution of stochastic shortest-path Markov decision processes. Value iteration is a classical algorithm for solving Markov decision processes, but this algorithm and its variants are quite slow for solving considerably large problems. In order to improve the solution time, acceleration techniques such as asynchronous updates, prioritization and prioritized sweeping have been explored in this paper. A topological reordering algorithm was also compared with static reordering. Experimental results obtained on finite state and action-space stochastic shortest-path problems show that our approach achieves a considerable reduction in the solution time with respect to the tested variants of value iteration. For instance, the experiments showed in one test a reduction of 5.7 times with respect to value iteration with asynchronous updates.

Full text

JournalofAppliedResearchandTechnology 129  Mixed Acceleration Techniques for Solving Quickly Stochastic Shortest-Path Markov Decision Processes M. de G. García-Hernández*1, J. Ruiz-Pinales1, E. Onaindía2, S. Ledesma-Orozco1, J. G. Aviña-Cervantes1, E. Alvarado-Méndez1, A. Reyes-Ballesteros3 1University of Guanajuato, Comunidad de Palo Blanco s/n, C.P. 36885, Salamanca, Guanajuato, México {garciag,pinales,selo,avina,ealvarad}@ugto.mx 2Universitat Politécnica de Valéncia, DSIC, Camino de Vera s/n, 46022, Valencia, España, [email protected] 3Electrical Research Institute, Reforma 113, C.P. 62490, Temixco, Cuernavaca, Morelos, México, [email protected]g.mx ABSTRACT In this paper we propose the combination of accelerated variants of value iteration mixed with improved prioritized sweeping for the fast solution of stochastic shortest-path Markov decision processes. Value iteration is a classical algorithm for solving Markov decision processes, but this algorithm and its variants are quite slow for solving considerably large problems. In order to improve the solution time, acceleration techniques such as asynchronous updates, prioritization and prioritized sweeping have been explored in this paper. A topological reordering algorithm was also compared with static reordering. Experimental results obtained on finite state and action-space stochastic shortest-path problems show that our approach achieves a considerable reduction in the solution time with respect to the tested variants of value iteration. For instance, the experiments showed in one test a reduction of 5.7 times with respect to value iteration with asynchronous updates. Keywords: Markov decision processes, acceleration techniques, prioritization. RESUMEN En este documento proponemos la combinación de variantes aceleradas del algoritmo de iteración de valor combinadas con el algoritmo de barrido priorizado mejorado para la rápida solución de los procesos de decisión de Markov de ruta estocástica más corta. Iteración de valor es un algoritmo clásico para resolver a los procesos de decisión de Markov, pero este algoritmo y sus variantes son lentos para resolver problemas considerablemente grandes. Con el objeto de mejorar el tiempo de solución de este algoritmo, en este documento se han explorado técnicas de aceleración tales como actualizaciones asíncronas, priorización y barrido priorizado. Un algoritmo de reordenamiento topológico también fue comparado con uno de reordenamiento estático. Los resultados experimentales obtenidos en un problema de ruta estocástica más corta con espacios de estados-acciones finitos; muestran que nuestro enfoque logra una considerable reducción en el tiempo de solución con respecto a las variantes de iteración de valor probadas. Por ejemplo, los experimentos mostraron en una prueba una reducción de 5.7 veces con respecto a iteración de valor usando actualizaciones asíncronas.   1. Introduction In planning under uncertainty, the planner’s objective is to find a policy that optimizes some expected utility. Most approaches for finding such policies are based on decision-theoretic planning [1]. Despite their general applicability and mathematical soundness, the task of generating optimal policies for large problems is computationally challenging. Markov decision processes (MDPs) [2, 3] have successfully solved decision problems in process control, decision analysis and economy. Fast solution of MDPs is necessary for real-world applications such as process control, where many variables may change unexpectedly because of the operation of devices (valves, equipment switches, etc.) or the occurrence of exogenous (uncontrollable) events, resulting in changes of the parameters of the MDP model. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 Vol.9No.2August2011 130 However, the computational complexity of those processes is significant for the case of continuous or high dimensionality domains, making an intractable solution time for very large problems [4]. In order to address this issue, many general MDP- based solution methods have been developed: state abstraction and aggregation techniques, feature extraction methods, value-function approximations, heuristic and greedy search, simulation-based techniques, envelope-based methods and prioritization-based methods. State aggregation and abstraction techniques reduce the search space by grouping similar states [5, 6, 7]. For instance, the search space can be partitioned based on a reward function. Feature extractionbased methods combine dynamic programming with compact representations that involve an arbitrarily complex feature extraction stage [8]. In the value function approximations approach, a dynamic programming cost-to-go function can be fitted by a linear combination of pre-selected basis functions [9]. In heuristic and greedy search, a state is labeled as solved when the heuristic values, and the greedy policy defined by them, have converged over that state [10, 11]. Simulation-based techniques use an adaptive sampling algorithm for approximating the optimal value for a finite horizon MDP [12]. In envelope-based methods, world dynamics can be represented by a compact set of rules related with an envelope of states [13]. For instance, rules can be logical sentences, whose STRIP scheme contains the action name, precondition and a set of probabilistic effects [14]. Priority-based methods can reduce the number of needed backups considerably by prioritizing backup operations, but they may incur in excessive overhead, and may fail to scale to general MDPs. Improved prioritized sweeping (IPS) [15] is a priority-based method that was originally conceived as an extension of the classical Dijkstra’s algorithm for the solution of stochastic shortest-path MDPs (with positive rewards and a single goal). IPS reduces to Dijkstra’s algorithm for the deterministic case (acyclic MDPs). In addition, IPS is a singlepass algorithm, which means that it is one of the fastest algorithms for the deterministic case. Unfortunately, for the case of stochastic shortestpath MDPs, the convergence of IPS is not guaranteed [16]. Another priority-based method is improved topological value iteration (iTVI) [17]; it performs backups in a static order which can be computed by using the Dijkstra’s algorithm. However, the topological order may not be the optimal update order besides that the computation of the topological order may result in a considerable overhead. In this paper we explore a different approach based on the combination of priority-based methods and value iteration improved with acceleration techniques for the solution of large MDPs. First, we code all the state transitions with non-zero probability as a list of transitions consisting of initial state, next state, action and the corresponding transition probability. Then, we study the combination of state-of-the-art acceleration techniques for solving the resulting MDP. Next, we study the combination of a prioritized method for accelerating a variant of value iteration. This paper is organized as follows: We begin with a brief introduction to MDPs, followed by a description of a classical algorithm for solving MDPs (value iteration) and its improvements. Next, we present the formulation of MDPs in terms of a list of non-null transitions, followed by a description of acceleration techniques and their mixed forms. Finally, experimental results and conclusions are presented. 2. Markov decision processes MDPs provide a mathematical framework for modeling sequential decision problems under uncertainty dynamic environments [18]. Formally, a MDP is a four-tuple  RTAS ,,, , where S is a finite set of states  n ss ,, 1, A is a finite set of actions  n aa ,, 1,   1,0:    SAST is the state transition function. So, the probability to achieve the state s  , if one applies the action a in the state s , is given by  ssaT  ,, . ASR  : is the reward function and  asR , is the reward obtained if one operates the action a in the state s . A policy is defined to be a function AS :  . The problem is to find a policy  to maximize the expected total reward. The expected utility of a policy  for an initial state s can be written as MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 JournalofAppliedResearchandTechnology 131         t tt tssssREsU 0 ,)(   (1) where  1,0  is a discount factor, which may be used for decreasing exponentially future rewards. For the case of discounted rewards  10   , the utility of an infinite state sequence is always finite. So, the discount factor expresses that future rewards have less value than current rewards [19]. For the case of additive rewards  1  and infinite horizon, the expected total reward may be infinite and the agent must be guaranteed to end up in a terminal state. Value functions  sU are used to represent the expected reward of policies. So the optimal policy *  is a one that maximizes its value function. The optimal value function is given by  )(max *sUsU    (2) It is well known that the optimal value function  sUt * in stage t satisfies the Bellman equation:                 s t a tsUsasTasRsU * 1 *,,,max  (3) Value iteration, policy iteration and linear programming are three of the most well-known techniques for finding the optimal value function  sU* and the optimal policy *  for infinite horizon problems [20]. Last, for the case of large MDPs with sparse transition matrices, memory savings can be obtained by using sparse representations [21] in which all the state transitions with non-zero probability are coded. In this way, it is possible to handle larger problems than those that can be solved otherwise (mainly in highly sparse MDPs). 3. Acceleration techniques for value iteration Policy iteration and linear programming are computationally expensive techniques when dealing with problems with large state spaces. This is mainly because both require the solution (in each iteration) of a linear system of the same size as the state space. In contrast, value iteration avoids this problem by using a recursive approach from dynamic programming. Starting from an initial value function, value iteration applies successive updates to the value function for each Ss  by using:                 s asUsasTasRsU ,,,max ˆ  (4) Let   ,1,0nUn be the sequence of value functions obtained by value iteration. Then, it can be shown that every value function satisfies * 0 *UUUU n n  . Thus, by using the Banach fixed point theorem [22], it can be inferred that value iteration converges to the optimal value function * U. The power of value iteration (for the solution of large-scale MDP problems) comes from the fact that the value functions obtained can be used as bounds for the optimal value function [23]. The computational complexity of one update of value iteration is   as nnO 2, where s n is the number of states and na is the number of actions. However, the number of required iterations can be very large. Fortunately, it has been shown in [24] that an upper bound for the number of iterations   it n required by value iteration to reach an  - optimal solution is given by                      1 1 1 1 log 1 logb nit (5) MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 Vol.9No.2August2011 132 where 10   , b is the number of bits used to encode rewards and state transition probabilities, and is the approximation error. The Bellman error is given by         sUsUsasTasRsB t Ss t Aa t           ,,,max  (6) The convergence of value iteration may be quite slow for g close to one. For this reason, several improvements to value iteration have been proposed. For instance, common techniques may improve the convergence rate, reduce the time taken per iteration and/or use better stopping criteria. One of the easiest ways to improve the convergence rate is to update the value functions as soon as they become available (also known as asynchronous updates). For instance, Gauss-Seidel value iteration uses the following update equation (7). It is well known that policy iteration converges in less number of iterations than value iteration does, but requires solving a system of linear equations for each iteration. Value iteration is slower than policy iteration but it does not require the solution of any linear system of equations. A combined approach (modified policy iteration) can exploit the advantages of both. In this way, modified policy iteration uses a partial policy evaluation step based on value iteration. Another method to reduce the time taken per iteration is to identify and eliminate suboptimal actions [25]. For instance, bounds of the optimal value function can be used to eliminate suboptimal actions. The advantage of this approach is that the action set is progressively reduced with the consequent reduction in time. Otherwise, the number of iterations can be slightly reduced by using improved stopping criteria based on tighter bounds of the Bellman error (see Equation 6). For instance, a stopping criterion would be to stop value iteration when the span of the Bellman error falls below a certain threshold. Last, other way of improving the convergence rate as well as the iteration time is prioritization. This approach is based on the observation that, in each iteration, the value function usually changes only for a reduced set of states. Thus, by restricting the computation to only those states, a reduction of the iteration time is expected. It has been outlined that for acyclic problems the ordering of the states such that the transition matrix becomes triangular may result in a significant reduction in time. 4. Mixing acceleration techniques For the fast solution of stochastic shortest-path MDPs, we have modified the classical value iteration (VI) in terms of a list of non-null transitions of the form ),,,( kkkk pass  where k s is the initial state, k s  is the final state, k a is the applied action and k p is the transition probability. Let    kkkkkk passllL ,,,   be the set of transitions, R be the state rewards, n be the number of states,  be the discount factor and epsilon be the maximum error. For the following, we assume that all transitions in L are stored such that they are in ascending order of their initial state. The resulting value iteration algorithm is shown in Algorithm 1.                   ssss tt a tsUsasTsUsasTasRsU 1 ,,,,,max  (7) MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 JournalofAppliedResearchandTechnology 133 Even though we have not applied yet any accelerating methods (as those shown in a previous section) in this first algorithm, we expect this approach to be faster than the classic value iteration. In order to improve this algorithm, we have formulated variants of VI by the application of state- of-the-art acceleration techniques such as asynchronous updates, prioritization and improved prioritized sweeping. The first variant of VI (called SVI) is almost the same as Algorithm 1 but it updates asynchronously the value function. The second variant of VI (called SVI2), shown in Algorithm 2 is almost the same as SVI but it updates asynchronously the states that change the value function between iterations. function    ,,,,, LRAS    asRsUSs a,max)( 0 repeat     asRasJAaSs ,,),(    for 1k to L do sls k.  sls k    . ala k.  plp k.        spUasJasJ t  1 ,,  end for     asJsUSs a t,max)(  until   1tt UU    asJsSs a ,maxarg)(    return  Algorithm 1. Value iteration. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 Vol.9No.2August2011 134 The third variant of VI (called SVI3), shown in Algorithm 3, also updates asynchronously the value function but it updates only those states (as well as their neighbors) whose value function changed in the previous iteration and it uses a static reordering of the states in decreasing order of maximum reward. This is because it is better to use a good static ordering instead of a random ordering. Thus, state reordering is performed only once (during initialization). In this case, sorting is performed using the sort method of the Array Java class, which has a complexity. of  󰇛  log  󰇜. Note that variable reordering is only effective when using asynchronous updates. function    ,,,,, LRAS    asRsUSs a,max)(    sUsBSs  )(    )(sBschanged repeat for all changeds do      aalsslk kk kk slpUlasJAa .,. ).(.,)(          sUasJasRsB a   ,,max      sUsBsU   end for for all   changedchangedneighbors  s do      aalsslk kk kk slpUlasJ .,. ).(.,          sUasJasRsB a   ,,max      sUsBsU   end for        sBsss ,neighborschangedchanged until    sB cs hanged max      asJasRsSs a ,,maxarg)(     return p Algorithm 2. SVI2. Asynchronous VI with updates of only those states that change between iterations and im p roved termination criterion. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 JournalofAppliedResearchandTechnology 135 The forth variant of VI (called SVI4) uses the same acceleration techniques as SVI3 but it uses a different static ordering obtained by means of the modified topological ordering algorithm proposed in [25]. For special cases of acyclic MDPs, the use of a topological ordering on the states can yield an optimal ordering of states. For other cases, a good possibility could be to reorder the states to make the transition matrix “nearly triangular”. Unfortunately, real world problems involve highly cyclic MDPs and obtaining a topological ordering is nearly impossible. Last, the proposed algorithm (SVI5), shown in Algorithm 4, is the same as SVI3 but it computes a static ordering by using a multi-goal state/multistart state version of IPS. Since IPS is very fast, we also profit to obtain an initial value function (usually suboptimal [26]) by means of IPS and then we obtain the optimal policy by means of SVI3. The advantage of using IPS for computing a static ordering is its speed (because IPS is a single-pass algorithm). function    ,,,,, LRAS ),( LRsort // compute static ordering    asRsUSs a,max)(    sUsBSs  )(    )(sBschanged repeat for all changeds do      aalsslk kk kk slpUlasJAa .,. ).(.,)(          sUasJasRsB a   ,,max      sUsBsU   end for for all   changedchangedneighbors  s do      aalsslk kk kk slpUlasJ .,. ).(.,          sUasJasRsB a   ,,max      sUsBsU   end for        sBsss ,neighborschangedchanged until    sB cs hanged max      asJasRsSs a ,,maxarg)(     return p Algorithm 3. SVI3. Asynchronous VI with updates of only those states that change between iterations, improved static ordering of states and improved termination criterion. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 Vol.9No.2August2011 136 5. Experiments For evaluating our approach we chose the sailing domain [27] which involves highly cyclic MDPs. This is a finite state and action-space stochastic shortest path problem (e.g. a race), where a sailboat has to find the shortest path between two points of a lake under fluctuating wind conditions. The details of the problem are as follows: the sailboat’s position is represented as a pair of coordinates on a grid of finite size. The controller has eight actions giving the direction to a neighboring grid position. Each action has a cost (required time) depending on the direction of the action and the wind. For the action whose direction is just the opposite of the direction of the wind, the cost must be high. For example, if the wind is at 45 degrees measured from the boat’s heading, we say that the boat is on an upwind tack. On such a tack, it takes four seconds to sail from one waypoint to one of the nearest neighbors. But, if the wind is at 90 degrees from the boat’s heading, the boat moves faster through the water and can reach the next waypoint in only three seconds. Such a tack is called a crosswind tack. If the wind is a quartering tailwind, we say that the boat is on a downwind tack; such a tack takes two seconds. Finally, if the boat is sailing directly downwind, we say that it is on an away tack (only one second is required). Otherwise, if the wind is hitting the left side of the sails we say that the boat is on a port tack. If the wind is on the right-hand side, we say that it is a starboard tack. If the boat is heading directly into the wind or directly away from the wind, then it is on neither a starboard nor a port tack. When changing from a port to a starboard tack (or vice versa), we assume that our sailor wastes three seconds (delay) for every such change of tack. To keep our model simple, we assume that the wind intensity is constant but its direction can change at any time. The wind could come from one of three directions: either from the same direction as the old wind or from 45 degrees to the left or to the right of the old wind. Table 1 shows the probabilities of a change of wind direction. Each current state s comprises a position of the boat   yx,, a tack   2,1,0  t and a current wind direction   7,,1,0   w. When the heading is along one of the diagonal directions, the time is multiplied by 2 to account for the somewhat longer distance that must be traveled. All the experiments were performed on a 2.66 GHz Pentium D computer with 2 GB RAM. All algorithms were implemented in the Java language under a robotic planning environment [28]. The initial and N NE E SE S SW W NW N NE E SE S SW W NW 0.4 0.4 0.4 0.3 0.3 0.4 0.3 0.3 0.4 0.3 0.3 0.4 0.3 0.2 0.3 0.4 0.3 0.3 0.4 0.3 0.3 0.3 0.4 0.3 Table 1. Probabilities of change of wind direction. First column indicates old wind direction and first row indicates new wind direction. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 JournalofAppliedResearchandTechnology 137 maximum size of the stack of the Java virtual machine was set to 800 MB and 1536 MB, respectively. For all the experiments, we set 7 10   and 1   . The last value is due that we are dealing with an undiscounted MDP where convergence is not guaranteed by the Banach fixed point theorem and the bound of the number of iterations given by Equation (5) no longer holds. Fortunately, the presence of absorbing states (states with null reward and 100% probability of staying in the same state) allow the algorithm to converge [29]. The lake size was varied from 55296 to 940896 states. We repeated each run ten tmes and then we calculated the average and standard deviation of the solution time. 6. Results Figure 1 shows the solution time as a function of the number of states for all the tested algorithms. We can see that SVI5 (the one that obtains an initial value function by means of IPS) is significantly faster than the other algorithms. We can see in Table 2 that, for 940896 states, SVI5 was 2.3 times faster than SVI3, 4 times faster than SVI2, 5.7 times faster than SVI, 7.2 times faster than VDP and 15.5 times faster than SVI4. As we can see, iTVI was not tested for more than 400000 states because of its high memory requirements. Even the first variant of VI (SVI) is approximately 1.5 times faster than VDP. Figure 1. Solution time as a function of the number of states for all the algorithms tested. iTVI was not tested for more than 400000 states because it exhausted the memory resources. MixedAccelerationTechniquesforSolvingQuicklyStochasticShortest‐PathMarkovDecisionProcesses,M.deG.García‐Hernándezetal.129‐144 Vol.9No.2August2011 144  Alberto REYES-BALLESTEROS Dr. Reyes-Ballesteros is a researcher at Instituto de Investigaciones Eléctricas (Electrical Research Institute), IIE, in Mexico and a part-time professor at Instituto Tecnológico y de Estudios Superiores de Monterrey (Technological Institute of Higher Education of Monterrey), ITESM, campus Mexico City. His research interests include decision-theoretic planning and machine learning, and their applications in robotics and industrial processes. He received a PhD in computer science from ITESM, campus Cuernavaca, and he was involved in a postdoctoral program at the Instituto Superior Técnico (Technical Higher Education Institute), IST, in Lisbon. He is a member of the National Research System in Mexico.                                 