Matthieu Guillot
email: matthieu.guillot@g-scop.grenoble-inp.fr

Gautier Stauffer
email: gautier.stauffer@g-scop.grenoble-inp.fr

The Stochastic Shortest Path Problem: A polyhedral combinatorics perspective

 and by Bertsekas and Yu [8]. We prove that the problem is well-defined and (weakly) polynomial when (i) there is a way to reach the target state from any initial state and (ii) there is no transition cycle of negative costs (a generalization of negative cost cycles). These assumptions generalize the standard assumptions for the deterministic shortest path problem and our framework encapsulates the latter problem (in contrast with prior works). In this new setting, we can show that (a) one can restrict to deterministic and stationary policies, (b) the problem is still (weakly) polynomial through linear programming, (c) Value Iteration and Policy Iteration converge, and (d) we can extend Dijkstra's algorithm.

Introduction

The Stochastic Shortest Path problem (SSP) is a Markov Decision Process (MDP) that generalizes the classic deterministic shortest path problem. We want to control an agent, who evolves dynamically in a system composed of different states, so as to converge to a predefined target. The agent is controlled by taking actions in each time period1 : actions are associated with costs and transitions in the system are governed by probability distributions that depend exclusively on the previous action taken and are thus independent of the past. We focus on finite state/action spaces : the goal is to choose an action for each state, a.k.a. a deterministic and stationary policy, so as to minimize the total expected cost incurred by the agent before reaching the (absorbing) target state, when starting from a given initial state. More formally, a stochastic shortest path instance is defined by a tuple (S, A, J, P, c) where S = {0, 1, . . . , n} is a finite set of states, A = {0, 1, . . . , m} is a finite set of actions, J is a 0/1 matrix with m lines and n columns and general term J(a, s), for all a ∈ {1, ..., m} and s ∈ {1, ..., n}, with J(a, s) = 1 if and only if action a is available in state s, P is a row substochastic matrix with m lines and n columns and general term P (a, s) := p(s|a) (probability of ending in s when taking action a), for all a ∈ {1, ..., m}, s ∈ {1, ..., n}, and a cost vector c ∈ R m . The state 0 is called the target state and the action 0 is the unique action available in that state. Action 0 lead to state 0 with probability 1. When confusion may arise, we denote state 0 by 0 S and action 0 by 0 A . A row substochastic matrix is a matrix with nonnegative entries so that every row adds up to at most 1. We denote by M ≤ (l, k) the set of all l × k row substochastic matrices and by M = (l, k) the set of all row stochastic matrices (i.e. for which every row adds up to exactly 1). In the following, we denote by A(s) the set of actions available from s ∈ {1, ..., n} and we assume without loss of generality2 that for all a ∈ A, there exists a unique s such that a ∈ A(s). We denote by A -1 (s) the set of actions that lead to s i.e. A -1 (s) := {a : P (a, s) > 0}.

We can associate a directed bipartite graph G = (S, A, E) with (S, A, J, P ) by defining E := {(s, a) : s ∈ S \ {0}, a ∈ A \ {0} with J(a, s) = 1} ∪ {(a, s) : s ∈ S \ {0}, a ∈ A -1 (s)} ∪ {(0 S , 0 A ), (0 A , 0 S )}. G is called the support graph. A S-walk in G is a sequence of vertices (s 0 , a 0 , s 1 , a 1 , ..., s k ) for some k ∈ N with s i ∈ S for all 0 ≤ i ≤ k, a i ∈ A for all 0 ≤ i ≤ k -1, (s i , a i ) ∈ E for all 0 ≤ i ≤ k, and (a i-1 , s i ) ∈ E for all 1 ≤ i ≤ k. k is called the length of the walk. We denote by W k the set of all possible S-walk of length k and W := ∪ k∈N W k . A policy Π is a function Π : (k, w k ) ∈ N × W k → Π k,w k ∈ M = (n, m) satisfying Π k,w k (s, a) > 0 =⇒ J(s, a) = 1 for all s ∈ {1, ..., n} and a ∈ {1, ..., m}. We say that a policy is deterministic if Π k,W k is a 0/1 matrix for all k and w k , it is randomized otherwise. If Π is constant, we say that the policy is stationary, otherwise it is called history-dependent. A policy Π induces a probability distribution over the (countable) set of all possible S-walks. When Π is stationary, we often abuse notation and identify Π with a matrix.

We let y Π k ∈ R n + be the substochastic vector representing the state of the system in period k when following policy Π (from an initial distribution y Π 0 ). That is y Π k (i) is the probability of being in state i, for all i = 1, ..., n at time k following policy Π. Similarly, we denote by x Π k ∈ R m + the substochastic vector representing the probability to perform action j, for all j = 1, ..., m, at time k following policy Π. By the law of total probability, we have

x Π k = Π T • y Π k for all k ≥ 0.
Similarly, given a stationary policy Π and an initial distribution y Π 0 at time 0, we have :

y Π k = P T x Π k-1 = P T • Π T • y Π k-1 for all k ≥ 1.
Hence the state of the system at time k ≥ 0 follows y

Π k = (P T • Π T ) k • y Π 0 .
The value c T x Π k represents the expected cost paid at time k following policy Π. One can define for each i ∈ S \{0}, J Π (i) := lim sup K→+∞ K k=0 c T x Π k with y π 0 := e i , and J * (i) := min{J Π (i) : Π deterministic and stationary policy}3 (e i is the characteristic vector of {i} i.e. the 0/1 vector with e i (j) = 1 iff j = i). Bertsekas and Tsistiklis [START_REF] Bertsekas | An analysis of stochastic shortest path problems[END_REF] defined a stationary policy Π * to be optimal4 if J * (i) := J Π * (i) for all i ∈ S \ {0}. They introduced the Stochastic Shortest Path Problem as the problem of finding such an optimal stationary policy.

Literature review

