Possible solution: reward with -1 for each NE state and 0 or 1 for the escaped state NE NE NE NE E t t+1 t+2 t+3 t+4 t+5 Rewards -1 -1 -1 -1 0 R t =-4 In general if it takes k steps to escape, the cumulative reward would be -k.
{}