Path finding and action planning for Fire Emblem-like games (large images beware)

You have to be careful with AI in general that you don’t make it always optimal, thats not very fun to play against in many cases. But having the optimal solution at your disposal is certainly useful.