# Is it possible to retrieve the optimal policy from the state value function?

One can easily retrieve the optimal policy from the action value function but how about obtaining it from the state value function?

• This seems to be a duplicate of this. – nbro Nov 7 '20 at 14:31

You can obtain the optimal policy from the optimal state value function if you also have the state transition and reward model for the environment $$p(s',r|s,a)$$ - the probability of receiving reward $$r$$ and arriving in state $$s'$$ when starting in state $$s$$ and taking action $$a$$.
$$\pi^*(s) = \text{argmax}_a [\sum_{s',r} p(s',r|s,a)(r + \gamma v^*(s'))]$$