Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPL backend re-solves the problem every time get_variable_value or get_objective_value is called #20361

Closed
mkoeppe opened this issue Apr 5, 2016 · 8 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 5, 2016

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

CC: @dimpase @videlec @jdemeyer

Component: numerical

Author: Matthias Koeppe

Branch/Commit: df42b5b

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/20361

@mkoeppe mkoeppe added this to the sage-7.2 milestone Apr 5, 2016
@dimpase
Copy link
Member

dimpase commented Apr 5, 2016

comment:1

oh, great catch, I was always wondering why get_values is so bloody slow with ppl...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 5, 2016

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 5, 2016

Commit: df42b5b

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 5, 2016

New commits:

df42b5bFix for #20361: PPL backend re-solves the problem every time get_variable_value or get_objective_value is called

@dimpase
Copy link
Member

dimpase commented Apr 5, 2016

Author: Matthias Koeppe

@dimpase
Copy link
Member

dimpase commented Apr 5, 2016

comment:4

Great!

@dimpase
Copy link
Member

dimpase commented Apr 5, 2016

Reviewer: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented Apr 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants