Python implementation of Yellin's Optimum Interval algorithm