Calculate best retreat strategy