The stochastic shortest path problem is a special case of Markov Decision Process and it is also known as total reward undiscounted MDP [START_REF] Bertsekas | Dynamic programming and optimal control[END_REF][START_REF] Bertsekas | Dynamic programming and optimal control[END_REF][START_REF] Puterman | Markov decision processes: discrete stochastic dynamic programming[END_REF]. It arises naturally in robot motion planning, from maneuvering a vehicle over unfamiliar terrain, steering a flexible needle through human tissue or guiding a swimming micro-robot through turbulent water for instance [START_REF] Alterovitz | The stochastic motion roadmap: A sampling framework for planning with markov motion uncertainty[END_REF]. It has also many applications in operations research, artificial intelligence and economics: from inventory control, reinforcement learning to asset pricing (see for instance [START_REF] White | A survey of applications of markov decision processes[END_REF][START_REF] Merton | An intertemporal capital asset pricing model[END_REF][START_REF] Bäuerle | Markov Decision Processes with Applications to Finance: Markov Decision Processes with Applications to Finance[END_REF][START_REF] Sutton | Introduction to Reinforcement Learning[END_REF]). SSP forms an important class of MDPs as it contains finite horizon MDPs, discounted MDPs (a euro tomorrow is worth less than a euro today) and average cost problems (through the so-called vanishing discounted factor approach) as special cases. It thus encapsulates most of the work on finite state/action MDPs. The stochastic shortest path problem was introduced first by Eaton and Zadeh in 1962 [START_REF] Eaton | Optimal pursuit strategies in discrete-state probabilistic systems[END_REF] in the context of pursuit-evasion games and it was later studied thoroughly by Bertsekas and Tsitsiklis [START_REF] Bertsekas | An analysis of stochastic shortest path problems[END_REF].

MDPs were first introduced in the 50's by Bellman [START_REF] Bellman | Dynamic Programming[END_REF] and Shapley [START_REF] Shapley | Stochastic games[END_REF] and they have a long, rich and successful history (see for instance [START_REF] Bertsekas | Dynamic programming and optimal control[END_REF][START_REF] Bertsekas | Dynamic programming and optimal control[END_REF][START_REF] Puterman | Markov decision processes: discrete stochastic dynamic programming[END_REF]). For most MDPs, it is known that there exists an optimal deterministic and stationary policy [START_REF] Puterman | Markov decision processes: discrete stochastic dynamic programming[END_REF]. Building upon this fact, there are essentially three ways of solving such problems exactly (and some variants) : value iteration (VI), policy iteration (PI) and linear programming (LP). Value iteration and policy iteration are the original 50+ years old methods [START_REF] Bellman | Dynamic Programming[END_REF][START_REF] Howard | Dynamic programming and Markov processes[END_REF]. The idea behind VI is to approximate the infinite horizon problem with a longer and longer finite one. The solution to the k-period approximation is built inductively from the optimal solution to the (k -1)-period problem using standard dynamic programing. The convergence of the method relies mainly on the theory of contraction mappings and Banach fixed-point theorem [START_REF] Bertsekas | Dynamic programming and optimal control[END_REF] for most MDPs. PI is an alternative method that starts from a feasible deterministic and stationary policy and iteratively improves the action in each state so as to converge to an optimal solution. It can be interpreted as a simplex algorithm where multiple pivots are performed in each step [START_REF] Manne | Linear programming and sequential decisions[END_REF][START_REF] Denardo | On Linear Programming in a Markov Decision Problem[END_REF]. As such it builds implicitly upon the geometry of the problem to find optimal solutions. Building explicitly upon this polyhedra, most MDPs can also be formulated as linear programs and as such they can thus be solved in (weakly) polynomial time [START_REF] Manne | Linear programming and sequential decisions[END_REF][START_REF] Epenoux | A probabilistic production and inventory problem[END_REF][START_REF] Denardo | On Linear Programming in a Markov Decision Problem[END_REF][START_REF] Hordijk | Linear programming and markov decision chains[END_REF][START_REF] Hernández-Lerma | The linear programming approach[END_REF].

In the context of the SSP, some hypothesis are required for standard methods and proof techniques to apply. Bertsekas and Tsitsiklis [START_REF] Bertsekas | An analysis of stochastic shortest path problems[END_REF] introduced the notion of proper stationary policies : a stationary policy Π is said to be proper if 1 T (P T • Π T ) n • e i < 1 for all i = 1, ..., n, that is, after n periods of time, the probability of reaching the target state is positive, from any initial state i. We say that such policies are BT-proper as we will introduce a slight generalization later. They proved that VI, PI and LP still work when two assumptions hold, namely, when (i) there exists a BT-proper policy and (ii) any BT-improper policy Π have at least one state i for which J Π (i) = +∞. In particular they show that one can restrict to deterministic policies. Their assumptions naturally discriminate between BT-proper and BT-improper policies. Exploiting further the discrepency between these policies, Bertsekas and Yu [START_REF] Bertsekas | Stochastic shortest path problems under weak conditions[END_REF] showed that one can relax asumptions (i) and (ii) when the goal is to find an optimal BT-proper stationary policy. They could show that applying the standard VI and PI methods onto a perturbated problem where c is modified to c + δ • 1 with δ > 0 and letting δ tends to zero over the iterations, yields an optimal BTproper solution if (j) there exists a BT-proper policy and (jj) J * is real-valued. Moreover they could also show that the problem can still be formulated (and thus solved) using linear programming, which settles the (weak) polynomiality of this extension. Some authors from the AI community proposed alternative extensions of the standard SSP introduced by Bertsekas and Tsitsiklis. It is easy to see that the most general one, entitled Stochastic and Safety Shortest Path problem [START_REF] Teichteil-Königsbuch | Stochastic safest and shortest path problems[END_REF], is a special case of Bertsekas and Yu's framework (it is a bi-objective problem that can be easily model in this framework using artificial actions of prohibited cost).

