The mixed integer linear programming formulation shown here matches Williams (2013). An alternative approach (not shown) formulates the model as a longest-path problem in a directed acyclic network, with node corresponding to folds after positions i and j and not between, and with arcs of the form .