Open mr-ma opened 5 years ago
We can see this happening for other programs such as tetris too. As mentioned in #24 this happens if there are cycles after resolving the ILP.
Example tetris: ILP started with ~11000 rows ILP is still not finished after running 400 times with now 11400 rows. Each iteration adds a found cycle as a constraint.
Ideas to speed up the solution:
Tried adding N cycles. Tetris finishes with N=1 immediately, likely indicating a bug in all_cycles.hpp
cycle detection. Manifest numbers are too low.
Added output to show the number of elements in a cycle using the current approach. Expected to see decreasing number of elements. However, number oscillates without decreasing. Will give the program a bit more time to see if it eventually finishes.
There is some progress, i.e., the number of elements in a detected cycle is decreasing. However, the decrease is very slow. 200 iterations (1110 elements), 300 iterations (1104 elements), 400 iterations (1102 elements).
Tetris:
Because in most cases only a single manifest is different we make a very small amount of progress. Enumerating all cycles is pointless (too many). Enumerating N cycles with all_cycles.hpp approach did not work and resulted in almost 0 coverage.
Ideas:
@mr-ma Thoughts?
I was able to speed up the result with idea 1. In fact, all_cycles.hpp probably works as expected.
The cycle does not work well with undo constraints. Of >400 manifests it selects a lot less after pruning the problem.txt file.
Same behavior is observable for susan, say, toast (all of which have cycles).
@dennisfischer how did you handle cycles in your thesis evaluations? If I remember correctly you used a conservative approach in which all cycles are recursively detected and subsequently eliminated. Can't we do the something similar here? I.e. recursively detecting all cycles before triggering the ILP optimization. Then, we feed all the detected cycles as constraints. Does that make sense?
@mr-ma I handled them exactly the same. In fact, have a look at the attached problem.txt. I've manually removed a lot of constraints, leaving us with cycles, dependency, nOf
. Removing nOf
produces expected results of selecting the maximum number of manifests at the cost of having hashes without asserts or asserts without hashes.
Problems started occurring after introducing the "n of m asserts" constraint (see #29 ) I see that this constraint is likely too strict. #29 proposes a solution
Right after the solution is found (which takes more than an hour), another calculation starts. I'm not sure if there is a problem in the generator script or ILP solver.cpp Any thoughts @dennisfischer ?