The question of whether SSP, in its original form or the later generalization by Bertsekas and Yu, can be solved in strongly polynomial time 5 is a major open problem for MDPs (see for instance [START_REF] Ye | The simplex and policy-iteration methods are strongly polynomial for the markov decision problem with a fixed discount rate[END_REF]). It was proven in a series of breakthrough papers that it is the case for fixed discount rate (basically the same problem as before but where the transition matrix P is such that there is a fixed non-zero probability of ending up in 0 after taking any action). The result was first proved using interior point methods [START_REF] Ye | A new complexity result on solving the markov decision problem[END_REF] and then the same author showed that the original policy iteration method proposed by Howard was actually strongly polynomial too [START_REF] Ye | The simplex and policy-iteration methods are strongly polynomial for the markov decision problem with a fixed discount rate[END_REF] (the analysis was later improved [START_REF] Hansen | Strategy iteration is strongly polynomial for 2-player turn-based stochastic games with a constant discount factor[END_REF]). The problem is still open for the undiscounted case but Policy Iteration is known to be exponential in that setting [START_REF] Friedmann | An exponential lower bound for the parity game strategy improvement algorithm as we know it[END_REF]. In contrast, value iteration was proved to be exponential even for the discounted case [START_REF] Feinberg | The value iteration algorithm is not strongly polynomial for discounted dynamic programming[END_REF]. Because SSPs can be formulated as linear programs, the question relates very much to the existence of strongly polynomial time algorithms for linear programming, a very long-lasting open problem that was listed as one of the 18 mathematical problems of the 21st century by Smale in 1998 [START_REF] Smale | Mathematical problems for the next century[END_REF]. A possible line of attack is to study simplex-type of algorithms but existence of such algorithms is also a long standing open problem and relates to the Hirsch conjecture on the diameter of polyhedra. These questions are central in optimization, discrete geometry and computational complexity. Despite the fact that SSP exhibits strong additional properties over general LPs, these questions are still currently out of reach in this setting, too.

In practice, value iteration and policy iteration are the methods of choice when solving medium size MDPs. For large scale problems (i.e. most practical applications), approximate solutions are needed to provide satisfying solutions in a reasonable amount of time [START_REF] Powell | Approximate Dynamic Programming: Solving the Curses of Dimensionality[END_REF]. The field is known as Approximate Dynamic Programming and is a very active area of research. Most approximation methods are based on approximate versions of exact algorithms and developping new exact approaches is thus of great practical interest.

In this paper, we propose an extension of the frameworks of Bertsekas and Tsitsiklis [START_REF] Bertsekas | An analysis of stochastic shortest path problems[END_REF] and Bertsekas and Yu [START_REF] Bertsekas | Stochastic shortest path problems under weak conditions[END_REF]. We prove in section 3 that, in this setting, there is an optimal deterministic and stationary policy. Then we show in section 4 that the standard Value Iteration and Policy Iteration methods converge, and we give an alternative approach that generalizes Dijkstra's algorithm when the costs are non negative.

Notations and definitions

Given a directed graph G(V, E), and a set S ⊂ V , we denote by δ + (S) the set of arcs (u, v) with u ∈ S and v ∈ S, and by N + (S) the set of vertices v ∈ V such that (u, v) ∈ E for some u ∈ S. For convenience when S is a singleton, we denote δ + ({u}) by δ + (u) and N + ({u}) by N + (u). Then we define inductively

N + k (u) := N + (N + k-1 (u)) \ N + k-1 (u) ∪ . . . ∪ N + 0 (u)) for k ≥ 1 integer with N + 0 (u) = {u}. We denote by R + (u) the set of vertices reachable from u i.e. R + (u) = k≥0 N + k (u). We can define δ -(u), N -(u), N - k (u) and R -(u) analogously. Clearly v ∈ R -(u) if and only if u ∈ R + (v). R -(u)

Our new framework

We start with a simple observation whose proof can be found in the Appendix (see section A.2).

Lemma 1. For BT-proper stationary policies, lim

K→+∞ K k=0
x Π k is finite for any initial state distribution y Π 0 .

We now extend the notion of proper policies introduced by Bertsekas and Tsitsiklis using this alternative (relaxed) property and from now on we will only use this new definition. Given a state s ∈ {1, ..., n}, a policy Π is said to be s-proper if k≥0 x Π k is finite, when y Π 0 := e s . Observe that k≥0 y Π k is also finite for s-proper policies (as

y Π k = P T x Π k-1
). In particular lim k→+∞ y Π k = 0, that is the policy lead to the target state 0 with probability 1 from state s. The s-stochastic-shortestpath problem (s-SSP for short) is the problem of finding a s-proper policy Π of minimal cost c T k≥0 x Π k . We say that a policy is proper if it is s-proper for all s and improper otherwise. The stochastic shortest path problem (SSP) is the problem of finding a proper policy Π of minimal cost c T k≥0 x Π k where y Π 0 := 1 n 1. It is easily seen that the stochastic shortest path problem, as defined here, is also a special case of the s-SSP as one can add an artificial state with only one action that leads to all states in {1, ..., n} with probability 1 n . In the following two sections, unless otherwise stated, we restrict to the s-SSP. In this context, we often abuse notation and we simply call proper a s-proper policy.

Since for any policy Π (possibly history-dependent and randomized), Π k,w k are stochastic matrices, we have at any period k ≥ 0, a∈A(s) x Π k (a) = y Π k (s). We also have y Π k+1 (s) = a∈A p(s|a)x Π k (a) for all s ∈ {1, ..., n}. In matrix form this is equivalent to y

Π k = J T x Π k and y Π k+1 = P T x Π k . This implies J T x Π k+1 = P T x Π k for all k ≥ 0. We also have J T x Π 0 = e s . Now x Π := ∞ k=0
x Π k is well-defined for proper policies. Summing up the previous relations over all periods k ≥ 0 we get (J -P ) T x Π = e s . Hence the following linear program is a relaxation of the s-SSP problem 6 .

min c T x (J -P ) T x = e s x ≥ 0
(P s )
Observe that for a deterministic problem (i.e. when P is a 0/1 matrix), (J -P ) T is the node-arc incidence matrix of a graph (up to a row) and the corresponding LP is the standard network flow relaxation of the deterministic shortest path problem. The vector x is sometimes called a network flux as it generalizes the notion of network flow.

We call a solution x to (J -P ) T x = 0, x ≥ 0 a transition cycle and the cost of such a transition cycle x is c T x. Negative cost transition cycles are the natural extension of negative cost cycles for deterministic problems (actually we could also consider only the extreme rays of (J -P ) T x = 0, x ≥ 0 ; we defer the discussion to the journal version of the paper). One can check the existence of such objects by solving a linear program.

Lemma 2. One can check in (weakly) polynomial time whether a stochastic shortest path instance admits a negative cost transition cycle through linear programming.

