How to identify logical contradiction in sorting conditions?
问题 I have a list of strings along with conditions that determine how they should be sorted. The conditions can be simplified to the form, X before Y or X after Y . However, one (or more) of the conditions contradict the rest. Given a bunch of such conditions, I need to determine which conditions contradict the most other conditions so that I can eliminate the fewest conditions necessary to make them consistent with each other. Once this is done, I will be able to reverse-engineer the original