Opened 3 years ago
Closed 3 years ago
#20361 closed defect (fixed)
PPL backend re-solves the problem every time get_variable_value or get_objective_value is called
Reported by: | mkoeppe | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.2 |
Component: | numerical | Keywords: | lp |
Cc: | dimpase, vdelecroix, jdemeyer | Merged in: | |
Authors: | Matthias Koeppe | Reviewers: | Dima Pasechnik |
Report Upstream: | N/A | Work issues: | |
Branch: | df42b5b (Commits) | Commit: | df42b5b74f30f1fca6a7c236c933c83b434f6f3e |
Dependencies: | Stopgaps: |
Description
The PPL backend sets up a new PPL problem and re-solves it from scratch every time that get_variable_value
or get_objective_value
is called.
sage: p = MixedIntegerLinearProgram(solver='ppl', maximization=True) sage: x = p.new_variable() sage: p.set_objective(p.sum((i+20)*x[i] for i in range(1000))) sage: p.add_constraint(p.sum((i+15)*x[i] for i in range(1000)), max=20000) sage: x.set_max(1) sage: p.solve() # takes a few seconds 11438750/507 sage: p.get_objective_value() # takes a few seconds, should be instant 11438750/507 sage: p.get_values(x) # takes forever, should be instant
Change History (5)
comment:1 Changed 3 years ago by
comment:2 Changed 3 years ago by
- Branch set to u/mkoeppe/ppl_backend_re_solves_the_problem_every_time_get_variable_value_or_get_objective_value_is_called
comment:3 Changed 3 years ago by
- Commit set to df42b5b74f30f1fca6a7c236c933c83b434f6f3e
- Status changed from new to needs_review
New commits:
df42b5b | Fix for #20361: PPL backend re-solves the problem every time get_variable_value or get_objective_value is called
|
comment:4 Changed 3 years ago by
- Reviewers set to Dima Pasechnik
- Status changed from needs_review to positive_review
Great!
comment:5 Changed 3 years ago by
- Branch changed from u/mkoeppe/ppl_backend_re_solves_the_problem_every_time_get_variable_value_or_get_objective_value_is_called to df42b5b74f30f1fca6a7c236c933c83b434f6f3e
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
oh, great catch, I was always wondering why get_values is so bloody slow with ppl...