First, we understand constraints that make the problem solvable.
Some are hard, like epipolar constraint.
Ordering isnt a hard constraint, but most useful when treated like one.
Some are soft, like pixel intensities are similar, disparities usually change slowly.
Then we find optimization method.
Which ones we can use depend on which constraints we pick.