Ask Your Question
1

best_known_objective_bound()

asked 2015-10-31 05:55:14 +0100

updated 2015-11-06 03:54:44 +0100

Hi,

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 http://doc.sagemath.org/html/en/refer...). 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

1.0

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
1

answered 2015-10-31 06:37:47 +0100

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

Comments

Yes :) you are right. Sorted :)

Many thanks

Aissan Dalvandi gravatar imageAissan Dalvandi ( 2015-10-31 09:04:11 +0100 )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

Stats

Asked: 2015-10-31 05:55:14 +0100

Seen: 413 times

Last updated: Nov 06 '15