Seol mar théacs é seo: Dynamic programming / Moshe Sniedovich.