Skip to content

[BUG] model updates don't persist #2171

Open

Description

@mlubin
from cuopt.linear_programming.data_model import DataModel
from cuopt.linear_programming.solver import Solve
from cuopt.linear_programming.solver_settings import SolverMethod, SolverSettings

dm = DataModel()
# min x + 2y, subject to x+y >= 3, 0 <= x <= 2, y free
dm.set_csr_constraint_matrix([1., 1.], [0, 1], [0, 2])
dm.set_objective_coefficients([1., 2.])
dm.set_variable_lower_bounds([0., -float("inf")])
dm.set_variable_upper_bounds([2., float("inf")])
dm.set_constraint_lower_bounds([3.])
dm.set_constraint_upper_bounds([float("inf")])

settings = SolverSettings()
settings.set_parameter("method", SolverMethod.Barrier)
settings.set_parameter("sequence_solve", True)
settings.set_parameter("log_to_console", False)

for rhs in (None, 6., None):
    if rhs is not None:
        dm.update_rhs([rhs])
    print(Solve(dm, settings).get_primal_objective())

yields:

initial Optimal 4.000000016254251
updated Optimal 10.00000009227848
repeated Optimal 4.000000016254251

I expected the third solve's objective to be 10; it's surprising that updates are dropped in subsequent solves.

Activity

  1. yuwenchen95 commented on Oct 19, 2026

    @yuwenchen95
    Contributor

    The issue looks like the support of range rows l <= Ax <=u is not covered by update_rhs at present.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions