Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <lp_decomposer.h>
Public Member Functions | |
LPDecomposer () | |
LPDecomposer (const LPDecomposer &)=delete | |
This type is neither copyable nor movable. | |
LPDecomposer & | operator= (const LPDecomposer &)=delete |
void | Decompose (const LinearProgram *linear_problem) ABSL_LOCKS_EXCLUDED(mutex_) |
int | GetNumberOfProblems () const ABSL_LOCKS_EXCLUDED(mutex_) |
Returns the number of independent problems generated by Decompose(). | |
const LinearProgram & | original_problem () const ABSL_LOCKS_EXCLUDED(mutex_) |
Returns the original problem, i.e. as it was before any decomposition. | |
void | ExtractLocalProblem (int problem_index, LinearProgram *lp) ABSL_LOCKS_EXCLUDED(mutex_) |
DenseRow | AggregateAssignments (absl::Span< const DenseRow > assignments) const ABSL_LOCKS_EXCLUDED(mutex_) |
DenseRow | ExtractLocalAssignment (int problem_index, const DenseRow &assignment) ABSL_LOCKS_EXCLUDED(mutex_) |
This class is used to decompose an existing LinearProgram into several independent LinearPrograms. Problems are independent when none of their variables are connected, i.e. appear in the same constraints. Consider for instance the following problem: min: x + 2 y + 3 z + 4 t + 5 u c1: 0 <= x + z <= 1; c2: 0 <= y + t <= 1; c3: 0 <= x + u <= 1; int: x, y, z, t, u Variables x, z and u are connected by constraints c1 and c3. Variables y and t are connected by constraints c2. The problem can be decomposed into two independent problems: min: x + 3 z + 5 u c1: 0 <= x + z <= 1; c3: 0 <= x + u <= 1; int: x, z, u and min: 2 y + 4 t c2: 0 <= y + t <= 1; int: y, t
Definition at line 52 of file lp_decomposer.h.
operations_research::glop::LPDecomposer::LPDecomposer | ( | ) |
Definition at line 37 of file lp_decomposer.cc.
|
delete |
This type is neither copyable nor movable.
DenseRow operations_research::glop::LPDecomposer::AggregateAssignments | ( | absl::Span< const DenseRow > | assignments | ) | const |
Returns an assignment to the original problem based on the assignments to the independent problems. Requires Decompose() to have been called.
Definition at line 144 of file lp_decomposer.cc.
void operations_research::glop::LPDecomposer::Decompose | ( | const LinearProgram * | linear_problem | ) |
Decomposes the problem into independent problems.
Iterate on all constraints, and merge all variables of each constraint.
Definition at line 40 of file lp_decomposer.cc.
DenseRow operations_research::glop::LPDecomposer::ExtractLocalAssignment | ( | int | problem_index, |
const DenseRow & | assignment ) |
Returns an assignment to the given subproblem based on the assignment to the original problem. Requires Decompose() to have been called.
Definition at line 162 of file lp_decomposer.cc.
void operations_research::glop::LPDecomposer::ExtractLocalProblem | ( | int | problem_index, |
LinearProgram * | lp ) |
Fills lp with the problem_index^th independent problem generated by Decompose().
Create variables and get all constraints of the cluster.
Create the constraints.
Definition at line 83 of file lp_decomposer.cc.
int operations_research::glop::LPDecomposer::GetNumberOfProblems | ( | ) | const |
Returns the number of independent problems generated by Decompose().
Definition at line 73 of file lp_decomposer.cc.
|
delete |
const LinearProgram & operations_research::glop::LPDecomposer::original_problem | ( | ) | const |
Returns the original problem, i.e. as it was before any decomposition.
Definition at line 78 of file lp_decomposer.cc.