Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::DualSolution Struct Reference

#include <solution.h>

Public Member Functions

DualSolutionProto Proto () const
 Returns the proto equivalent of this.
 

Static Public Member Functions

static absl::StatusOr< DualSolutionFromProto (const ModelStorage *model, const DualSolutionProto &dual_solution_proto)
 

Public Attributes

LinearConstraintMap< double > dual_values
 
absl::flat_hash_map< QuadraticConstraint, double > quadratic_dual_values
 
VariableMap< double > reduced_costs
 
std::optional< double > objective_value
 
SolutionStatus feasibility_status = SolutionStatus::kUndetermined
 

Detailed Description

A solution to the dual of an optimization problem.

E.g. consider the primal dual pair linear program pair: (Primal) (Dual) min c * x max b * y s.t. A * x >= b s.t. y * A + r = c x >= 0 y, r >= 0. The dual solution is the pair (y, r). It is feasible if it satisfies the constraints from (Dual) above.

Below, y is dual_values, r is reduced_costs, and b * y is objective value.

Definition at line 134 of file solution.h.

Member Function Documentation

◆ FromProto()

absl::StatusOr< DualSolution > operations_research::math_opt::DualSolution::FromProto ( const ModelStorage * model,
const DualSolutionProto & dual_solution_proto )
static

Returns the DualSolution equivalent of dual_solution_proto.

Returns an error when any of:

  • VariableValuesFromProto(dual_solution_proto.reduced_costs) fails.
  • LinearConstraintValuesFromProto(dual_solution_proto.dual_values) fails.
  • dual_solution_proto.feasibility_status is not specified.

Definition at line 122 of file solution.cc.

◆ Proto()

DualSolutionProto operations_research::math_opt::DualSolution::Proto ( ) const

Returns the proto equivalent of this.

Definition at line 149 of file solution.cc.

Member Data Documentation

◆ dual_values

LinearConstraintMap<double> operations_research::math_opt::DualSolution::dual_values

Definition at line 147 of file solution.h.

◆ feasibility_status

SolutionStatus operations_research::math_opt::DualSolution::feasibility_status = SolutionStatus::kUndetermined

Definition at line 156 of file solution.h.

◆ objective_value

std::optional<double> operations_research::math_opt::DualSolution::objective_value

Definition at line 154 of file solution.h.

◆ quadratic_dual_values

absl::flat_hash_map<QuadraticConstraint, double> operations_research::math_opt::DualSolution::quadratic_dual_values
Note
Some solvers only return quadratic constraint duals when a solver-specific parameter is set (see go/mathopt-qcqp-dual#solver-specific).

Definition at line 152 of file solution.h.

◆ reduced_costs

VariableMap<double> operations_research::math_opt::DualSolution::reduced_costs

Definition at line 153 of file solution.h.


The documentation for this struct was generated from the following files: