Seol mar théacs é seo: Dynamic programming and graph algorithms in computer vision