Closed metanoid closed 4 years ago
Thanks for issue. This is really a v0.0.1 version of the project. Especially <=
constraints can be very slow at the moment. I'll have a look into this.
The problem with this problem is that each constraint individually doesn't constrain the objective much but the 3 day constraints combined limit it easily to 75. Have to check good methods to define better bounds. I'm self taught in this so this project is mostly trial and error. I appreciate that you tried the project and created this issue. Stay tuned 😊
Thanks for looking into it. I suspect part of the problem is that I've specified the issue in MILP style, not Constraint Programming style. I'll look into refactoring the problem definition to see if that reduces the solve time.
i.e it is easy for the current solver if you add the constraint:
@constraint(model, max_visits_total,
sum(days[h, a] for a in 1:3, h in 1:3) <= 5 * sum(inclusion)
)
Which just combines the days constraint such that the whole objective is on the left.
i.e it is easy for the current solver if you add the constraint:
@constraint(model, max_visits_total, sum(days[h, a] for a in 1:3, h in 1:3) <= 5 * sum(inclusion) )
Which just combines the days constraint such that the whole objective is on the left.
I don't think that's equivalent.
Consider trying to allocate the following value to the days
structure:
[9, 0, 0;
0, 2, 0;
0, 0, 2
]
For sum(inclusion)
= 3, the original formulation would reject this
allocation, but your new formulation would not reject it, since the sum
across all days
is less than 3*5 = 15
.
On Mon, Feb 17, 2020 at 3:52 PM Ole Kröger notifications@github.com wrote:
i.e it is easy for the current solver if you add the constraint:
@constraint(model, max_visits_total, sum(days[h, a] for a in 1:3, h in 1:3) <= 5 * sum(inclusion) )
Which just combines the days constraint such that the whole objective is on the left.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Wikunia/ConstraintSolver.jl/issues/83?email_source=notifications&email_token=ABZOZLA6VQJ6I7JV56YM4K3RDKJBHA5CNFSM4KVINUW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL6POFI#issuecomment-587003669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZOZLAXHD2FXN4OW3YQAQ3RDKJBHANCNFSM4KVINUWQ .
Sorry for the confusion. I didn't mean replacing the three constraints by one. I mean adding an additional constraint.
That PR is a possible fix for this. Will do some more testing before it gets merged.
Trying to construct an MWE for #82 , I ran into this. A small problem, which I imagine
ConstraintSolver
should be able to enumerate and solve in it's entirety (smaller than sudoku) seems to take very long and consume all my RAM.To reproduce:
Status: