Ask Your Question


asked 2015-10-30 23:55:14 -0600

updated 2015-11-05 20:54:44 -0600


I am using sage Version 6.5, Release Date: 2015-02-17. I have MILP problem and trying to solve it. However, I defined time limit and used try and except to get the best_known_objective_bound(). Unfortunately, I am getting AttributeError: 'sage.numerical.backends.glpk_backend.GLPKBackend' object has no attribute 'best_known_objective_bound'

I even tried the following simple example (posted here However, I am facing the same issue for the example as well.

sage: g = graphs.CubeGraph(9)

sage: p = MixedIntegerLinearProgram(solver="GLPK")

sage: p.solver_parameter("mip_gap_tolerance",100)

sage: b = p.new_variable(binary=True)

sage: p.set_objective(p.sum(b[v] for v in g))

sage: for v in g:

....: p.add_constraint(b[v]+p.sum(b[u] for u in g.neighbors(v)) <= 1)

sage: p.add_constraint(b[v] == 1) # Force an easy non-0 solution

sage: p.solve() # rel tol 100


sage: backend = p.get_backend()

sage: backend.best_known_objective_bound() # random

AttributeError: 'sage.numerical.backends.glpk_backend.GLPKBackend' object has no attribute 'best_known_objective_bound'

What I want is to get the best known optimum answer by time limit. Anyone knows how should i get it?

Thanks a lot! Cheers, Aissan

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-31 00:37:47 -0600

fidbc gravatar image

This seems to be a feature that was added just recently.

Perhaps upgrading to sagemath v 6.9 will do the job.

edit flag offensive delete link more


Yes :) you are right. Sorted :)

Many thanks

Aissan Dalvandi gravatar imageAissan Dalvandi ( 2015-10-31 03:04:11 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-10-30 23:55:14 -0600

Seen: 82 times

Last updated: Nov 05 '15