Skip to main content

Objective value does not equal X * obj

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Christian,

    it might be possible that you are missing the objective constant.

    double objcon = 0.0;
    error = GRBGetdblattr(model, "ObjCon", &objcon);
    for
    (i = 0; i < n_vars; i++) {    total_obj_by_hand += obj[i] * var_values[i]; }
    total_obj_by_hand += objcon;

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.