Skip to content

[BUG] Update Objective computation #270

Description

@Iroy30

Describe the bug
The objective should evaluate to a non-nan value.

Steps/Code to reproduce bug

from cuopt.linear_programming import DataModel, Solve, SolverSettings
from cuopt_mps_parser import ParseMps
dm = ParseMps("Bug1.mps")
print("OBJECTIVE COEFFICIENTS: ", dm.get_objective_coefficients())
sol = Solve(dm)
print("PRIMAL SOLUTION: ", sol.get_primal_solution())
print("PRIMAL OBJECTIVE: ", sol.get_primal_objective())

MPS File: ObjectiveBug.mps.zip

Output:

OBJECTIVE COEFFICIENTS:  [1. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0.]
Solving a problem with 6 constraints 12 variables (0 integers) and 6 nonzeros
Objective offset 0.000000 scaling_factor 1.000000
Running concurrent

Dual simplex finished in 0.00 seconds
   Iter    Primal Obj.      Dual Obj.    Gap        Primal Res.  Dual Res.   Time
      0 +0.00000000e+00 +0.00000000e+00  0.00e+00   2.00e+00     2.45e+00   0.013s
PDLP finished
Concurrent time:  0.015s
Solved with dual simplex
Status: Optimal   Objective: -nan  Iterations: 6  Time: 0.015s
PRIMAL SOLUTION:  [ -0.   1.  -0.   1.   1.   1. -inf -inf -inf -inf -inf -inf]
PRIMAL OBJECTIVE:  nan

Expected behavior
Objective value should be 4.0 instead of nan

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions