exactMatch function

Generate an exact matching set of subproblems.