We will prove in the sequel that the extreme points of P s := {x ≥ 0 : (J -P ) T x = e s } 'correspond' to proper deterministic and stationary policies. Hence, when the relaxation (P s ) has a finite optimum (i.e. when there is no transition cycle of negative cost and when a proper policy exists), this will allow to prove that, the s-SSP admits an optimal proper policy which is deterministic and stationary. This answers, for this problem, one fundamental question in Markov Decision Problem theory "Under what conditions is it optimal to restrict to deterministic and stationary policies ?" [START_REF] Puterman | Markov decision processes: discrete stochastic dynamic programming[END_REF].

We can assume without loss of generality that there exists a path between all state node i and 0 in the support graph G. Indeed, if there is a node i with no path to 0 in G, then no s-proper policy will pass through i at any point in time (because then the probability of reaching the target state, starting from i, is zero, contradicting lim k→+∞ y Π k = 0) ; we could thus remove i and the actions leading to i and iterate. It is easy to see that under this assumption, there is always a s-proper policy. Indeed the randomized and stationary policy Π that chooses an action in state i uniformly at random among A(i) will work : in this case, for each state i, there is in fact a non zero probability of choosing one of the paths from i to 0 after at most n periods of time.

Lemma 3. Consider a s-SSP instance where there exists a path between all state node i and 0 in the support graph G. Then the policy that consists, for each state i ∈ S \{0}, in choosing uniformly at random an action in A(i) is a proper stationary policy.

The discussion above also gives a simple algorithm for testing the existence of a proper policy for any instance of the SSP. We are now ready to introduce the new assumptions that we will use to study the stochastic shortest path problem. They are the very natural extensions of the standard assumptions for the deterministic shortest path problem.

Assumption 1 We consider s-SSP/SSP instances where :

there exists a path between all state node i and 0 in the support graph G, and there is no negative cost transition cycle.

As already observed, these assumptions can be checked in (weakly) polynomial time. Moreover, these assumptions implies that (P s ) has a finite optimum (from standard LP arguments). Also Bertsekas and Yu's framework is a special case of our setting as in the presence of negative cost transition cycles, J * (i) is not real-valued for some state i7 . The main extension, with respect to Bertsekas and Yu, is that we allow for non-stationary proper policies in the first place.

Existence of an optimal, deterministic and stationary policy

In this section, we will prove essential properties about P s := {x ≥ 0 : (J -P ) T x = e s }. This will allow to prove that, under Assumption 1, we can restrict to optimal proper, deterministic and stationary policies. The following theorem can be seen as an extension of the flow decomposition theorem (see [START_REF] Ahuja | Network Flows: Theory, Algorithms, and Applications[END_REF]). Theorem 5. Let x ∈ R m be a feasible solution of (P s ). In strongly polynomial time, one can find 1 ≤ k ≤ m, x 1 , ..., x k , x c ∈ R m , and λ 1 , ..., λ k ∈ [0, 1] such that x 1 , ..., x k are feasible solutions of (P s ), x c satisfies (J -P ) T x c = 0, x c ≥ 0, k j=1 λ j = 1 and x = k j=0 λ j x j + x c . Moreover, the vectors x j are network flux corresponding to proper, deterministic and stationary policies, i.e. for all j ∈ 1, . . . , k, there exists a proper, deterministic and stationary policy Π j such that x j = x Πj .

