Programming constraints is what you need. In distribution-based CPs, you alternate (a) making a decision at the current selection point in the search tree and (b) distributing the consequences of that decision as much as possible. It is clear that you do this by maintaining a domain D possible values ​​for each problem variable x in such a way that D(x) is a set of values ​​for x that are not yet excluded along the current search path. In your problem, you can reduce it to a large set of logical variables, x_ij , where x_ij is true if event i precedes event j . Initially, D(x) = {true, false} for all variables. The solution simply reduces the scope of the undefined variable (for a Boolean variable, this means that its domain is reduced to a single value, true or false, which coincides with the purpose). If at any point in the search path D(x) becomes empty for any x , you have reached a dead end and must retreat.
If you are smart, you will try to learn from each failure and backtrack as soon as you back up the search tree to avoid redundant searches (this is called backjumping - for example, if you find that the end you reached at level 7 was triggered by a selection, which you made at level 3, there is no point in retreating only to level 6, because there is no solution in this subtree, given the choice you made at level 3!).
Now, given that you have varying degrees of trust in your data, you really have an optimization problem. That is, you are not just looking for a solution that satisfies all the constraints that need to be true, but that also best satisfy the other soft constraints, depending on the degree of trust you have. What you need to do here is to solve an objective function that assigns an assessment to a specific set of satisfied / violated partial constraints. Then you want to shorten your search when you find that the current search path cannot improve the best solution found earlier.
If you decide to go for a logical approach, you can enjoy exploring SAT solvers that break these problems. But the first thing I would like to see is MiniZinc , a CP language that maps to many different modern constraint solvers.
Good luck
Cafe
source share