 |
OR-Tools
8.1
|
Go to the documentation of this file.
28 std::cout <<
"Number of variables = " << linear_program.
num_variables() << std::endl;
29 std::cout <<
"Number of constraints = " << linear_program.
num_constraints() << std::endl;
33 parameters.set_provide_strong_optimal_guarantee(
true);
38 std::cout <<
"Optimal solution found !" << std::endl;
40 std::cout <<
"Optimal objective value = " << solver.
GetObjectiveValue() << std::endl;
43 std::cout <<
"Solution:" << std::endl
44 <<
"x = " << values[col_x] << std::endl
45 <<
", y = " << values[col_y] << std::endl;
52 int main(
int argc,
char** argv) {
RowIndex num_constraints() const
Fractional GetObjectiveValue() const
void SetConstraintBounds(RowIndex row, Fractional lower_bound, Fractional upper_bound)
void SetMaximizationProblem(bool maximize)
void SetVariableBounds(ColIndex col, Fractional lower_bound, Fractional upper_bound)
ColIndex FindOrCreateVariable(const std::string &variable_id)
void SetCoefficient(RowIndex row, ColIndex col, Fractional value)
const DenseRow & variable_values() const
ABSL_MUST_USE_RESULT ProblemStatus Solve(const LinearProgram &lp)
RowIndex FindOrCreateConstraint(const std::string &constraint_id)
void SetObjectiveCoefficient(ColIndex col, Fractional value)
ColIndex num_variables() const
void SetParameters(const GlopParameters ¶meters)
int main(int argc, char **argv)