Before we can prove this theorem, we need a couple of useful lemmas and definitions. Let G = (U, V, E) and x ∈ R m be a solution to (J -P ) T x = e s , x ≥ 0. Let G x be the subgraph of G induced by the vertices in S ∪ A x where A x := {a ∈ {1, ..., m} with x(a) > 0. G x is called the support graph of x in G. We denote by E x the set of edges of G x . Lemma 6. There exists a path between all states reachable from s in G x and 0 S . In other word, for all i ∈ R + Gx (s), we have i ∈ R - Gx (0 S ).

Proof. Let us define x ∈ R |Ex| as follows : x((s , a)) := x(a) for all a ∈ A x and s the (unique) state with a ∈ A(s ), and x((a, s )) := P (a, s ) • x(a) for all a ∈ A x , and s ∈ S such that P (a, s) > 0.

Observe that x is only defined on E x and that x > 0. Because x is a feasible solution to (P s ), x satisfies

x(δ + Gx (v)) -x(δ - Gx (v)) = 1 {s} (v) -1 {0 S } (v) for all v ∈ G x and x ≥ 0. It is thus a unit (s, 0 S )-flow in G x . Now let us assume that there exists i ∈ R + Gx (s) with i ∈ R - Gx (0). Summing up all flow constraints over v ∈ R + (i), we get x(δ + (R + (i))) -x(δ -(R + (i))) = 1 R + (i) (s)
(we remove from now on the subscript G x in order not to overload the notation). We have x(δ

+ (R + (i))) = 0 by definition of R + (i). But then x(δ -(R + (i))) + 1 R + (i) (s) = 0. Since x(δ -(R + (i))) ≥ 0, this implies s ∈ R + (i) and x(δ -(R + (i))) = 0.
Now because s ∈ R + (i) and s ∈ R -(i) (by hypothesis), there is at least one arc of E x in δ -(R + (i)) but this implies x(δ -(R + (i))) > 0 as x > 0, a contradiction.

Given a proper, deterministic and stationary policy Π, we denote by G Π the subgraph of G induced by the state vertices in S and the actions vertices in Π. Now let G s Π be the subgraph of G Π induced by the vertices in R + (s). G s Π is called the support graph of Π (it is easily seen that it corresponds to the subgraph induced by the states and actions that we might visit under policy Π). Because Π is proper, 0 S is reachable from each state i in G s Π . Let us denote by S the state vertices in G s Π and Π(S ) the actions associated with S in Π. We also denote by P S the restriction of P to the rows in S and the columns in Π(S ) (P S is a |S | × |S | matrix). Following the same arguments as in Section A.2, lim k→+∞ (P S ) k = 0 and thus (I S -P S ) is invertible. Now observe that (I S -P S ) T x Π [Π(S )] = e s for x Π := +∞ k=0 x Π k , with y Π 0 := e s (e s is the restriction of e s to the indices in S ). Indeed x Π (a) = 0 for all a ∈ Π(S ) and thus (I S -P S ) T x Π [Π(S )] = e s corresponds to the constraints of (P s ) associated with the rows in S . We thus have the following lemma.

Lemma 7. Given a proper, deterministic and stationary policy Π, the flux vector x Π associated with Π and defined by x Π := +∞ k=0 x Π k , with y Π 0 := e s satisfies x Π [Π(S )] = (I S -P S ) -T e s and x Π (a) = 0 for all a ∈ Π(S ), with S ,Π(S ), I S ,P S and e s defined as above.

The following Lemma is easy to prove using similar flow arguments as in the proof of Lemma 6. Lemma 8. Let Π be a proper, deterministic and stationary policy. We have G s Π = G x Π . Moreover if x ∈ P s and Π(S) ⊆ A x , then G s Π is a subgraph of G x and x Π (a) ≥ x(a) for some a ∈ A x .

Before proving Theorem 10, we need a final Lemma.

Lemma 9. Let G = (U, V, E) be the support graph of a s-SSP instance and assume that there is a path from every state vertex i to 0 S in G. Proof. We know that, 0 ∈ R + (i) for all i, is enough to ensure that there is a proper policy by Lemma 3. Now if there exists a state vertex i in G with |A(i)| > 1, we can delete from G an action in A(i) that does not remove 0 from R + (i). Such an action exists as it is enough to keep an action a ∈ A(i) with minimum distance to 0 (in terms of arc) to ensure that 0 is still in R + (i) after deletion (by minimality of the distance to 0, such an action has a directed path to 0 that does not go through i). If |A(i)| = 1 for all i then the only possible policy is proper (from Lemma 3), deterministic and stationary. We We are now ready to prove the main Theorem of this section.

Theorem 10. Let x ∈ R m be a feasible solution of (P s ). In strongly polynomial time, one can find 1 ≤ k ≤ m, x 1 , ..., x k , x c ∈ R m , and λ 1 , ..., λ k ∈ [0, 1] such that x 1 , ..., x k are feasible solutions of (P s ), x c satisfies (J -P ) T x c = 0, x c ≥ 0, k j=1 λ j = 1 and x = k j=0 λ j x j + x c . Moreover, the vectors x j are network flux corresponding to proper, deterministic and stationary policies, i.e. for all j ∈ 1, . . . , k, there exists a proper, deterministic and stationary policy Π j such that x j = x Πj .

Proof. We prove first that such a decomposition exists for any x ∈ P s . Let x be a smallest counterexample (in terms of |A x |). Because x is a feasible solution of (P s ), we know by Lemma 6 that there exists a path between all states reachable from s in G x and 0. Now from Lemma 9, we know that there exists a proper, deterministic and stationary policy Π to which we can associate and compute a flux x Π using Lemma 7. Let λ ≥ 0 be the maximum value such that x := x -λx Π ≥ 0. By Lemma 8 we have that G x Π is a subgraph of G x and thus λ > 0 (as x > 0 on A x ). We also have λ ≤ 1 by the same Lemma. Moreover by maximality of λ, there is an arc a ∈ A x such that x(a) > 0 and x (a) = 0. Hence A x ⊂ A x . If λ = 1, x is a solution to (J -P ) T x = 0, x ≥ 0 and x := x Π + x provides a decomposition for x, a contradiction. Else, 1 1-λ x is a solution to (P s ) with

|A x | < |A x |.
By minimality of the counter-example, we can assume that there exists a decomposition for 1 1-λ x . Now we can get a decomposition for x from the decomposition for 1 1-λ x by scaling the multipliers by 1-λ and using x Π with multiplier λ, this is contradiction. Clearly, we can make the proof algorithmic and because A x ⊂ A x at each iteration, the algorithm will terminate in at most |A x | steps with a set of k ≤ |A x | solutions x 1 , ...., x k to (P s ) and a vector x c satisfying the theorem.

Corollary 11. Under Assumption 1, the s-SSP admits an optimal proper, deterministic and stationary policy.

Proof. We know from linear programming that when a LP has finite optimum, we can find an optimal solution in an extreme point. For (P s ) this is guaranteed by Assumption 1. But an extreme point x of P s cannot be expressed as a convex combination of other points of P s by definition. As such, using Theorem 10, x must be equal to x Π for some proper, deterministic and stationary policy Π. Now c T x Π is precisely the cost of policy Π. Hence we have a feasible solution to our original problem which is optimal for the linear relaxation (P s ). It is thus optimal for the original problem.

We can deduce from what preceeds a result which is standard for the deterministic shortest path problem : Bellman optimality conditions. Lemma 12. Let Π be an optimal proper, deterministic and stationary solution to the s-SSP (under Assumption 1). Let G s Π be the support graph of Π. For all state vertex i in G s Π , Π is optimal for i-SSP.

Proof. Observe first that i-SSP satisfies Assumption 1. Now suppose Π is not optimal for i-SSP. We know from Corollary 11 that i-SSP admits an optimal proper, deterministic and stationary policy Π i . Now the (history-dependent and non stationary) policy Π that consists in applying policy Π to problem s-SSP, up to when state i is reached (if it ever is) and then applying policy Π i is a proper policy. The value of this policy is better than the value of Π as there exists a realization where i is reached, a contradiction.

Algorithms

We focussed, up to now and without loss of generality, on the s-SSP problem. Bellman optimality conditions (i.e. Lemma 12) also tells us that, under Assumption 1, we can actually restrict attention to the SSP problem as well without loss of generality. Indeed we already observed that SSP can be converted to a s-SSP problem by simply adding an artificial state s and a unique action available from s that lead to all states i = 1, ..., n with probability 1 n . Now there is a one-to-one correspondance between the policies of SSP and the policies of the auxiliary s-SSP problem and hence any proper, deterministic and stationary solution Π to SSP is optimal if and only if it is optimal for the auxiliary problem. But by Lemma 12, an optimal policy Π * for SSP is optimal for i-SSP for all i = 1, ..., n (as all i are in G Π * ). It is easy to see that all theorems from the previous section extend naturally to the SSP setting. Of course, some definitions and results have to be slightly adapted : for instance, the flux vector x Π associated with a proper deterministic and stationary policy is now x Π := +∞ k=0 x Π k with y Π 0 := 1 n 1 and it satisfies x Π = (I -P Π ) -T 1 n 1 (see Lemma 7 for the previous relation), where P Π is the n×n matrix obtained from P by keeping only the rows corresponding to actions in Π. For algorithmic reasons, it is more convenient to deal with the SSP problem as there is no problem of degeneracy : the feasible basic solution x Π (it is indeed now the basic solution associated with the basis (I -P Π ) T ) has positive values on the actions in Π. In this section, we will therefore focus on the SSP problem. The corresponding linear programming formulation is (in principle, the right hand side should be 1 n 1 but we simply rescaled it):

min c T x (J -P ) T x = 1 x ≥ 0 (P )
One possible way of solving the previous model is to use any polynomial time algorithm for linear programming. This would lead to weakly polynomial time algorithms for SSP. As pointed out in the introduction, there are two standard alternatives for solving a MDP : Value Iteration and Policy Iteration. We prove in the next two sections the convergence of these methods under Assumption 1. Then we give another new iterative method based on the standard primal-dual approach to linear programming : this can be considered as a natural generalization of Dijkstra's algorithm.

Value Iteration

We denote by P the set of all proper policies for SSP. For all i = 1, ..., n, we define V * (i) to be the optimal value of (P i ) (again under Assumptions 1), i.e. V * (i) := min Π∈P c T x Π with y Π 0 = e i . This is refered to as the value of state i. We have in particular V * (i) = min Π∈P lim K→+∞ K k=0 c T x Π k by definition of x Π k . In the following, we show that we can switch the min and lim operators with some care. We need first to introduce an auxiliary SSP instance obtained from (S, A, J, P, c) by adding an action of cost M (i) for each state i = 1, ..., n that lead to state 0 with probability one, with M (i) "big enough" . We call aux-SSP this auxiliary problem. Observe that in aux-SSP, there are proper policies that terminate in at most k time periods for all k ≥ 1, from any starting state. Indeed one can always chose an auxiliary action in period k -1. Let us denote by P k the proper policies in aux-SSP that terminate in at most k steps and by P aux the proper policies for aux-SSP. Observe that V K (i) := min Π∈P K K k=0 c T x Π k is well-defined for each K ≥ 1. In fact it is easy to prove by induction that it follows the dynamic programming formula : V k (i) = min{V k-1 (i), min a∈A(i) c(a) + j p(j|a)V k-1 (j)} for all k ≥ 2 and V 1 (i) = M (i) for all i = 1, ..., n (an optimal, deterministic non-stationary policy Π * K can be recovered easily too) : V k (i) is indeed the optimal value starting from i among policies in P k . The following result can be seen as an extension of Bellman-Ford algorithm for the deterministic shortest path problem. We give the proof in Section A.3.

Theorem 13. For all

i = 1, ..., n, if M (i) ≥ V * (i), then we have V * (i) = lim K→+∞ V K (i).
Notice that it is easy to find initial values for M (i) satisfying the previous Theorem. Indeed one can use V Π (i), the values for state i when using policy Π for any i-proper policy Π. We can actually easily find a proper deterministic and stationary policy for SSP (i.e. for all i simultaneously) by extending Lemma 9 to SSP.

The algorithm that consists in evaluating V k iteratively until ||V k -V k-1 || ∞ is below some threshold is called Value Iteration. Value Iteration was already known to converge for SSP in the presence of transition cycles of cost zero, when initialized appropriately, see Bertsekas and Yu [START_REF] Bertsekas | Stochastic shortest path problems under weak conditions[END_REF].

We now explain how to recover an optimal proper, deterministic and stationary policy given the optimal vector V * . Let us consider the dual linear program (D) of (P ) :

max 1 T y (J -P )y ≤ c (D)
By definition of V * (i) and by Lemma 12, we know that V * satisfies V * (i) = min a∈A(i) c(a) + j p(j|a)V * (j) for all i = 1, ..., n. Also extending Corollary 11 to SSP, we know that there exists an optimal proper deterministic and stationary policy Π * with V * (i) = c(Π * (i)) + j p(j|Π * (i))V * (j) for all i = 1, .., n. In particular, y * := V * is feasible for (D) and because the pair (x Π * , y * ) satisfies the complementary slackness conditions, y * is optimal for (D). Now let us reverse the complementary slackness conditions. An optimal solution x * to (P ) can have x * (a) > 0 only if V * (i) = c(a)+ j p(j|a)V * (j). Let A * be the set of all such actions and let us restrict our instance of SSP to those actions in A * . Because there is an optimal proper, deterministic and stationary policy Π * for SSP and because such a policy must use only actions in A * , we know that there is a path from every state to the target state 0 in the support graph G * = (U * , V * , E * ) of this instance. Now the stationary policy Π consisting in choosing uniformly at random an action in A * (i) for each state i is proper by Lemma 3 and x Π := lim K→+∞ K k=0 x Π k is feasible for (P ). Observe that by construction, the pair (x Π , y * ) satisfies the complementary slackness conditions and thus x Π is also optimal for (P ). Extending theorem 10 to SSP and by optimality of x Π , we can decompose x Π into a convex combination of vectors x Πj associated with proper, deterministic and stationary policies Π j . Again by optimality of x Π , x Πj are also optimal for (P ). We can thus use Theorem 10 to get an optimal, proper, deterministic and stationary policy for the problem. In fact we can stop after the first application of Lemma 9 and thus get such a policy in time

O(|U * | + |V * | + |E * |).
N.B. We can define an approximate proper solution Π k at each step k of Value Iteration by considering an approximate version of the complementary slackness theorem. We defer the discussion to the journal version of the paper.

Policy Iteration

An alternative to Value Iteration is to use a simplex algorithm to solve (P ). In order to do so we need an initial basis. We can use Lemma 9 to find a proper deterministic and stationary policy Π. Then as we already observed, x Π = (I -P Π ) -T 1 is a non-degenerate feasible basic solution of (P ). Because the basic solutions are non-degenerate, we can implement any pivot rule from this initial basic solution and the simplex algorithm will converge in a finite number of steps. This type of algorithm is often referred to as simple policy iteration in the litterature. This proves that simple PI terminates in a finite number of steps. Unfortunately, most pivot rules are known to be exponential in n and m in the worst case [START_REF] Melekopoglou | On the complexity of the policy improvement algorithm for markov decision processes[END_REF].

In contrast with simple policy iteration, Howard's original policy iteration method [START_REF] Howard | Dynamic programming and Markov processes[END_REF] changes the actions of a (basic) policy in each state i for which there is an action in A(i) with negative reduced cost. We will prove now that this method converges under Assumptions 1. For this, we will prove that the method iterates over proper deterministic and stationary policies and that the cost is decreasing at each iteration. Given a proper deterministic and stationary policy Π, x Π = (I -P Π ) -T 1 is the basic feasible solution of (P ) associated with the basis (I -P Π ) T . We define the reduced cost vector associated with c and Π as cΠ := c -c Π (I -P Π ) -T (J -P ) T following linear programming (in order not to overload the notations we consider c as a row vector in this section). Let us denote by A > (Π) the set of actions a of A such that cΠ (a) < 0. We know from linear programming that if cΠ (a) ≥ 0 for all a, then x Π (and thus Π) is optimal. If A > (Π) = ∅, then we can swap actions in Π with actions in A > (Π) for each state where such an action exists. Let us denote by Π the resulting policy. The proof of the following proposition is given in Appendix A.4.

Proposition 14. Π is proper and c

• x Π < c • x Π
Because we have a finite number of proper deterministic and stationary policy, we can conclude that Howard's policy iteration algorithm converges in a finite number of steps.

Theorem 15. Under Assumption 1, Howard's PI method converges in a finite number of steps.

Observe that it is important not to change actions which are not strictly improving. Indeed, in this case it is easy to build deterministic examples where Lemma 14 fails (see for instance Fig. 2 in Section A.1). As for value iteration, prior to this work policy iteration was not known to converge in this setting. And again, as for VI, unfortunately Howard's Policy Iteration can be exponential in n and m [START_REF] Fearnley | Exponential lower bounds for policy iteration[END_REF].

4.3

The Primal-Dual algorithm : a generalization of Dijkstra's algorithm Primal-dual algorithms proved very powerful in the design of efficient (exact or approximation) algorithms in combinatorial optimization. Edmonds' algorithm for the weighted matching problem [START_REF] Edmonds | Maximum matching and a polyhedron with (0,1) vertices[END_REF] is probably the most celebrated example. It is well-known that for the deterministic shortest path problem, when the costs are non negative, the primal-dual approach corresponds to Dijkstra's algorithm [START_REF] Papadimitriou | Combinatorial optimization: Algorithms and complexity[END_REF]. We extend this approach to the SSP setting. Let us first recall the linear formulation of the problem and its dual :

min c T x (J -P ) T x = 1 x ≥ 0 (P) max 1 T y (J -P ) y ≤ c (D)
The primal-dual algorithm works as follows here. Consider a feasible solution ȳ to (D) (initially ȳ = 0 is feasible if c ≥ 0). Now let Ā := {a ∈ A : 1 T a (J -P ) y = c a }. We know from complementary slackness that ȳ is optimal if and only if there exists x ≥ 0 : (J -P ) T x = 1 and x a = 0, ∀a ∈ Ā ((P) admits an finite optimum by Assumption 1). The problem can be rephrased as a so-called restricted primal (RP), where J Ā, P Ā and x Ā are the restrictions of J, P, x to the row in Ā. We also give its corresponding dual problem (DRP).

min 1 T z (J Ā -P Ā) T x Ā + z = 1 x Ā, z ≥ 0 (RP) max 1 T y (J Ā -P Ā) y ≤ 0 y ≤ 1 (DRP)
If there is a solution of cost 0 to (RP) then we have found an optimal solution to our original problem. Else, we use an optimal, positive cost solution y to (DRP) and we update the initial solution by setting ȳ := ȳ + y with ≥ 0 maximum with the property that ȳ + y remains feasible for (D), and we iterate. The algorithm is known to converge in a finite number of steps ((RP) being non degenerate, no anticycling rule is needed to guarantee finiteness here [START_REF] Papadimitriou | Combinatorial optimization: Algorithms and complexity[END_REF]) and this provides an alternative approach to the problem as long as we can also solve (RP) and (DRP).

Observe that (RP) can be interpreted as a SSP problem with action set Ā ∪ {m + 1, ..., m + n}, where actions m + k, for all k = 1, ..., n is an artificial action associated with state k that lead to the target state 0 with probability one. The cost of actions in Ā is zero while the cost of the artificial actions m + 1, ..., m + n is one. The primal-dual approach thus reduces the initial problem to a sequence of simpler 0/1 cost SSP problems. Note that (RP) is actually the problem of maximizing the probability of reaching state 0 using only actions in Ā. This problem is known in the AI community as MAXPROB [START_REF] Mausam | Planning with Markov Decision Processes: An AI Perspective[END_REF]. Little is known about this problem. We know though that it can be solved in weakly polynomial time because it fits into our framework and we can thus solve it using linear programming. We could also use Value Iteration, the simplex method or Policy Iteration as described in the previous subsections. Some simplex rules are known to be exponential in this setting [START_REF] Melekopoglou | On the complexity of the policy improvement algorithm for markov decision processes[END_REF] : the question of the existence of a strongly polynomial algorithm is thus wide open for this subproblem too and we believe that MAXPROB deserves attention on its own. Using Howard's policy iteration algorithm to solve the auxiliary problem, the primal-dual approach provides an alternative finite algorithm to solve SSP for non negative costs instances.

Theorem 16. When c ≥ 0, the primal-dual algorithm can be initialized with ȳ = 0 and if the MAXPROB subproblems are solved using Howard's Policy Iteration (or any other simple Policy Iteration method), then it terminates in a finite number of steps.

We are investigating the complexity of this extension of Dijkstra's algorithm to the SSP. Observe that we do not need to impose that c is non negative to apply the primal-dual approach. In fact, one can use the standard trick of adding an artificial constraint a x a ≤ M to the problem, with M "big" to find an initial dual solution and iterate the algorithm [START_REF] Papadimitriou | Combinatorial optimization: Algorithms and complexity[END_REF]. The structure of the subproblem changes but it can still be solved using the simplex method. This provides an alternative approach to Value Iteration and Policy Iteration in the general case too.

Fig. 1 .

 1 Fig. 1. A graphical representation of a SSP (with target state 0) : circles are states, squares are actions, dashed arrows indicate state transitions (probabilities) for a given action, and black edges represent actions available in a given state with corresponding cost.

  are the vertices that can reach u. When confusion may arise, we denote R + (u) by R + G (u) (and similarly for the other notations).We denote by 1 A the indicator function associated with a set A i.e. 1 A is a 0/1 function with 1 A (x) = 1 if and only if x ∈ A. For a vector x ∈ R d and I ⊆ {1, ..., d} we denote by x[I] the restriction of x to the indices in I and x(I) := i∈I x(i).

Lemma 4 .

 4 One can check in time O(|U | • (|U | + |V | + |E|)) whether a s-SSP instance with support graph G = (U, V, E) admits a proper policy or not.

  Then in time O(|U | + |V | + |E|), one can find a proper, deterministic and stationary policy Π.

  can implement such a procedure in time O(|U | + |V | + |E|) by computing N - k (0) for all k ≤ |U | + |V | and a 0-anti-arborescence A using a breadth first search algorithm : we then keep only the actions in A.

We focus here on discrete time (infinite) horizon problems.

If not we simply duplicate the actions.

lim sup is used here as the limit need not be defined in general.

note that it is not clear, a priori, that such a policy exists

We would like to stress on the fact that the LP relaxation we consider here is almost (except for the right hand side) the standard LP formulation of the problem of finding an optimal deterministic and stationary policy and it was already known for quite some time for many special cases of SSP (see[START_REF] Bertsekas | Stochastic shortest path problems under weak conditions[END_REF] for instance). However while in the MDP community, the LP formulation comes as a corollary of other results, here we reverse the approach and introduce this formulation as a natural relaxation of the problem and we derive the standard results as (reasonably) simple corollaries. This is what allows to simplify, generalize and unify many results from the litterature. This is a simple yet major contribution of this paper. The notation and terminology is taken from[START_REF] Hansen | Worst-case Analysis of Strategy Iteration and the Simplex Method[END_REF]

In order to prove this statement formally we shall prove that if J * (i) is real-valued for all i then there is no negative cost transition cycle : we can prove that when there exists a negative cost transition cycle, we can find one which is 'induced' by a (non proper) deterministic and stationary policy Π and that all vertices i on this cycle will have JΠ (i) = -∞ ; for this, we need to extend our decomposition result to decompose transition cycles into extreme rays ; we leave the details for the journal version of the paper, but the proof of Proposition 14 gives the flavor of this latter result.

We can assume without loss of generality that every vertex in Ga is in R -(s). If not, we change the set V by considering instead the vertices in Ga that do not have a path to s (and we iterate the procedure if V still does not satisfy the required property). Now it is clear that Ga contains at least one state s and one action Π(s ). Again not all actions in Ga are actions from Π because otherwise Π would not be proper.

A Appendix

Fig. 2. A deterministic shortest path (with target state 0) : the dark "actions" represent the current policy, and the dashed "actions" have non positive reduced cost ; changing all actions with non positive reduced cost yield a new policy which is not proper.

A.2 Proof of Lemma 1

Proof.

A.3 Proof of Theorem 13

We will prove that min

, for all i = 1, ..., n, by proving both inequalities.

≤ Let Π *

K be an optimal solution to min Π∈P K K k=0 c T x Π k computed by dynamic programming (as described above). Π * K is a proper policy for aux-SSP for all K. By feasibility of Π * K , we thus have

observe that this minimum is well defined since we are still satisfying Assumptions 1 in aux-SSP). By construction {V K (i), K ≥ 1} is non-increasing, hence because it is bounded from below, it converges and lim K→+∞ V K (i) is well-defined. Taking the limit we get lim K→+∞ c T K k=0 x

is chosen so that auxiliary actions can be assumed not to be used in an optimal policy in P aux . This is the case for M (i) ≥ V * (i).

≥ Let Π * be an optimal proper deterministic and stationary solution to min Π∈P lim K→+∞ K k=0 c T x Π k (Π * exists in our setting by Corollary 11). Let us denote by Π the policy of P aux that chooses the auxiliary action for each state. Consider the policy Π K of P K obtained from using Π * in periods 0, ..., K -1 and policy Π in period K. By feasibility of Π K , we have c T

. Now taking the limit as K tends to infinity, we have the result since lim K→+∞ x Π K K = lim K→+∞ x Π * K = 0 as Π K differs from Π * only in period K, and Π * is i-proper.

A.4 Proof of Proposition 14

Proof. We denote by y Π the dual solution associated with Π i.e. y Π = c Π (I -P Π ) -T . Assume for contradiction that Π is not proper. Let G Π be the support graph of this policy. Since Π is not proper, there exists a non empty set of states that are not in R -(0). It implies that there is a set of vertices V in G Π such that 0 S , 0 A ∈ V and δ + (V ) = ∅. Now there exists an action a of A > (Π) in V , otherwise vertices in V are not in R -(0) in G Π , a contradiction. Consider the graph G a obtained by taking the subgraph of G Π induced by the vertices in V that are reachable from a, by removing the edge between a and the unique state s with a ∈ A(s), and by adding an artificial state s 0 with a as its unique possible action. Let A a be the set of actions in G a .

We can associate a s 0 -SSP instance to G a by considering s as the target state. We can assume w.l.o.g. that Π is a s 0 -proper policy for this problem 8 . Now let x Π be the corresponding flux vector (in principle it is defined only on the actions in G a but we extend the flux on the other action by setting it to zero). We can interpret x Π as a (non zero) transition cycle of the original problem (the flux is defined on the same set of actions and x Π (a) = 1). The vector x Π ≥ 0 thus satisfies (J -P ) T x Π = 0. Now the reduced cost cΠ (a ) = c(a ) -c Π (I -P Π ) -T (J -P ) T 1 a ≤ 0 for all a ∈ A a by definition of Π and Π . Also, as already observed, cΠ (a) < 0. Let us analyze cx Π . We have cx

x Π (a ) but this is negative as x Π (a ) > 0, cΠ (a ) ≤ 0 for all a ∈ A a , and cΠ (a) < 0 . Therefore x Π is a negative cost transition cycle for our original instance, but this contradicts Assumption 1. c x Π -c x Π = c (x Π -x Π ) = (c Π + c Π (I -P Π ) -T (J -P ) T )(x Π -x Π ). But by feasibility (J -P ) T x Π = (J -P ) T x Π and thus c x Π -c x Π = cΠ (x Π -x Π ) = cΠ x Π (as cΠ = 0 for all a ∈ Π by definition of the current basis) . This latter term is negative as Π is using at least one action in A > (Π) and the actions in Π have reduced cost zero.