Citing EAGO
Please cite the following paper when using EAGO.jl:
Wilhelm, M.E. and Stuber, M.D. EAGO.jl: easy advanced global optimization in Julia.
-Optimization Methods and Software. 37(2): 425-450 (2022). DOI: 10.1080/10556788.2020.1786566
Please cite the following paper when using EAGO.jl:
Wilhelm, M.E. and Stuber, M.D. EAGO.jl: easy advanced global optimization in Julia.
-Optimization Methods and Software. 37(2): 425-450 (2022). DOI: 10.1080/10556788.2020.1786566
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Please cite the following paper when using EAGO.jl:
Wilhelm, M.E. and Stuber, M.D. EAGO.jl: easy advanced global optimization in Julia.
+Optimization Methods and Software. 37(2): 425-450 (2022). DOI: 10.1080/10556788.2020.1786566
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This section contains general guidelines on how the functionality of EAGO can be extended for specific use cases. Many functions in EAGO are extensible, so examples are not provided for every possible case, but some important functions are covered. If there is a use case you do not see provided here, but would like to see, please contact Robert Gottlieb.
Extensibility in EAGO is based on the ExtensionType
. To create customized functions, the recommended method is to create a new structure, as follows:
using EAGO
+Customization · EAGO.jl Customization Guidelines
This section contains general guidelines on how the functionality of EAGO can be extended for specific use cases. Many functions in EAGO are extensible, so examples are not provided for every possible case, but some important functions are covered. If there is a use case you do not see provided here, but would like to see, please contact Robert Gottlieb.
1) Creating an Extension
Extensibility in EAGO is based on the ExtensionType
. To create customized functions, the recommended method is to create a new structure, as follows:
using EAGO
struct MyNewStruct <: EAGO.ExtensionType end
To let EAGO know that you would like to use this extension (and any functions you overload), when you create the JuMP model, declare your new type in the subsolver_block
field of the Optimizer
as follows:
using JuMP
@@ -31,4 +31,4 @@
x._result_status_code = MathOptInterface.FEASIBLE_POINT
end
return flag
-end
References
- Kelley, J. E. “The Cutting-Plane Method for Solving Convex Programs.” Journal of the Society for Industrial and Applied Mathematics, vol. 8, no. 4, pp. 703–12 (1960).
- Tawarmalani, M., Sahinidis, N. V. "Global optimization of mixed-integer nonlinear programs: A theoretical and computational study." Math. Program., Ser. A, 99, pp. 563-591 (2004).
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+end
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO._add_constraint_store_ci!
— Method_add_constraint_store_ci!(
+Functions · EAGO.jl Functions
EAGO._add_constraint_store_ci!
— Method_add_constraint_store_ci!(
d,
m::InputProblem,
_::Type{F},
_::Type{S}
)
-
Add a constraint to the local problem, storing the new constraint index and the associated index in the input problem.
sourceEAGO._add_constraint_store_ci_linear!
— Method_add_constraint_store_ci_linear!(d, ip::InputProblem)
-
Add linear constraints to the local problem, storing the new constraint indices and the associated indices in the input problem.
sourceEAGO._add_constraint_store_ci_quadratic!
— Method_add_constraint_store_ci_quadratic!(d, ip::InputProblem)
-
Add quadratic constraints to the local problem, storing the new constraint indices and the associated indices in the input problem.
sourceEAGO._bvi
— Method_bvi(m::GlobalOptimizer, i::Int64) -> Int64
-
Return the branch-to-sol mapping for the i'th variable.
sourceEAGO._constraint_primal
— Method_constraint_primal
Helper function which simplifies finding constraints of different types. See also: _constraints
sourceEAGO._constraints
— Method_constraints
Helper function which simplifies finding constraints of different types. See also: _constraint_primal
sourceEAGO._diam
— Method_diam(::BranchVar, ::GlobalOptimizer, ::Int)
-_diam(::FullVar, ::GlobalOptimizer, ::Int)
Return the diameter of a variable (upper bound - lower bound).
sourceEAGO._ext
— Method_ext(::Optimizer)
+
Add a constraint to the local problem, storing the new constraint index and the associated index in the input problem.
sourceEAGO._add_constraint_store_ci_linear!
— Method_add_constraint_store_ci_linear!(d, ip::InputProblem)
+
Add linear constraints to the local problem, storing the new constraint indices and the associated indices in the input problem.
sourceEAGO._add_constraint_store_ci_quadratic!
— Method_add_constraint_store_ci_quadratic!(d, ip::InputProblem)
+
Add quadratic constraints to the local problem, storing the new constraint indices and the associated indices in the input problem.
sourceEAGO._bvi
— Method_bvi(m::GlobalOptimizer, i::Int64) -> Int64
+
Return the branch-to-sol mapping for the i'th variable.
sourceEAGO._constraint_primal
— Method_constraint_primal
Helper function which simplifies finding constraints of different types. See also: _constraints
sourceEAGO._constraints
— Method_constraints
Helper function which simplifies finding constraints of different types. See also: _constraint_primal
sourceEAGO._diam
— Method_diam(::BranchVar, ::GlobalOptimizer, ::Int)
+_diam(::FullVar, ::GlobalOptimizer, ::Int)
Return the diameter of a variable (upper bound - lower bound).
sourceEAGO._ext
— Method_ext(::Optimizer)
_ext(::GlobalOptimizer)
-_ext(::SubSolvers)
Return the extension (<: ExtensionType
) from the SubSolvers
(sub)field or object.
sourceEAGO._extract_primal!
— Method_extract_primal!(d, m::InputProblem, _::Type{F}, _::Type{S})
-
Extract primal constraint value from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._extract_primal_linear!
— Method_extract_primal_linear!(d, ip::InputProblem)
-
Extract linear primal constraint values from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._extract_primal_quadratic!
— Method_extract_primal_quadratic!(d, ip::InputProblem)
-
Extract quadratic primal constraint values from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._is_branch_var
— Method_is_branch_var(m::GlobalOptimizer, i) -> Any
-
Check if m._branch_variables[i]
is true or false.
sourceEAGO._is_input_min
— Method_is_input_min(m::GlobalOptimizer) -> Bool
-
Check to see if the sense of the optimization problem is Min (true
) or Max (false
).
sourceEAGO._relaxed_optimizer
— Method_relaxed_optimizer(::GlobalOptimizer)
-_relaxed_optimizer(::SubSolvers)
Return the relaxed optimizer (<: MOI.AbstractOptimizer
) from the SubSolvers
field or object.
sourceEAGO._svi
— Method_svi(m::GlobalOptimizer, i::Int64) -> Int64
-
Return the sol-to-branch mapping for the i'th variable.
sourceEAGO._upper_optimizer
— Method_upper_optimizer(::GlobalOptimizer)
-_upper_optimizer(::SubSolvers)
Return the upper optimizer (<: MOI.AbstractOptimizer
) from the SubSolvers
field or object.
sourceEAGO.add_nonlinear!
— Methodadd_nonlinear!(m::GlobalOptimizer)
-
Add an Evaluator and nonlinear functions and populate each appropriately.
sourceEAGO.add_nonlinear_evaluator!
— Methodadd_nonlinear_evaluator!
Add an Evaluator structure if nonlinear terms are attached.
sourceEAGO.add_objective!
— Methodadd_objective!
Add objective function (if any) to the parsed problem.
sourceEAGO.affine_relax_quadratic!
— Methodaffine_relax_quadratic!
Default routine for relaxing quadratic constraint func < 0.0
on node n
. Takes affine bounds of convex part at point x0
and secant line bounds on concave parts.
sourceEAGO.aggressive_filtering!
— Methodaggressive_filtering!(
+_ext(::SubSolvers)
Return the extension (<: ExtensionType
) from the SubSolvers
(sub)field or object.
sourceEAGO._extract_primal!
— Method_extract_primal!(d, m::InputProblem, _::Type{F}, _::Type{S})
+
Extract primal constraint value from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._extract_primal_linear!
— Method_extract_primal_linear!(d, ip::InputProblem)
+
Extract linear primal constraint values from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._extract_primal_quadratic!
— Method_extract_primal_quadratic!(d, ip::InputProblem)
+
Extract quadratic primal constraint values from the local problem and save the result to the appropriate field of the optimizer.
sourceEAGO._is_branch_var
— Method_is_branch_var(m::GlobalOptimizer, i) -> Any
+
Check if m._branch_variables[i]
is true or false.
sourceEAGO._is_input_min
— Method_is_input_min(m::GlobalOptimizer) -> Bool
+
Check to see if the sense of the optimization problem is Min (true
) or Max (false
).
sourceEAGO._relaxed_optimizer
— Method_relaxed_optimizer(::GlobalOptimizer)
+_relaxed_optimizer(::SubSolvers)
Return the relaxed optimizer (<: MOI.AbstractOptimizer
) from the SubSolvers
field or object.
sourceEAGO._svi
— Method_svi(m::GlobalOptimizer, i::Int64) -> Int64
+
Return the sol-to-branch mapping for the i'th variable.
sourceEAGO._upper_optimizer
— Method_upper_optimizer(::GlobalOptimizer)
+_upper_optimizer(::SubSolvers)
Return the upper optimizer (<: MOI.AbstractOptimizer
) from the SubSolvers
field or object.
sourceEAGO.add_nonlinear!
— Methodadd_nonlinear!(m::GlobalOptimizer)
+
Add an Evaluator and nonlinear functions and populate each appropriately.
sourceEAGO.add_nonlinear_evaluator!
— Methodadd_nonlinear_evaluator!
Add an Evaluator structure if nonlinear terms are attached.
sourceEAGO.add_objective!
— Methodadd_objective!
Add objective function (if any) to the parsed problem.
sourceEAGO.affine_relax_quadratic!
— Methodaffine_relax_quadratic!
Default routine for relaxing quadratic constraint func < 0.0
on node n
. Takes affine bounds of convex part at point x0
and secant line bounds on concave parts.
sourceEAGO.aggressive_filtering!
— Methodaggressive_filtering!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
n::NodeBB
) -> Bool
-
Excludes OBBT on variable indices after a search in a filtering direction.
sourceEAGO.bool_indx_diff!
— Methodbool_indx_diff!(
+
Excludes OBBT on variable indices after a search in a filtering direction.
sourceEAGO.bool_indx_diff!
— Methodbool_indx_diff!(
z::Vector{Bool},
x::Vector{Bool},
y::Vector{Bool}
) -> Vector{Bool}
-
Utility function used to set vector of booleans z to x & ~y. Avoids the generation of conversion of the BitArray created by broadcasting logical operators.
sourceEAGO.bound_objective
— Methodbound_objective(::GlobalOptimizer, ::T)
-bound_objective(::ExtensionType, ::GlobalOptimizer)
Compute a tuple representing the lower and upper bounds for an objective function. Note: bound_objective(::GlobalOptimizer)
dispatches to bound_objective(::ExtensionType, ::GlobalOptimizer)
.
Options for T:
- AffineFunctionIneq
- BufferedNonlinearFunction
- BufferedQuadraticIneq
- MOI.VariableIndex
sourceEAGO.branch_node!
— Methodbranch_node!(t::ExtensionType, m::GlobalOptimizer)
-
Create two nodes from current_node
and store them on the stack. Call select_branch_variable(t, m)
and select_branch_point(t, m, k)
to determine the variable that should be branched on and the point at which branching should occur, respectively.
sourceEAGO.build_model
— Methodbuild_model
Create the model and variables used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command build_model(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, p::SIPProblem)
.
sourceEAGO.check_set_affine_nl!
— Methodcheck_set_affine_nl!(
+
Utility function used to set vector of booleans z to x & ~y. Avoids the generation of conversion of the BitArray created by broadcasting logical operators.
sourceEAGO.bound_objective
— Methodbound_objective(::GlobalOptimizer, ::T)
+bound_objective(::ExtensionType, ::GlobalOptimizer)
Compute a tuple representing the lower and upper bounds for an objective function. Note: bound_objective(::GlobalOptimizer)
dispatches to bound_objective(::ExtensionType, ::GlobalOptimizer)
.
Options for T:
- AffineFunctionIneq
- BufferedNonlinearFunction
- BufferedQuadraticIneq
- MOI.VariableIndex
sourceEAGO.branch_node!
— Methodbranch_node!(t::ExtensionType, m::GlobalOptimizer)
+
Create two nodes from current_node
and store them on the stack. Call select_branch_variable(t, m)
and select_branch_point(t, m, k)
to determine the variable that should be branched on and the point at which branching should occur, respectively.
sourceEAGO.build_model
— Methodbuild_model
Create the model and variables used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command build_model(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, p::SIPProblem)
.
sourceEAGO.check_set_affine_nl!
— Methodcheck_set_affine_nl!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
f::EAGO.BufferedNonlinearFunction{V, N, T<:RelaxTag},
finite_cut::Bool,
check_safe::Bool
) -> Bool
-
sourceEAGO.convergence_check
— Methodconvergence_check(
+
sourceEAGO.convergence_check
— Methodconvergence_check(
t::ExtensionType,
m::GlobalOptimizer
) -> Bool
-
Check for problem convergence.
By default, check if the lower and upper bounds have converged to within absolute and/or relative tolerances.
sourceEAGO.create_buffer_dict
— Methodcreate_buffer_dict(
+
Check for problem convergence.
By default, check if the lower and upper bounds have converged to within absolute and/or relative tolerances.
sourceEAGO.create_buffer_dict
— Methodcreate_buffer_dict(
func::MathOptInterface.ScalarQuadraticFunction{Float64}
) -> Dict{Int64, Float64}
-
Create a buffer dictionary from a ScalarQuadraticFunction.
sourceEAGO.cut
— Methodcut
Intersects the new set valued operator with the prior and performs affine bound tightening
- First forward pass:
post
should be set by user option, is_intersect
should be false so that the tape overwrites existing values, and the interval_intersect
flag could be set to either value. - Forward CP pass (assumes same reference point):
post
should be set by user option, is_intersect
should be true so that the tape intersects with existing values, and the interval_intersect
flag should be false. - Forward CP pass (assumes same reference point):
post
should be set by user option, is_intersect
should be true so that the tape intersects with existing values, and the interval_intersect
flag should be false. - Subsequent forward passes at new points: post
should be set by user option,
isintersectshould be true so that the tape intersects with existing values, and the
intervalintersectflag should be
true` as predetermined interval bounds are valid but the prior values may correspond to different points of evaluation.
sourceEAGO.cut_condition
— Methodcut_condition(t::ExtensionType, m::GlobalOptimizer) -> Bool
-
Returns true
if a cut should be added and computes a new reference point to add the cut at. By default, checks that cut_max_iterations
are not exceeded and that the improvement in the objective value associated with the previous cut is greater than both an absolute tolerance cut_ϵ_abs
and a relative tolerance cut_ϵ_rel
. Returns false
otherwise.
sourceEAGO.default_upper_heuristic
— Methoddefault_upper_heuristic(m::GlobalOptimizer) -> Bool
-
Default check to see if the upper bounding problem should be run. By default, The upper bounding problem is run on every node up to depth upper_bounding_depth
and is triggered with a probability of 0.5^(depth - upper_bounding_depth)
afterwards for continuous problems. For integral problems, the upper_bounding_depth
approach is used as well as running on every node up to depth upper_bounding_depth + cont_depth
with another trigger of probability 0.5^(depth - upper_bounding_depth - cont_depth)
.
sourceEAGO.diam
— MethodReturn the diameter of a variable (upper bound - lower bound).
sourceEAGO.eliminate_fixed_variables!
— Functioneliminate_fixed_variables!(::T, ::Vector{VariableInfo})
Eliminate fixed variables by rearrangment or restructuring of the AbstractEAGOConstraint
.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionEq
- AffineFunctionIneq
- BufferedQuadraticIneq
- BufferedNonlinearFunction{N,T} where {N, T<:RelaxTag}
- NonlinearExpression{V,N,T} where {V, N, T<:RelaxTag}
sourceEAGO.f_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a forward-pass of attribute t
.
sourceEAGO.fathom!
— Methodfathom!(t::ExtensionType, m::GlobalOptimizer)
-
Remove nodes from the stack. By default, delete nodes from the stack if their lower bounds are greater than the current global upper bound.
sourceEAGO.fbbt!
— Functionfbbt!(m::GlobalOptimizer, f::T)
Performs feasibility-based bound tightening on a back-end constraint and returns true
if it is feasible or false
if it is infeasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a expression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a parameter v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a subexpression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.get_sip_optimizer
— Methodget_sip_optimizer
Specifices the optimizer to be used in extension t::EAGO.ExtensionType
with algorithm alg::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command get_sip_optimizer(t::ExtensionType, alg::AbstractSIPAlgo, s::AbstractSubproblemType)
.
sourceEAGO.global_solve!
— Methodglobal_solve!(m::GlobalOptimizer)
-
Solves the branch-and-bound problem with the input EAGO.GlobalOptimizer
object.
Pseudocode description of the algorithm, as implemented here:
-I) Prepare optimizers and stack for branch-and-bound
-II) While no reason to terminate the algorithm has occurred:
–-II.A) Fathom nodes from the stack
–-II.B) Select the new "current node" from the stack
–-II.C) Perform preprocessing on current node
–-II.D) If preprocessing result is feasible:
––-II.D.1) Solve lower problem for current node
––-II.D.2) If lower problem result is feasible and lower/upper bounds have not converged:
–––-II.D.2.a) Solve upper problem for current node
–––-II.D.2.b) Update the global upper bound if necessary
–––-II.D.2.c) Perform postprocessing
–––-II.D.2.d) If postprocessing result is feasible:
––––-II.D.2.d.α) Branch and add the nodes back to the stack
–-II.E) Update the global lower bound if necessary
–-II.F) Update log information
-III) Set termination and result statuses
-IV) Print solution
sourceEAGO.initial_parse!
— Methodinitial_parse!(m::Optimizer{R, S, T})
-
Translate the input problem to the working problem. Any checks or optional manipulation are left to the presolve stage.
sourceEAGO.initialize!
— Methodinitialize!(_::AbstractCache, _::AbstractDirectedGraph)
-
Function used to initialize the storage cache d::AbstractCache
for a given type of directed acyclic graph g::AbstractDirectedGraph
.
sourceEAGO.initialize_stack!
— Methodinitialize_stack!(t::ExtensionType, m::GlobalOptimizer)
-
Prepare the stack for the branch-and-bound routine. By default, create an initial node with the variable bounds as box constraints and add it to the stack.
sourceEAGO.interval_bound
— Functioninterval_bound(::GlobalOptimizer, ::T)
Compute a tuple representing the lower and upper interval bounds for an AbstractEAGOConstraint
representing an equality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionEq
- AffineFunctionIneq
- BufferedQuadraticEq
- BufferedQuadraticIneq
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.interval_objective_bound!
— Functionsource EAGO.is_feasible
— Methodis_feasible(::GlobalOptimizer, ::T)
Check if a given bound is feasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
- BufferedQuadraticIneq
- BufferedQuadraticEq
- BufferedNonlinearFunction{V,N,T}
sourceEAGO.is_integer_feasible_local
— Methodis_integer_feasible_local(m::GlobalOptimizer, d) -> Bool
-
Checks that the solution of a local solve is integer feasible to within the tolerances specified by integer_abs_tol
and integer_rel_tol
.
sourceEAGO.is_integer_feasible_relaxed
— Methodis_integer_feasible_relaxed(m::GlobalOptimizer) -> Bool
-
Check that the solution of the lower (relaxed problem) is integer feasible to within tolerances specified by the parameters: integer_abs_tol
(absolute tolerance) and integer_rel_tol
(relative tolerance).
sourceEAGO.is_integer_subproblem
— Methodis_integer_subproblem(m)
-
Returns true
that the subproblem at the current node n
has participating integer variables that have not been fixed to constant valued as the branch-and-bound algorithm progresses. Returns false
otherwise.
sourceEAGO.is_safe_cut!
— Methodis_safe_cut!(
+
Create a buffer dictionary from a ScalarQuadraticFunction.
sourceEAGO.cut
— Methodcut
Intersects the new set valued operator with the prior and performs affine bound tightening
- First forward pass:
post
should be set by user option, is_intersect
should be false so that the tape overwrites existing values, and the interval_intersect
flag could be set to either value. - Forward CP pass (assumes same reference point):
post
should be set by user option, is_intersect
should be true so that the tape intersects with existing values, and the interval_intersect
flag should be false. - Forward CP pass (assumes same reference point):
post
should be set by user option, is_intersect
should be true so that the tape intersects with existing values, and the interval_intersect
flag should be false. - Subsequent forward passes at new points: post
should be set by user option,
isintersectshould be true so that the tape intersects with existing values, and the
intervalintersectflag should be
true` as predetermined interval bounds are valid but the prior values may correspond to different points of evaluation.
sourceEAGO.cut_condition
— Methodcut_condition(t::ExtensionType, m::GlobalOptimizer) -> Bool
+
Returns true
if a cut should be added and computes a new reference point to add the cut at. By default, checks that cut_max_iterations
are not exceeded and that the improvement in the objective value associated with the previous cut is greater than both an absolute tolerance cut_ϵ_abs
and a relative tolerance cut_ϵ_rel
. Returns false
otherwise.
sourceEAGO.default_upper_heuristic
— Methoddefault_upper_heuristic(m::GlobalOptimizer) -> Bool
+
Default check to see if the upper bounding problem should be run. By default, The upper bounding problem is run on every node up to depth upper_bounding_depth
and is triggered with a probability of 0.5^(depth - upper_bounding_depth)
afterwards for continuous problems. For integral problems, the upper_bounding_depth
approach is used as well as running on every node up to depth upper_bounding_depth + cont_depth
with another trigger of probability 0.5^(depth - upper_bounding_depth - cont_depth)
.
sourceEAGO.diam
— MethodReturn the diameter of a variable (upper bound - lower bound).
sourceEAGO.eliminate_fixed_variables!
— Functioneliminate_fixed_variables!(::T, ::Vector{VariableInfo})
Eliminate fixed variables by rearrangment or restructuring of the AbstractEAGOConstraint
.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionEq
- AffineFunctionIneq
- BufferedQuadraticIneq
- BufferedNonlinearFunction{N,T} where {N, T<:RelaxTag}
- NonlinearExpression{V,N,T} where {V, N, T<:RelaxTag}
sourceEAGO.f_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a forward-pass of attribute t
.
sourceEAGO.fathom!
— Methodfathom!(t::ExtensionType, m::GlobalOptimizer)
+
Remove nodes from the stack. By default, delete nodes from the stack if their lower bounds are greater than the current global upper bound.
sourceEAGO.fbbt!
— Functionfbbt!(m::GlobalOptimizer, f::T)
Performs feasibility-based bound tightening on a back-end constraint and returns true
if it is feasible or false
if it is infeasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a expression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a parameter v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a subexpression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.get_sip_optimizer
— Methodget_sip_optimizer
Specifices the optimizer to be used in extension t::EAGO.ExtensionType
with algorithm alg::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command get_sip_optimizer(t::ExtensionType, alg::AbstractSIPAlgo, s::AbstractSubproblemType)
.
sourceEAGO.global_solve!
— Methodglobal_solve!(m::GlobalOptimizer)
+
Solves the branch-and-bound problem with the input EAGO.GlobalOptimizer
object.
Pseudocode description of the algorithm, as implemented here:
-I) Prepare optimizers and stack for branch-and-bound
-II) While no reason to terminate the algorithm has occurred:
–-II.A) Fathom nodes from the stack
–-II.B) Select the new "current node" from the stack
–-II.C) Perform preprocessing on current node
–-II.D) If preprocessing result is feasible:
––-II.D.1) Solve lower problem for current node
––-II.D.2) If lower problem result is feasible and lower/upper bounds have not converged:
–––-II.D.2.a) Solve upper problem for current node
–––-II.D.2.b) Update the global upper bound if necessary
–––-II.D.2.c) Perform postprocessing
–––-II.D.2.d) If postprocessing result is feasible:
––––-II.D.2.d.α) Branch and add the nodes back to the stack
–-II.E) Update the global lower bound if necessary
–-II.F) Update log information
-III) Set termination and result statuses
-IV) Print solution
sourceEAGO.initial_parse!
— Methodinitial_parse!(m::Optimizer{R, S, T})
+
Translate the input problem to the working problem. Any checks or optional manipulation are left to the presolve stage.
sourceEAGO.initialize!
— Methodinitialize!(_::AbstractCache, _::AbstractDirectedGraph)
+
Function used to initialize the storage cache d::AbstractCache
for a given type of directed acyclic graph g::AbstractDirectedGraph
.
sourceEAGO.initialize_stack!
— Methodinitialize_stack!(t::ExtensionType, m::GlobalOptimizer)
+
Prepare the stack for the branch-and-bound routine. By default, create an initial node with the variable bounds as box constraints and add it to the stack.
sourceEAGO.interval_bound
— Functioninterval_bound(::GlobalOptimizer, ::T)
Compute a tuple representing the lower and upper interval bounds for an AbstractEAGOConstraint
representing an equality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionEq
- AffineFunctionIneq
- BufferedQuadraticEq
- BufferedQuadraticIneq
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.interval_objective_bound!
— Functionsource EAGO.is_feasible
— Methodis_feasible(::GlobalOptimizer, ::T)
Check if a given bound is feasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
- BufferedQuadraticIneq
- BufferedQuadraticEq
- BufferedNonlinearFunction{V,N,T}
sourceEAGO.is_integer_feasible_local
— Methodis_integer_feasible_local(m::GlobalOptimizer, d) -> Bool
+
Checks that the solution of a local solve is integer feasible to within the tolerances specified by integer_abs_tol
and integer_rel_tol
.
sourceEAGO.is_integer_feasible_relaxed
— Methodis_integer_feasible_relaxed(m::GlobalOptimizer) -> Bool
+
Check that the solution of the lower (relaxed problem) is integer feasible to within tolerances specified by the parameters: integer_abs_tol
(absolute tolerance) and integer_rel_tol
(relative tolerance).
sourceEAGO.is_integer_subproblem
— Methodis_integer_subproblem(m)
+
Returns true
that the subproblem at the current node n
has participating integer variables that have not been fixed to constant valued as the branch-and-bound algorithm progresses. Returns false
otherwise.
sourceEAGO.is_safe_cut!
— Methodis_safe_cut!(
m::GlobalOptimizer,
f::MathOptInterface.ScalarAffineFunction{Float64}
) -> Bool
-
Applies the safe cut checks detailed in Khajavirad, 2018 [Khajavirad, Aida, and Nikolaos V. Sahinidis. "A hybrid LP/NLP paradigm for global optimization relaxations." Mathematical Programming Computation 10.3 (2018): 383-421] to ensure that only numerically safe affine relaxations are added. Checks that:
|b| <= safe b
, safe_l <= abs(ai) <= safe u
, and safe_l <= abs(ai/aj) <= safe_u
.
sourceEAGO.label_branch_variables!
— Methodlabel_branch_variables!(m::GlobalOptimizer)
-
Detect any variables participating in nonconvex terms and populate the _branch_variables
storage array.
sourceEAGO.label_fixed_variables!
— Methodlabel_fixed_variables!(m::GlobalOptimizer) -> Vector{Bool}
-
Detect any variables set to a fixed value by equality or inequality constraints and populate the _fixed_variable
storage array.
sourceEAGO.load_fbbt_buffer!
— Methodload_fbbt_buffer!(m::GlobalOptimizer)
-
sourceEAGO.load_relaxed_problem!
— Methodload_relaxed_problem!(
+
Applies the safe cut checks detailed in Khajavirad, 2018 [Khajavirad, Aida, and Nikolaos V. Sahinidis. "A hybrid LP/NLP paradigm for global optimization relaxations." Mathematical Programming Computation 10.3 (2018): 383-421] to ensure that only numerically safe affine relaxations are added. Checks that:
|b| <= safe b
, safe_l <= abs(ai) <= safe u
, and safe_l <= abs(ai/aj) <= safe_u
.
sourceEAGO.label_branch_variables!
— Methodlabel_branch_variables!(m::GlobalOptimizer)
+
Detect any variables participating in nonconvex terms and populate the _branch_variables
storage array.
sourceEAGO.label_fixed_variables!
— Methodlabel_fixed_variables!(m::GlobalOptimizer) -> Vector{Bool}
+
Detect any variables set to a fixed value by equality or inequality constraints and populate the _fixed_variable
storage array.
sourceEAGO.load_fbbt_buffer!
— Methodload_fbbt_buffer!(m::GlobalOptimizer)
+
sourceEAGO.load_relaxed_problem!
— Methodload_relaxed_problem!(
m::GlobalOptimizer{R, S, Q<:ExtensionType}
)
-
Load variables, linear constraints, and empty storage space for the first NLP and quadratic cut into the relaxed optimizer.
sourceEAGO.local_problem_status
— Methodlocal_problem_status(t, r)
-
Takes an MOI.TerminationStatusCode
and a MOI.ResultStatusCode
and returns true
if this corresponds to a solution that is proven to be feasible. Returns false
otherwise.
sourceEAGO.log_iteration!
— Methodlog_iteration!(m::GlobalOptimizer)
-
If log_on
is true, the global_lower_bound
, global_upper_bound
, run_time
, and node_count
are stored every log_interval
. If log_subproblem_info
then the lower bound, feasibility and run times of the subproblems are logged every log_interval
.
sourceEAGO.lower_interval_bound
— Functionlower_interval_bound(::GlobalOptimizer, ::T)
Compute the lower interval bound for an AbstractEAGOConstraint
representing an inequality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- BufferedQuadraticIneq
- BufferedSOC
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.lower_problem!
— Methodlower_problem!(
+
Load variables, linear constraints, and empty storage space for the first NLP and quadratic cut into the relaxed optimizer.
sourceEAGO.local_problem_status
— Methodlocal_problem_status(t, r)
+
Takes an MOI.TerminationStatusCode
and a MOI.ResultStatusCode
and returns true
if this corresponds to a solution that is proven to be feasible. Returns false
otherwise.
sourceEAGO.log_iteration!
— Methodlog_iteration!(m::GlobalOptimizer)
+
If log_on
is true, the global_lower_bound
, global_upper_bound
, run_time
, and node_count
are stored every log_interval
. If log_subproblem_info
then the lower bound, feasibility and run times of the subproblems are logged every log_interval
.
sourceEAGO.lower_interval_bound
— Functionlower_interval_bound(::GlobalOptimizer, ::T)
Compute the lower interval bound for an AbstractEAGOConstraint
representing an inequality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- BufferedQuadraticIneq
- BufferedSOC
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.lower_problem!
— Methodlower_problem!(
t::ExtensionType,
m::GlobalOptimizer{R, S, Q<:ExtensionType}
)
-
Constructs a relaxation of the MINLP on node y
and solves it using the default EAGO relaxation scheme. By default, EAGO applies Kelley's algorithm (from Kelley Jr., J.E.: The cutting-plane method for solving convex programs. J. Soc. Ind. Appl. Math. 8(4), 703 to 712 (1960)) while cut_condition(m)
returns true
then activates the integrality constraints of the relaxed problems and solves the resulting MILP relaxation. results are stored to the _lower_solution
, _lower_termination_status
, _lower_primal_status
, _lower_dual_status
, _lower_objective_value
, and _lower_feasibility
. Further, lower and upper variable duals are stored _lower_lvd
and _lower_uvd
, respectively, for use in duality based bound tightening. If relaxation-based bounds are weaker or cutting-planes are numerically poorly ill-posed, then interval bounds are used instead. If the problem is dual feasible but the primal status is ambiguous the dual objective value is used for the lower bound to avoid numerical issues.
sourceEAGO.mc_type
— Methodmc_type(::RelaxCache{V, N, T} where {V, N, T<:RelaxTag}
+
Constructs a relaxation of the MINLP on node y
and solves it using the default EAGO relaxation scheme. By default, EAGO applies Kelley's algorithm (from Kelley Jr., J.E.: The cutting-plane method for solving convex programs. J. Soc. Ind. Appl. Math. 8(4), 703 to 712 (1960)) while cut_condition(m)
returns true
then activates the integrality constraints of the relaxed problems and solves the resulting MILP relaxation. results are stored to the _lower_solution
, _lower_termination_status
, _lower_primal_status
, _lower_dual_status
, _lower_objective_value
, and _lower_feasibility
. Further, lower and upper variable duals are stored _lower_lvd
and _lower_uvd
, respectively, for use in duality based bound tightening. If relaxation-based bounds are weaker or cutting-planes are numerically poorly ill-posed, then interval bounds are used instead. If the problem is dual feasible but the primal status is ambiguous the dual objective value is used for the lower bound to avoid numerical issues.
sourceEAGO.mc_type
— Methodmc_type(::RelaxCache{V, N, T} where {V, N, T<:RelaxTag}
mc_type(::NonlinearExpression{V, N, T} where {V, N, T<:RelaxTag}
-mc_type(::BufferedNonlinearFunction{V, N, T} where {V, N, T<:RelaxTag}
Returns a McCormick structure of type MC{N, T<:RelaxTag}
.
sourceEAGO.mid
— MethodReturn the midpoint of a variable (0.5*(upper bound + lower bound)).
sourceEAGO.node_selection!
— Methodnode_selection!(t::ExtensionType, m::GlobalOptimizer)
-
Select the next node in the stack to evaluate. By default, perform best-first node selection (select the node with the lowest lower bound in the stack).
sourceEAGO.obbt!
— Methodobbt!(m::GlobalOptimizer{R, S, Q<:ExtensionType}) -> Bool
-
Performs OBBT with filtering and greedy ordering as detailed in: Gleixner, A.M., Berthold, T., Müller, B. et al. J Glob Optim (2017) 67: 731. https://doi.org/10.1007/s10898-016-0450-4
sourceEAGO.objective_cut!
— Methodobjective_cut!
Add linear objective cut constraint to the m._subsolvers.relaxed_optimizer
.
sourceEAGO.optimize_hook!
— Methodoptimize_hook!(t::ExtensionType, m::Optimizer)
Provide a hook for extensions to EAGO.
The user-defined extension of optimize_hook!
is used in EAGO's overloading of MOI.optimize!
(see EAGO.jl/src/eago_optimizer/optimize/optimize.jl
). Without the optimize_hook!
specified, EAGO will run initial_parse!
, parse_classify_problem!
, and then optimize!
using the parsed problem type. The user-specified optimize_hook!
should thus take the new extension and Optimizer
as inputs and will execute when the user writes optimize!(model)
.
Example
Here, optimize_hook!
is used to bypass EAGO's problem parsing and treat every problem using its branch-and-bound routine. This is done in this example by telling EAGO to treat the problem as a mixed integer nonconvex problem, which normally dispatches to branch-and-bound.
struct MyNewExtension <: EAGO.ExtensionType end
+mc_type(::BufferedNonlinearFunction{V, N, T} where {V, N, T<:RelaxTag}
Returns a McCormick structure of type MC{N, T<:RelaxTag}
.
sourceEAGO.mid
— MethodReturn the midpoint of a variable (0.5*(upper bound + lower bound)).
sourceEAGO.node_selection!
— Methodnode_selection!(t::ExtensionType, m::GlobalOptimizer)
+
Select the next node in the stack to evaluate. By default, perform best-first node selection (select the node with the lowest lower bound in the stack).
sourceEAGO.obbt!
— Methodobbt!(m::GlobalOptimizer{R, S, Q<:ExtensionType}) -> Bool
+
Performs OBBT with filtering and greedy ordering as detailed in: Gleixner, A.M., Berthold, T., Müller, B. et al. J Glob Optim (2017) 67: 731. https://doi.org/10.1007/s10898-016-0450-4
sourceEAGO.objective_cut!
— Methodobjective_cut!
Add linear objective cut constraint to the m._subsolvers.relaxed_optimizer
.
sourceEAGO.optimize_hook!
— Methodoptimize_hook!(t::ExtensionType, m::Optimizer)
Provide a hook for extensions to EAGO.
The user-defined extension of optimize_hook!
is used in EAGO's overloading of MOI.optimize!
(see EAGO.jl/src/eago_optimizer/optimize/optimize.jl
). Without the optimize_hook!
specified, EAGO will run initial_parse!
, parse_classify_problem!
, and then optimize!
using the parsed problem type. The user-specified optimize_hook!
should thus take the new extension and Optimizer
as inputs and will execute when the user writes optimize!(model)
.
Example
Here, optimize_hook!
is used to bypass EAGO's problem parsing and treat every problem using its branch-and-bound routine. This is done in this example by telling EAGO to treat the problem as a mixed integer nonconvex problem, which normally dispatches to branch-and-bound.
struct MyNewExtension <: EAGO.ExtensionType end
import EAGO: optimize_hook!
function EAGO.optimize_hook!(t::MyNewExtension, m::Optimizer)
initial_parse!(m)
optimize!(EAGO.MINCVX(), m)
-end
The same functionality could be accomplished by setting the EAGOParameter
field force_global_solve
to be true.
sourceEAGO.parse_classify_problem!
— Methodparse_classify_problem!(m::GlobalOptimizer)
Interprets the type/number of constraints and the type of objective function to infer a problem type. Current possible types include:
LP
: Linear program; sent to optimize_lp.jl
- 'MILP
: Mixed integer linear program; sent to
optimize_lp.jl` SOCP
: Second-order cone program; sent to optimize_conic.jl
MINCVX
: Mixed-integer nonconvex; sent to optimize_nonconvex.jl
If the force_global_solve
parameter is set to true
, parse_classify_problem!
will set the problem type to MINCVX
to pass the problem to optimize_nonconvex.jl
.
sourceEAGO.parse_global!
— MethodBasic parsing for global solutions (no extensive manipulation). By default, does nothing.
sourceEAGO.postprocess!
— Methodpostprocess!(t::ExtensionType, m::GlobalOptimizer)
-
Default postprocess perfoms duality-based bound tightening (Tawarmalani, M., Sahinidis, N.V.: Global optimization of mixed-integer nonlinear programs: a theoretical and computational study. Math. Progr. 99, 563–591 (2004).) up to an iteration limit set by dbbt_depth
.
sourceEAGO.preprocess!
— Methodpreprocess!(
+end
The same functionality could be accomplished by setting the EAGOParameter
field force_global_solve
to be true.
sourceEAGO.parse_classify_problem!
— Methodparse_classify_problem!(m::GlobalOptimizer)
Interprets the type/number of constraints and the type of objective function to infer a problem type. Current possible types include:
LP
: Linear program; sent to optimize_lp.jl
- 'MILP
: Mixed integer linear program; sent to
optimize_lp.jl` SOCP
: Second-order cone program; sent to optimize_conic.jl
MINCVX
: Mixed-integer nonconvex; sent to optimize_nonconvex.jl
If the force_global_solve
parameter is set to true
, parse_classify_problem!
will set the problem type to MINCVX
to pass the problem to optimize_nonconvex.jl
.
sourceEAGO.parse_global!
— MethodBasic parsing for global solutions (no extensive manipulation). By default, does nothing.
sourceEAGO.postprocess!
— Methodpostprocess!(t::ExtensionType, m::GlobalOptimizer)
+
Default postprocess perfoms duality-based bound tightening (Tawarmalani, M., Sahinidis, N.V.: Global optimization of mixed-integer nonlinear programs: a theoretical and computational study. Math. Progr. 99, 563–591 (2004).) up to an iteration limit set by dbbt_depth
.
sourceEAGO.preprocess!
— Methodpreprocess!(
t::ExtensionType,
m::GlobalOptimizer{R, S, Q<:ExtensionType}
)
-
Runs contractor methods prior to solving lower bounding problem. By default linear and quadratic contractor methods followed by interval constraint propagation then optimization-based bound tightening for a specified number of iterations while the subproblem at current node n
has not been proven infeasible.
sourceEAGO.presolve_global!
— Methodpresolve_global!(t::ExtensionType, m::GlobalOptimizer)
-
Perform any necessary work prior to running branch-and-bound.
- Set subsolver configs using values in
EAGOParameters
; - Load variables, linear constraints, and empty storage space into the relaxed optimizer;
- Prepare the stack for the start of branch-and-bound;
- Fill fields of the
GlobalOptimizer
with zeros of the proper dimensions; - Pass necessary flags from the
GlobalOptimizer
to the working problem.
sourceEAGO.print_iteration!
— Methodprint_iteration!
Print status information based on iteration count. The header print frequency is based on the header_iterations
setting, and the data print frequency is based on the output_iterations
setting.
sourceEAGO.print_node!
— Methodprint_node!
Print information about the current node. Includes node ID, lower bound, upper bound, and interval box.
sourceEAGO.print_preamble!
— Methodprint_preamble!
Print noteworthy information prior to running branch-and-bound. Currently prints a note about flipping max(f)
to -min(-f)
internally, if a maximization problem is inputted and verbosity>=3
.
sourceEAGO.print_results!
— Methodprint_results!(m::GlobalOptimizer, lower_flag::Bool)
-
Print the results of a single (lower or upper) bounding problem. lower_flag=true
prints information for the lower problem, lower_flag=false
prints information for the upper problem.
sourceEAGO.print_solution!
— Methodprint_solution!
Print solution information for the B&B problem. Display node with the best solution, solution value, solution, and time spent solving subproblems. This print occurs following termination of the B&B algorithm.
sourceEAGO.r_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a reverse-pass of attribute t
.
sourceEAGO.reform_epigraph_min!
— Methodreform_epigraph_min!(m::GlobalOptimizer)
-
Perform an epigraph reformulation assuming the working_problem is a minimization problem.
sourceEAGO.register_eago_operators!
— Methodregistereagooperators!
Registers all nonstandard nonlinear terms available in EAGO in a JuMP. Uses of these is generally preferable in EAGO as the relaxations EAGO will generate will usually be tighter (speeding up convergence time). Note that this will work can be used by other nonlinear solvers (Ipopt for instance).
sourceEAGO.rel_diam
— Methodrel_diam(m::GlobalOptimizer, i::Int64) -> Float64
-
Return the relative diameter of a variable. In the case of diam(X)=Inf, rel_diam
returns 0.0 to prevent "branching" on this variable endlessly.
sourceEAGO.relax!
— Methodrelax!(
+
Runs contractor methods prior to solving lower bounding problem. By default linear and quadratic contractor methods followed by interval constraint propagation then optimization-based bound tightening for a specified number of iterations while the subproblem at current node n
has not been proven infeasible.
sourceEAGO.presolve_global!
— Methodpresolve_global!(t::ExtensionType, m::GlobalOptimizer)
+
Perform any necessary work prior to running branch-and-bound.
- Set subsolver configs using values in
EAGOParameters
; - Load variables, linear constraints, and empty storage space into the relaxed optimizer;
- Prepare the stack for the start of branch-and-bound;
- Fill fields of the
GlobalOptimizer
with zeros of the proper dimensions; - Pass necessary flags from the
GlobalOptimizer
to the working problem.
sourceEAGO.print_iteration!
— Methodprint_iteration!
Print status information based on iteration count. The header print frequency is based on the header_iterations
setting, and the data print frequency is based on the output_iterations
setting.
sourceEAGO.print_node!
— Methodprint_node!
Print information about the current node. Includes node ID, lower bound, upper bound, and interval box.
sourceEAGO.print_preamble!
— Methodprint_preamble!
Print noteworthy information prior to running branch-and-bound. Currently prints a note about flipping max(f)
to -min(-f)
internally, if a maximization problem is inputted and verbosity>=3
.
sourceEAGO.print_results!
— Methodprint_results!(m::GlobalOptimizer, lower_flag::Bool)
+
Print the results of a single (lower or upper) bounding problem. lower_flag=true
prints information for the lower problem, lower_flag=false
prints information for the upper problem.
sourceEAGO.print_solution!
— Methodprint_solution!
Print solution information for the B&B problem. Display node with the best solution, solution value, solution, and time spent solving subproblems. This print occurs following termination of the B&B algorithm.
sourceEAGO.r_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a reverse-pass of attribute t
.
sourceEAGO.reform_epigraph_min!
— Methodreform_epigraph_min!(m::GlobalOptimizer)
+
Perform an epigraph reformulation assuming the working_problem is a minimization problem.
sourceEAGO.register_eago_operators!
— Methodregistereagooperators!
Registers all nonstandard nonlinear terms available in EAGO in a JuMP. Uses of these is generally preferable in EAGO as the relaxations EAGO will generate will usually be tighter (speeding up convergence time). Note that this will work can be used by other nonlinear solvers (Ipopt for instance).
sourceEAGO.rel_diam
— Methodrel_diam(m::GlobalOptimizer, i::Int64) -> Float64
+
Return the relative diameter of a variable. In the case of diam(X)=Inf, rel_diam
returns 0.0 to prevent "branching" on this variable endlessly.
sourceEAGO.relax!
— Methodrelax!(
m::GlobalOptimizer,
f::EAGO.BufferedQuadraticEq,
i::Int64,
check_safe::Bool
) -> Bool
-
sourceEAGO.relax!
— Methodrelax!(
+
sourceEAGO.relax!
— Methodrelax!(
m::GlobalOptimizer,
f::EAGO.BufferedQuadraticIneq,
k::Int64,
check_safe::Bool
) -> Bool
-
sourceEAGO.relax!
— Methodrelax!(
+
sourceEAGO.relax!
— Methodrelax!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
f::EAGO.BufferedNonlinearFunction{V, N, T<:RelaxTag},
k::Int64,
check_safe::Bool
) -> Tuple{Bool, Bool}
-
sourceEAGO.relax!
— Functionrelax!
Relax the constraint by adding an affine constraint to the model.
sourceEAGO.relax_all_constraints!
— Methodrelax_all_constraints!(
+
sourceEAGO.relax!
— Functionrelax!
Relax the constraint by adding an affine constraint to the model.
sourceEAGO.relax_all_constraints!
— Methodrelax_all_constraints!(
t::ExtensionType,
m::GlobalOptimizer,
k::Int64
) -> Tuple{Bool, Bool}
-
A routine that adds relaxations for all nonlinear constraints and quadratic constraints corresponding to the current node to the relaxed problem. This adds an objective cut (if specified by objective_cut_on
) and then sets the _new_eval_constraint
flag to false indicating that an initial evaluation of the constraints has occurred. If the objective_cut_on
flag is true
then the _new_eval_objective
flag is also set to false
indicating that the objective expression was evaluated.
sourceEAGO.relaxed_problem_status
— Methodrelaxed_problem_status(t, p, d)
-
Take an MOI.TerminationStatusCode
and two MOI.ResultStatusCode
s (one each for the primal and dual status) and return a RelaxResultStatus
. Returns RRS_OPTIMAL
if the codes prove that the subproblem solution was solved to global optimality. Returns RRS_INFEASIBLE
if the codes prove that the subproblem solution is infeasible. Returns RRS_DUAL_FEASIBLE
if subproblem solution is not optimal and not proven infeasible, but the dual status is MOI.FEASIBLE_POINT
. Returns RRS_INVALID
otherwise.
sourceEAGO.repeat_check
— Methodrepeat_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
-
Check to see if current node should be reprocessed. Without any custom extension, return false
by default.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a expressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a parameters v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a subexpressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— Methodrprop!
Updates storage tapes with reverse evalution of node representing n = *(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop!
— Methodrprop!
Updates storage tapes with reverse evalution of node representing n = +(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop_2!
— Methodrprop_2!
Updates storage tapes with reverse evalution of node representing n = x * y
which updates x and y.
sourceEAGO.rprop_2!
— Methodrprop_2!
Updates storage tapes with reverse evalution of node representing n = x + y
which updates x and y.
sourceEAGO.rprop_n!
— Methodrprop_n!
Updates storage tapes with reverse evalution of node representing n = *(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop_n!
— Methodrprop_n!
Updates storage tapes with reverse evalution of node representing n = +(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.same_box
— Methodsame_box(x::NodeBB, y::NodeBB, r::Float64) -> Bool
-
Check that node x
and y
have equal domains within an absolute tolerance of r
.
sourceEAGO.select_branch_point
— Methodselect_branch_point(
+
A routine that adds relaxations for all nonlinear constraints and quadratic constraints corresponding to the current node to the relaxed problem. This adds an objective cut (if specified by objective_cut_on
) and then sets the _new_eval_constraint
flag to false indicating that an initial evaluation of the constraints has occurred. If the objective_cut_on
flag is true
then the _new_eval_objective
flag is also set to false
indicating that the objective expression was evaluated.
sourceEAGO.relaxed_problem_status
— Methodrelaxed_problem_status(t, p, d)
+
Take an MOI.TerminationStatusCode
and two MOI.ResultStatusCode
s (one each for the primal and dual status) and return a RelaxResultStatus
. Returns RRS_OPTIMAL
if the codes prove that the subproblem solution was solved to global optimality. Returns RRS_INFEASIBLE
if the codes prove that the subproblem solution is infeasible. Returns RRS_DUAL_FEASIBLE
if subproblem solution is not optimal and not proven infeasible, but the dual status is MOI.FEASIBLE_POINT
. Returns RRS_INVALID
otherwise.
sourceEAGO.repeat_check
— Methodrepeat_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
+
Check to see if current node should be reprocessed. Without any custom extension, return false
by default.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a expressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a parameters v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a subexpressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— Methodrprop!
Updates storage tapes with reverse evalution of node representing n = *(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop!
— Methodrprop!
Updates storage tapes with reverse evalution of node representing n = +(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop_2!
— Methodrprop_2!
Updates storage tapes with reverse evalution of node representing n = x * y
which updates x and y.
sourceEAGO.rprop_2!
— Methodrprop_2!
Updates storage tapes with reverse evalution of node representing n = x + y
which updates x and y.
sourceEAGO.rprop_n!
— Methodrprop_n!
Updates storage tapes with reverse evalution of node representing n = *(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.rprop_n!
— Methodrprop_n!
Updates storage tapes with reverse evalution of node representing n = +(x,y,z...)
which updates x, y, z and so on.
sourceEAGO.same_box
— Methodsame_box(x::NodeBB, y::NodeBB, r::Float64) -> Bool
+
Check that node x
and y
have equal domains within an absolute tolerance of r
.
sourceEAGO.select_branch_point
— Methodselect_branch_point(
t::ExtensionType,
m::GlobalOptimizer,
i
) -> Float64
-
Select a point xb
within the domain of the i
th branching variable. By default, this point is a convex combination of the solution to the relaxation and the midpoint of the node (branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
). If the solution lies within branch_offset
of a bound, then the branch point is moved to a distance of branch_offset
from that bound.
sourceEAGO.select_branch_variable
— Methodselect_branch_variable(
+
Select a point xb
within the domain of the i
th branching variable. By default, this point is a convex combination of the solution to the relaxation and the midpoint of the node (branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
). If the solution lies within branch_offset
of a bound, then the branch point is moved to a distance of branch_offset
from that bound.
sourceEAGO.select_branch_variable
— Methodselect_branch_variable(
t::ExtensionType,
m::GlobalOptimizer
) -> Any
-
Choose a variable to branch on. A maximum relative width branching rule is used by default.
sourceEAGO.set_constraint_propagation_fbbt!
— Methodset_constraint_propagation_fbbt!(
+
Choose a variable to branch on. A maximum relative width branching rule is used by default.
sourceEAGO.set_constraint_propagation_fbbt!
— Methodset_constraint_propagation_fbbt!(
m::GlobalOptimizer{R, S, Q<:ExtensionType}
) -> Bool
-
Performs bound tightening based on forward/reverse interval and/or McCormick passes. This routine resets the current node with new interval bounds.
sourceEAGO.set_default_config!
— Methodset_default_config!
Configures subsolver tolerances based on tolerance parameters provided to EAGO (provided that a specialized subsolver configuration routine has been provided and m.user_solver_config = false
).
sourceEAGO.set_dual!
— Methodset_dual!(m)
-
Retrieves the lower and upper duals for variable bounds from the relaxed_optimizer
and sets the appropriate values in the _lower_lvd
and _lower_uvd
storage fields.
sourceEAGO.set_first_relax_point!
— Methodset_first_relax_point!(m::GlobalOptimizer)
-
sourceEAGO.set_global_lower_bound!
— Methodset_global_lower_bound!(m::GlobalOptimizer)
-
If the previous best-known global lower bound is lower than the lowest lower bound in the stack, set the global lower bound equal to the lowest lower bound in the stack.
sourceEAGO.set_node!
— Methodset_node!
Sets the current node in the Evaluator structure.
sourceEAGO.set_reference_point!
— Methodset_reference_point!(m::GlobalOptimizer)
-
sourceEAGO.set_result_status!
— Methodset_result_status!(m::GlobalOptimizer)
-
Convert EAGO's ending status code into an MOI.ResultStatusCode
.
sourceEAGO.set_termination_status!
— Methodset_termination_status!(m::GlobalOptimizer)
-
Convert EAGO's ending status code into an MOI.TerminationStatusCode
.
sourceEAGO.single_storage!
— Methodsingle_storage!(t::ExtensionType, m::GlobalOptimizer)
-
Store the current node to the stack, without branching, after updating lower/upper bounds.
sourceEAGO.sip_bnd!
— Methodsip_bnd!
Solves the bounding problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_bnd!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
sourceEAGO.sip_llp!
— Methodsip_llp!
Solves the lower level problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_llp!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
sourceEAGO.sip_res!
— Methodsip_res!
Solves the restriction problem for extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_res!(t::ExtensionType, a::AbstractSIPAlgo, ...)
.
sourceEAGO.sip_solve
— Methodsip_solve
Solve an SIP with decision variable bounds x_l
to x_u
, uncertain variable bounds p_l
to p_u
, an objective function of f
, and gSIP
seminfiniite constraint(s).
sourceEAGO.solve_local_nlp!
— MethodConstructs and solves the problem locally on node y
updated the upper solution informaton in the optimizer.
sourceEAGO.store_candidate_solution!
— Methodstore_candidate_solution!(m::GlobalOptimizer)
-
If the most recent upper problem returned a feasible result, and the upper objective value is less than the previous best-known global upper bound, set the most recent upper problem result to be the new global upper bound. Update the _feasible_solution_found
, _solution_node
, _global_upper_bound
, and _continuous_solution
fields of the GlobalOptimizer
accordingly.
sourceEAGO.stored_adjusted_upper_bound!
— Methodstored_adjusted_upper_bound!(d, v)
-
Shifts the resulting local nlp objective value f*
by (1.0 + relative_tolerance/100.0)*f* + absolute_tolerance/100.0
. This assumes that the local solvers relative tolerance and absolute tolerance is significantly lower than the global tolerance (local problem is minimum).
sourceEAGO.termination_check
— Methodtermination_check(m::GlobalOptimizer)
-termination_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
Check for termination of the branch-and-bound algorithm.
If only the GlobalOptimizer
is given as an argument, termination_check
dispatches to the other form using the ExtensionType
given in the SubSolvers
. If there is no user-defined extension, then by default, this will check for satisfaction of absolute or relative tolerances, solution infeasibility, and other specified limits. Returns true
if any conditions are met and branch-and-bound should end, and false
otherwise.
sourceEAGO.trivial_filtering!
— Methodtrivial_filtering!(
+
Performs bound tightening based on forward/reverse interval and/or McCormick passes. This routine resets the current node with new interval bounds.
sourceEAGO.set_default_config!
— Methodset_default_config!
Configures subsolver tolerances based on tolerance parameters provided to EAGO (provided that a specialized subsolver configuration routine has been provided and m.user_solver_config = false
).
sourceEAGO.set_dual!
— Methodset_dual!(m)
+
Retrieves the lower and upper duals for variable bounds from the relaxed_optimizer
and sets the appropriate values in the _lower_lvd
and _lower_uvd
storage fields.
sourceEAGO.set_first_relax_point!
— Methodset_first_relax_point!(m::GlobalOptimizer)
+
sourceEAGO.set_global_lower_bound!
— Methodset_global_lower_bound!(m::GlobalOptimizer)
+
If the previous best-known global lower bound is lower than the lowest lower bound in the stack, set the global lower bound equal to the lowest lower bound in the stack.
sourceEAGO.set_node!
— Methodset_node!
Sets the current node in the Evaluator structure.
sourceEAGO.set_reference_point!
— Methodset_reference_point!(m::GlobalOptimizer)
+
sourceEAGO.set_result_status!
— Methodset_result_status!(m::GlobalOptimizer)
+
Convert EAGO's ending status code into an MOI.ResultStatusCode
.
sourceEAGO.set_termination_status!
— Methodset_termination_status!(m::GlobalOptimizer)
+
Convert EAGO's ending status code into an MOI.TerminationStatusCode
.
sourceEAGO.single_storage!
— Methodsingle_storage!(t::ExtensionType, m::GlobalOptimizer)
+
Store the current node to the stack, without branching, after updating lower/upper bounds.
sourceEAGO.sip_bnd!
— Methodsip_bnd!
Solves the bounding problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_bnd!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
sourceEAGO.sip_llp!
— Methodsip_llp!
Solves the lower level problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_llp!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
sourceEAGO.sip_res!
— Methodsip_res!
Solves the restriction problem for extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_res!(t::ExtensionType, a::AbstractSIPAlgo, ...)
.
sourceEAGO.sip_solve
— Methodsip_solve
Solve an SIP with decision variable bounds x_l
to x_u
, uncertain variable bounds p_l
to p_u
, an objective function of f
, and gSIP
seminfiniite constraint(s).
sourceEAGO.solve_local_nlp!
— MethodConstructs and solves the problem locally on node y
updated the upper solution informaton in the optimizer.
sourceEAGO.store_candidate_solution!
— Methodstore_candidate_solution!(m::GlobalOptimizer)
+
If the most recent upper problem returned a feasible result, and the upper objective value is less than the previous best-known global upper bound, set the most recent upper problem result to be the new global upper bound. Update the _feasible_solution_found
, _solution_node
, _global_upper_bound
, and _continuous_solution
fields of the GlobalOptimizer
accordingly.
sourceEAGO.stored_adjusted_upper_bound!
— Methodstored_adjusted_upper_bound!(d, v)
+
Shifts the resulting local nlp objective value f*
by (1.0 + relative_tolerance/100.0)*f* + absolute_tolerance/100.0
. This assumes that the local solvers relative tolerance and absolute tolerance is significantly lower than the global tolerance (local problem is minimum).
sourceEAGO.termination_check
— Methodtermination_check(m::GlobalOptimizer)
+termination_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
Check for termination of the branch-and-bound algorithm.
If only the GlobalOptimizer
is given as an argument, termination_check
dispatches to the other form using the ExtensionType
given in the SubSolvers
. If there is no user-defined extension, then by default, this will check for satisfaction of absolute or relative tolerances, solution infeasibility, and other specified limits. Returns true
if any conditions are met and branch-and-bound should end, and false
otherwise.
sourceEAGO.trivial_filtering!
— Methodtrivial_filtering!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
n::NodeBB
)
-
Excludes OBBT on variable indices that are tight for the solution of the relaxation.
sourceEAGO.unbounded_check!
— Methodunbounded_check!(m::GlobalOptimizer) -> Union{Nothing, Bool}
-
Check the optimization problem for unbounded branching variables, which would interfere with EAGO's branch-and-bound routine since there are no well-defined branching rules for cases where the interval bounds contain -Inf
or Inf
. If any branching variables are missing bounds, add the missing bound at +/- 1E10 and warn the user.
sourceEAGO.unpack_fbbt_buffer!
— Methodunpack_fbbt_buffer!(m::GlobalOptimizer)
-
sourceEAGO.unpack_global_solution!
— Methodunpack_global_solution!(
+
Excludes OBBT on variable indices that are tight for the solution of the relaxation.
sourceEAGO.unbounded_check!
— Methodunbounded_check!(m::GlobalOptimizer) -> Union{Nothing, Bool}
+
Check the optimization problem for unbounded branching variables, which would interfere with EAGO's branch-and-bound routine since there are no well-defined branching rules for cases where the interval bounds contain -Inf
or Inf
. If any branching variables are missing bounds, add the missing bound at +/- 1E10 and warn the user.
sourceEAGO.unpack_fbbt_buffer!
— Methodunpack_fbbt_buffer!(m::GlobalOptimizer)
+
sourceEAGO.unpack_global_solution!
— Methodunpack_global_solution!(
m::Optimizer{R, S, Q<:ExtensionType}
)
-
If global optimization was performed, much of the work happened within the _global_optimizer::GlobalOptimizer
. The unpack_global_solution!
function extracts results from the GlobalOptimizer
and puts them in the correct fields of the Optimizer
.
sourceEAGO.unsafe_check_fill!
— Methodunsafe_check_fill!(f, y::Array{T, 1}, x, n::Int64)
-
Performs map!(f, y, x)
in an unsafe manner if y[i] is true, else no-op. Assumes n == length(x) == length(y)
. About 2x faster for small arrays (n < 1000).
[Unused]
sourceEAGO.update_relaxed_problem_box!
— Methodupdate_relaxed_problem_box!(m)
-
Update the relaxed constraint by setting the constraint set of v == x*
, xL_i <= x_i
, and x_i <= xU_i
for each such constraint added to the relaxed optimizer. Resets integral valued constraints to either EqualTo
or Interval
constraints.
sourceEAGO.upper_problem!
— Methodupper_problem!(t::ExtensionType, m::GlobalOptimizer)
-
Default upper bounding problem which simply calls solve_local_nlp!
to solve the NLP locally.
sourceEAGO.variable_dbbt!
— Methodvariable_dbbt!(
+
If global optimization was performed, much of the work happened within the _global_optimizer::GlobalOptimizer
. The unpack_global_solution!
function extracts results from the GlobalOptimizer
and puts them in the correct fields of the Optimizer
.
sourceEAGO.unsafe_check_fill!
— Methodunsafe_check_fill!(f, y::Array{T, 1}, x, n::Int64)
+
Performs map!(f, y, x)
in an unsafe manner if y[i] is true, else no-op. Assumes n == length(x) == length(y)
. About 2x faster for small arrays (n < 1000).
[Unused]
sourceEAGO.update_relaxed_problem_box!
— Methodupdate_relaxed_problem_box!(m)
+
Update the relaxed constraint by setting the constraint set of v == x*
, xL_i <= x_i
, and x_i <= xU_i
for each such constraint added to the relaxed optimizer. Resets integral valued constraints to either EqualTo
or Interval
constraints.
sourceEAGO.upper_problem!
— Methodupper_problem!(t::ExtensionType, m::GlobalOptimizer)
+
Default upper bounding problem which simply calls solve_local_nlp!
to solve the NLP locally.
sourceEAGO.variable_dbbt!
— Methodvariable_dbbt!(
n::NodeBB,
mult_lo::Vector{Float64},
mult_hi::Vector{Float64},
@@ -156,4 +156,4 @@
UBD::Float64,
nx::Int64
)
-
Tighten the bounds of the _current_node
using the current global upper bound and the duality information obtained from the relaxation.
sourceEAGO.variable_load_parse!
— Methodvariable_load_parse!
Parse constraint information of a given constraint type to fill in related variable information.
sourceSettings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+
Tighten the bounds of the _current_node
using the current global upper bound and the duality information obtained from the relaxation.
EAGO.variable_load_parse!
— Methodvariable_load_parse!
Parse constraint information of a given constraint type to fill in related variable information.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO.AbstractCache
— Typeabstract type AbstractCache
Abstract supertype used for information storage object the directed acyclic graph.
EAGO.AbstractCacheAttribute
— Typeabstract type AbstractCacheAttribute
Abstract supertype used for attributes stored in a cache.
EAGO.AbstractDirectedGraph
— Typeabstract type AbstractDirectedGraph
Abstract supertype for generic directed graph structure.
EAGO.AbstractEAGOConstraint
— Typeabstract type AbstractEAGOConstraint
An abstract super-type used for representing constraints built by EAGO's backend.
EAGO.AffineFunctionEq
— Typemutable struct AffineFunctionEq <: EAGO.AbstractEAGOConstraint
Representation of an affine equality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.AffineFunctionIneq
— Typemutable struct AffineFunctionIneq <: EAGO.AbstractEAGOConstraint
Representation of an affine inequality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.AtomType
— TypeAtomType
EAGO.BufferedNonlinearFunction
— Typemutable struct BufferedNonlinearFunction{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general nonlinear function with a buffer represented by the sum of a tape and a scalar affine function.
EAGO.BufferedQuadraticEq
— Typemutable struct BufferedQuadraticEq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic equality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
minus_func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.BufferedQuadraticIneq
— Typemutable struct BufferedQuadraticIneq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic inequality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.BufferedSOC
— Typemutable struct BufferedSOC <: EAGO.AbstractEAGOConstraint
Representation of a second-order cone with a buffer.
EAGO.DirectedTree
— TypeDirectedTree
A tree graph with a single sink node.
EAGO.EAGOParameters
— Typemutable struct EAGOParameters
Storage for parameters that do not change during a global solve.
presolve_scrubber_flag::Bool
: Should EAGO attempt to remove type-assert issues for user-defined functions (default = false)
presolve_to_JuMP_flag::Bool
: Create and use DAG representations of user-defined functions (default = false)
presolve_flatten_flag::Bool
: Rerrange the DAG using registered transformations (default = false)
conic_convert_quadratic::Bool
: Attempt to bridge convex constraint to second-order cone (default = false)
log_on::Bool
: Turn logging on; record global bounds, node count, and run time. Additional options are available for recording information specific to subproblems (default = false)
log_subproblem_info::Bool
: Turn on logging of times and feasibility of subproblems (default = false)
log_interval::Int64
: Log data every log_interval
iterations (default = 1)
verbosity::Int64
: The amount of information that should be printed to console while solving. Values range from 0 - 4: 0 is silent, 1 shows iteration summary statistics only, 2-4 show varying degrees of detail about calculations within each iteration (default = 1)
output_iterations::Int64
: Display summary of iteration to console every output_iterations
(default = 1000)
header_iterations::Int64
: Display header for summary to console every output_iterations
(default = 100000)
branch_cvx_factor::Float64
: Convex coefficient used to select branch point. Branch point is given by branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
(default = 0.25)
branch_offset::Float64
: Minimum distance from bound to have branch point, normalized by width of dimension to branch on (default = 0.15)
branch_pseudocost_on::Bool
: Indicate that pseudocost branching should be used (default = false)
branch_variable::Vector{Bool}
: Variables to branch on (default is all nonlinear)
branch_max_repetitions::Int64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Number of times to repeat node processing prior to branching (default = 4)
branch_repetition_tol::Float64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Volume ratio tolerance required to repeat processing the current node (default = 0.9)
node_limit::Int64
: Maximum number of nodes (default = 1E7)
time_limit::Float64
: Maximum CPU time in seconds (default = 3600)
iteration_limit::Int64
: Maximum number of iterations (default 1E9)
absolute_tolerance::Float64
: Absolute tolerance for termination (default = 1E-3)
relative_tolerance::Float64
: Relative tolerance for termination (default = 1E-3)
absolute_constraint_feas_tolerance::Float64
: Absolute constraint feasibility tolerance (default = 1E-8)
cp_depth::Int64
: Depth in B&B tree above which constraint propagation should be disabled (default = 0)
cp_repetitions::Int64
: Number of times to repeat forward-reverse pass routine (default = 0)
cp_tolerance::Float64
: Disable constraint propagation if the ratio of new node volume to beginning node volume exceeds this number (default = 0.99)
cp_interval_only::Bool
: Use only valid interval bounds during constraint propagation (default = false)
obbt_depth::Int64
: Depth in B&B tree above which OBBT should be disabled (default = 6)
obbt_repetitions::Int64
: Number of repetitions of OBBT to perform in preprocessing (default = 3)
obbt_aggressive_on::Bool
: Turn on aggresive OBBT (default = true)
obbt_aggressive_max_iteration::Int64
: Maximum iteration to perform aggresive OBBT (default = 2)
obbt_aggressive_min_dimension::Int64
: Minimum dimension to perform aggresive OBBT (default = 2)
obbt_tolerance::Float64
: Tolerance to consider bounds equal (default = 1E-10)
fbbt_lp_depth::Int64
: Depth in B&B tree above which linear FBBT should be disabled (default = 1000)
fbbt_lp_repetitions::Int64
: Number of repetitions of linear FBBT to perform in preprocessing (default = 3)
dbbt_depth::Int64
: Depth in B&B tree above which duality-based bound tightening should be disabled (default = 1E10)
dbbt_tolerance::Float64
: New bound is considered equal to the prior bound if within dbbt_tolerance (default = 1E-8)
relax_tag::RelaxTag
: RelaxTag used to specify type of McCormick operator (default = NS())
subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a forward pass (default = true)
reverse_subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a reverse pass (default = false)
subgrad_tol::Float64
: Outer-round computed subgradient bounds by this amount (default = 1E-10)
mul_relax_style::Int64
: Select the type of relaxation to use for the bilinear term (multiplication): 0 corresponds to a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation with implied apriori relaxations: (1) corresponds to a subgradient-based apriori relaxation approach; (2) corresponds to an affine arithmetic-based apriori approach; and (3) corresponds to a enumerative apriori relaxation-based approach (default = 0)
cut_min_iterations::Int64
: Minimum number of cuts at each node to attempt (unsafe cuts not necessarily added) (default = 2)
cut_max_iterations::Int64
: Maximum number of cuts at each node to attempt (default = 8)
cut_tolerance_abs::Float64
: Absolute tolerance checked for continuing cut (default = 1E-6)
cut_tolerance_rel::Float64
: Relative tolerance checked for continuing cut (default = 1E-3)
cut_safe_on::Bool
: Use tolerances to determine safe cuts in a Khajavirad 2018 manner (default = true)
cut_safe_l::Float64
: Lower tolerance for safe-lp cut, Khajavirad 2018 (default = 1E-7)
cut_safe_u::Float64
: Upper tolerance for safe-lp cut, Khajavirad 2018 (default = 1E7)
cut_safe_b::Float64
: Constant tolerance for safe-lp cut, Khajavirad 2018 (default = 1E9)
upper_bounding_depth::Int64
: Solve upper problem for every node with depth less than upper_bounding_depth
, and otherwise solve upper problems with a probability of (1/2)^(depth-upper_bounding_depth)
(default = 8)
domain_violation_guard_on::Bool
: (Unused) Protect against domain violation (default = false)
domain_violation_ϵ::Float64
: (Unused) Amount about a domain violation to ignore when propagating bounds (default = 1E-9)
user_solver_config::Bool
: If true, EAGO forgoes its default configuration process for subsolvers (default = false)
integer_abs_tol::Float64
: Absolute tolerance used to check for integrality of decision variables (default = 1E-9)
integer_rel_tol::Float64
: Relative tolerance used to check for integrality of decision variables (default = 1E-9)
force_global_solve::Bool
: Ignore EAGO's ability to parse problem types and force it to run global optimization (default = false)
unbounded_check::Bool
: Check that all branching variables have finite bounds and set them to +/- 1E10 if not (default = true)
EAGO.Evaluator
— TypeEvaluator
MOI.AbstractNLPEvaluator for calculating relaxations of nonlinear terms.
Checks that the resulting value should be a number.
user_operators::EAGO.OperatorRegistry
has_user_mv_operator::Bool
num_mv_buffer::Vector{Float64}
parameter_values::Vector{Float64}
node::NodeBB
variable_values::EAGO.VariableValues{Float64}
subgrad_tighten::Bool
reverse_subgrad_tighten::Bool
subexpressions::Vector{EAGO.NonlinearExpression}
subexpressions_eval::Vector{Bool}
is_post::Bool
is_intersect::Bool
is_first_eval::Bool
interval_intersect::Bool
subgrad_tol::Float64
relax_type::EAGO.RelaxType
pass_number::Int64
EAGO.ExtensionType
— Typeabstract type ExtensionType
An abstract type the subtypes of which are associated with functions method overloaded for new extensions. An instance of this is the DefaultExt <: ExtensionType
structure in the ext_type
field of the Optimizer
.
EAGO.GlobalEndState
— Typeprimitive type GlobalEndState <: Enum{Int32} 32
An Enum of possible values for EAGO's termination status. This attribute is used by EAGO to explain why the optimizer stopped executing in the most recent call to optimize!
. See also MathOptInterface.TerminationStatusCode
.
If no call has been made to optimize!
, the GlobalEndState
value is:
GS_UNSET
: The optimization algorithm has not stated.OK
GS_OPTIMAL
: A globally optimal solution was found.GS_INFEASIBLE
: The algorithm concluded that no feasible solution exists.Limits reached
GS_NODE_LIMIT
: The branch-and-bound algorithm stopped because it reached the user-set maximum number of nodes in the branch-and-bound tree.GS_ITERATION_LIMIT
: The maximum number of iterations was reached.GS_RELATIVE_TOL
: The gap between the lower and upper bounds, relative to the bound with the larger magnitude, is within the user-set relative tolerance.GS_ABSOLUTE_TOL
: The gap between the lower and upper bounds is within the user-set absolute tolerance.GS_TIME_LIMIT
: The algorithm stopped after the user-specified time limit was reached.EAGO.GlobalOptimizer
— Typemutable struct GlobalOptimizer{Q, S, T<:ExtensionType} <: MathOptInterface.AbstractOptimizer
Optimizer internal to EAGO which holds information used to perform branch-and-bound in order to solve nonconvex MINLPs.
Descriptions of all fields available in extended help.
Extended Help
_subsolvers::SubSolvers{Q, S} where {Q, S}
: Storage for relaxed and upper optimizers to use, and any custom extensions
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions)
enable_optimize_hook::Bool
: Specifies that the optimize_hook!
function should be called rather than throw the problem to the standard routine
ext::Any
: (Deprecated, use _subsolvers instead) Storage for custom extension types
_end_state::EAGO.GlobalEndState
: The completion status code for the branch-and-bound algorithm
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_obj_mult::Float64
: Multiplier used internally to convert objective sense from Max to Min. Only takes on values of {-1.0, 1.0}
_obj_var_slack_added::Bool
: Flag to indicate if a slack variable was added for the objective function. This is done in some epigraph reformulations (see reform_epigraph_min!
)
_stack::DataStructures.BinaryMinMaxHeap{NodeBB}
: A heap of all nodes in the branch-and-bound tree
_current_node::NodeBB
: The individual node being examined at any particular time. Nodes are removed from the stack and placed here, evaluated, and then sent back to the stack
_first_relax_point_set::Bool
: (Unused) Flag for relaxation points
_current_xref::Vector{Float64}
: (Unused) Variable values of a particular point
_candidate_xref::Vector{Float64}
: (Unused) Variable values of a candidate point
_use_prior_objective_xref::Bool
: (Unused) Flag to use variable values from previous evaluation on the current step
_current_objective_xref::Vector{Float64}
: (Unused) Variable values for objective evaluation
_prior_objective_xref::Vector{Float64}
: (Unused) Variable values for previous objective evaluation
_user_branch_variables::Bool
: Flag for if the user has specified branch variables (see label_branch_variables!
)
_fixed_variable::Vector{Bool}
: Variables that are fixed in place
_branch_variable_count::Int64
: Number of variables that can be branched on
_branch_to_sol_map::Vector{Int64}
: Mapping from the branch variables to the full set of variables in the problem
_sol_to_branch_map::Vector{Int64}
: Mapping from the full set of variables in the problem to the branch variables
_continuous_solution::Vector{Float64}
: The final (or intermediate) variable values of the solution
_preprocess_feasibility::Bool
: Flag to ensure preprocessing result is feasible
_preprocess_termination_status::MathOptInterface.TerminationStatusCode
: Status codes for use in bounds tightening
_preprocess_primal_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_preprocess_dual_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_lower_primal_status::MathOptInterface.ResultStatusCode
: Primal status of the lower problem
_lower_dual_status::MathOptInterface.ResultStatusCode
: Dual status of the lower problem
_lower_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the lower problem
_lower_feasibility::Bool
: Flag for lower problem feasibility
_lower_objective_value::Float64
: Objective value result from the lower problem
_lower_solution::Vector{Float64}
: Variable values of the lower problem solution
_lower_lvd::Vector{Float64}
: Lower variable duals for use in duality-based bound tightening
_lower_uvd::Vector{Float64}
: Upper variable duals for use in duality-based bound tightening
_last_cut_objective::Float64
: Objective value associated with the previous cut in the cutting planes algorithm
_upper_result_status::MathOptInterface.ResultStatusCode
: Primal status of the upper problem
_upper_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the upper problem
_upper_feasibility::Bool
: Flag for upper problem feasibility
_upper_objective_value::Float64
: Objective value result from the upper problem
_upper_variables::Vector{MathOptInterface.VariableIndex}
:
_upper_solution::Vector{Float64}
:
_postprocess_feasibility::Bool
: (Unused) Flag to ensure postprocessing result is feasible
_time_left::Float64
: Time remaining for the optimization algorithm. This is set in initial_parse!
to the user-defined time limit and is decremented throughout global_solve!
_start_time::Float64
: Storage for the time()
when optimization began
_run_time::Float64
: Current run time, incremented using time()-_start_time
_parse_time::Float64
: A field to keep track of time spent on initial problem parsing
_presolve_time::Float64
: Used in optimize_nonconvex.jl
to track how long the presolve step takes
_last_preprocess_time::Float64
: Updated each iteration to track the time of the preprocess step
_last_lower_problem_time::Float64
: Updated each iteration to track the time of the lower problem step
_last_upper_problem_time::Float64
: Updated each iteration to track the time of the upper problem step
_last_postprocessing_time::Float64
: Updated each iteration to track the time of the postprocess step
_min_converged_value::Float64
: A field to track convergence progress across iterations
_global_lower_bound::Float64
: The best-known lower bound
_global_upper_bound::Float64
: The best-known upper bound
_maximum_node_id::Int64
: The total number of nodes that have been created
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
_solution_value::Float64
: (Unused) The best-known solution value
_feasible_solution_found::Bool
: A flag for if a feasible solution was identified. Updated if preprocessing, lower problem, and upper problem all return feasible values
_solution_node::Int64
: The node ID of the best-known feasible upper problem solution (default = -1, if no feasible solution is found)
_best_upper_value::Float64
: The best-known upper bound
_obbt_working_lower_index::Vector{Bool}
: Indices of variables to perform OBBT on
_obbt_working_upper_index::Vector{Bool}
: Indices of variables to perform OBBT on
_lower_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkinglowerindex across iterations
_upper_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkingupperindex across iterations
_old_low_index::Vector{Bool}
: Storage for indices prior to OBBT step
_old_upp_index::Vector{Bool}
: Storage for indices prior to OBBT step
_new_low_index::Vector{Bool}
: New indices following OBBT step; compared with _old_low_index
_new_upp_index::Vector{Bool}
: New indices following OBBT step; compared with _old_upp_index
_obbt_variables::Vector{MathOptInterface.VariableIndex}
: (Deprecated) Variables to perform OBBT on. Replaced by _obbt_working_lower_index
and _obbt_working_upper_index
_obbt_variable_count::Int64
: The number of variables to perform OBBT on
_obbt_performed_flag::Bool
: (Unused) Flag to indicate whether OBBT has been performed
_lower_fbbt_buffer::Vector{Float64}
: Buffer for FBBT lower bounds. Set in presolve, used in preprocess
_upper_fbbt_buffer::Vector{Float64}
: Buffer for FBBT upper bounds. Set in presolve, used in preprocess
_cp_improvement::Float64
: (Unused) Improvement in constraint propagation
_cp_evaluation_reverse::Bool
: (Unused) Flag for if constraint propagation results need to be reversed
_cut_iterations::Int64
: Iterations of the cutting planes algorithm completed
_cut_add_flag::Bool
: (Unused) Flag to check if cuts should be added
_node_repetitions::Int64
: Counter for number of times a node is evaluated. If the repeat_check
function is overloaded to return true
, a node will not be branched on, but will instead be added back into the stack using single_storage!
. In this case, _node_repetitions
is incremented
_log::Log
: Storage for logging information during a branch-and-bound run
_affine_relax_ci::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
: Storage for affine constraints
_affine_objective_cut_ci::Union{Nothing, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for a linear objective cut constraint
_relaxed_variable_number::Int64
: (Unused) Number of relaxed variables
_relaxed_variable_index::Vector{MathOptInterface.VariableIndex}
: Indices of relaxed variables
_relaxed_variable_et::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Int64}}
: Stored EqualTo constraints
_relaxed_variable_lt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Int64}}
: Stored LessThan constraints
_relaxed_variable_gt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Int64}}
: Stored GreaterThan constraints
_relaxed_variable_integer::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
: Stored Integer constraints
_branch_variables::Vector{Bool}
: List of variables that can be branched on. If not user-specified, branch variables are identified in label_branch_variables!
_nonbranching_int::Bool
: (Unused) Flag for non-branching integers
_new_eval_constraint::Bool
: Flag indicating if an initial evaluation of the constraints has occurred
_new_eval_objective::Bool
: Flag indicating if the objective expression was evaluated
_node_to_sv_leq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for carrying LessThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_node_to_sv_geq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
: Storage for carrying GreaterThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_nonlinear_evaluator_created::Bool
: Flag to check for nonlinear evaluators. Set to true
in add_nonlinear_evaluator!
_branch_cost::EAGO.BranchCostStorage{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Storage for pseudocost branching
_branch_variable_sparsity::SparseArrays.SparseMatrixCSC{Bool, Int64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Sparsity information of the branch variables
_constraint_infeasiblity::Vector{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Information on the infeasibility of each constraint
EAGO.Incremental
— Typemutable struct Incremental{S<:MathOptInterface.AbstractOptimizer} <: MathOptInterface.AbstractOptimizer
A type-stable cache used to wrapper for an optimizer that enables incremental modification of solvers that don't inherently suppport this. Explicitly checks support of MOI functionality used in EAGO.
(Deprecated) For Q = Val{true}
, the subsolver supports incremental loading. For Q = Val{false}
, the subsolver does not.
EAGO.InputProblem
— Typemutable struct InputProblem
A structure used to hold objectives and constraints added to the EAGO model. The constraints generally aren't used for relaxations.
All field information available in extended help.
Extended Help
_variable_count::Int64
: Count for the number of variables
_variable_names::Dict{MathOptInterface.VariableIndex, String}
: Dictionary containing variable indices and their names
_constraint_count::Int64
: Count for the number of constraints
_vi_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
_vi_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
_vi_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}}
_vi_it_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}}
_vi_zo_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}}
_vi_int_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
_linear_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_conic_second_order::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}, Tuple{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}}
_linear_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_linear_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_linear_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_quadratic_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_quadratic_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_quadratic_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_linear_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_objective::Union{Nothing, MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarQuadraticFunction{Float64}}
: Storage for the objective function
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
: Storage for NLP constraints (set by MOI.set(m, ::NLPBlockData...)
in moi_wrapper.jl
)
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
EAGO.LocalResultStatus
— TypeLocalResultStatus
Status code used internally to determine how to interpret the results from the solution of a local problem solve.
EAGO.Log
— Typemutable struct Log
A structure used to store information on the history of the solution procedure for generating convergence plots and other analyses.
current_lower_bound::Vector{Float64}
: Storage for lower bound calculated for current node.
current_upper_bound::Vector{Float64}
: Storage for upper bound calculated for current node.
preprocessing_time::Vector{Float64}
: Storage for preprocessing time of each iteration.
lower_problem_time::Vector{Float64}
: Storage for lower bounding time of each iteration.
upper_problem_time::Vector{Float64}
: Storage for upper bounding time of each iteration.
postprocessing_time::Vector{Float64}
: Storage for postprocessing time of each iteration.
preprocessing_feas::Vector{Bool}
: Storage for preprocessing feasibility of each iteration.
lower_problem_feas::Vector{Bool}
: Storage for lower bounding feasibility of each iteration.
upper_problem_feas::Vector{Bool}
: Storage for upper bounding feasibility of each iteration.
postprocessing_feas::Vector{Bool}
: Storage for postprocessing feasibility of each iteration.
global_lower_bound::Vector{Float64}
: Storage for best (global) lower bound at each iteration.
global_upper_bound::Vector{Float64}
: Storage for best (global) upper bound at each iteration.
node_count::Vector{Int64}
: Number of nodes at each iteration.
run_time::Vector{Float64}
: Run time at each iteration.
EAGO.Node
— Typestruct Node <: EAGO.AbstractNode
Describes connectivity and expression represented by node.
EAGO.NodeBB
— Typestruct NodeBB
Store information associated with each node in the branch-and-bound tree.
lower_variable_bounds::Vector{Float64}
: Lower bounds of variable box.
upper_variable_bounds::Vector{Float64}
: Upper bounds of variable box.
is_integer::BitVector
: Is dimension integer valued
continuous::Bool
: Are all dimensions continuous (or fixed)
lower_bound::Float64
: Lower bound of problem solution on nodeBB
upper_bound::Float64
: Upper bound of problem solution on nodeBB
depth::Int64
: Depth of node in B&B tree.
cont_depth::Int64
: Depth of first parent in B&B tree that was continuously valued
id::Int64
: Unique ID for each node.
branch_direction::EAGO.BranchDirection
: Whether last branch was negative or positive in direction
last_branch::Int64
: Dimension of last branch
branch_extent::Float64
: Extent of last branch (using for psuedocost calculation)
EAGO.NodeClass
— TypeNodeType
Each node in the directed graph can be classified into the following types
EAGO.NonlinearExpression
— Typemutable struct NonlinearExpression{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general quadratic function with a buffer.
EAGO.Optimizer
— Typemutable struct Optimizer{Q, S, T} <: MathOptInterface.AbstractOptimizer
The highest level optimizer object used by EAGO to solve problems during the optimization routine. Additional options and temporary storage are located in the _global_optimizer::GlobalOptimizer{Q,S,T}
field. Parameters which are expected to be constant over the entire solve are stored in the _parameters::EAGOParameters
field. Some user-facing keywords not in the EAGOParameters
field include:
relaxed_optimizer::MOI.AbstractOptimizer
: An instance of the optimizer used to solve the relaxed subproblems (default = Cbc.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.upper_optimizer::MOI.AbstractOptimizer
: Optimizer used to solve upper bounding problems (default = Ipopt.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.ext::ExtensionType
: Holds an instance of a subtype of EAGO.ExtensionType
, used to define new custom subroutines (default = DefaultExt()
). Located in subsolver_block::SubSolvers{Q,S,T}
.enable_optimize_hook::Bool
: Specifies that the user-defined optimize_hook!
function should be called rather than use the standard EAGO optimization routines. Located in Optimizer
and _global_optimizer::GlobalOptimizer{Q,S,T}
.obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions). Located in _global_optimizer::GlobalOptimizer{Q,S,T}
.Descriptions of all Optimizer
fields available in extended help.
Extended Help
subsolver_block::SubSolvers{Q, S, T} where {Q, S, T}
: Holds definitions of the relaxed and upper optimizers, as well as any user-defined extension types
enable_optimize_hook::Bool
: Specifies that the optimize_hook! function should be called rather than throw the problem to the standard routine
ext::Union{Nothing, T} where T
: (Deprecated, use subsolver_block
instead) Storage for custom extension types
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
_global_optimizer::GlobalOptimizer{Q, S, T} where {Q, S, T}
: Additional options and temporary storage for solving optimization problems
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_optimizer_attributes_set::Vector{MathOptInterface.AbstractOptimizerAttribute}
: Set of optimizer attributes
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_run_time::Float64
: Optimization run time
_objective_value::Float64
: The objective value of the primal solution
_objective_bound::Float64
: The best-known bound on the optimal objective value
_relative_gap::Float64
: The gap between the upper and lower bound, relative to the bound with the larger magnitude
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
EAGO.ParsedProblem
— Typemutable struct ParsedProblem
A structure used to store expressions and problem descriptions EAGO uses to formulate relaxed problems.
All field information available in extended help.
Extended Help
_problem_type::Union{Nothing, EAGO.DIFF_CVX, EAGO.LP, EAGO.MILP, EAGO.MINCVX, EAGO.MISOCP, EAGO.SOCP}
: Problem classification (set in parse_classify_problem!
)
_objective_saf::MathOptInterface.ScalarAffineFunction{Float64}
: Stores the objective and is used for constructing linear affine cuts
_objective::Union{Nothing, MathOptInterface.VariableIndex, EAGO.AffineFunctionIneq, EAGO.BufferedQuadraticIneq, EAGO.BufferedNonlinearFunction}
: Storage for the objective function
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
_saf_leq::Vector{EAGO.AffineFunctionIneq}
_saf_eq::Vector{EAGO.AffineFunctionEq}
_sqf_leq::Vector{EAGO.BufferedQuadraticIneq}
_sqf_eq::Vector{EAGO.BufferedQuadraticEq}
_conic_second_order::Vector{EAGO.BufferedSOC}
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
_nonlinear_constr::Vector{EAGO.BufferedNonlinearFunction}
_relaxed_evaluator::Evaluator
_variable_info::Vector{VariableInfo{Float64}}
: Variable information (set in initial_parse!
)
_variable_count::Int64
: Count for the number of variables
EAGO.Relax
— TypeRelax
Used to dispatch relaxations to a standard
EAGO.RelaxAA
— TypeRelaxAA
EAGO.RelaxMulEnum
— TypeRelaxMulEnum
EAGO.RelaxResultStatus
— TypeRelaxResultStatus
Status code used internally to determine how to interpret the results from the solution of a relaxed problem.
EAGO.SIPHybrid
— TypeSIPHybrid
Specifies that the SIPHybrid algorithm which implements Algorithm #2 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPProblem
— Type SIPProblem
Structure storing problem information for the solution routine.
EAGO.SIPRes
— TypeSIPRes
Specifies that the SIPRes algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResRev
— TypeSIPResRev
Specifies that the SIPResRev algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResult
— TypeSIPResult
Structure storing the results of the SIPRes
algorithm.
EAGO.SIPSubResult
— TypeSIPBuffer
Hold objective value, solution, discretization set, and feasibility status of each subproblem encountered by SIP algorithm.
EAGO.SubSolvers
— Typemutable struct SubSolvers{Q<:MathOptInterface.AbstractOptimizer, S<:MathOptInterface.AbstractOptimizer, T<:ExtensionType}
A structure containing the relaxed and upper optimizers to be used, as well as any user-defined extension.
relaxed_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve relaxed subproblems. Set using r = [...]
(<: MOI.AbstractOptimizer
) (default = Cbc.Optimizer()
)
upper_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve upper bounding problems. Set using u = [...]
(<: MOI.AbstractOptimizer
) (default = Ipopt.Optimizer()
)
ext::ExtensionType
: User-defined extension to use. Set using t = [...]
(<: EAGO.ExtensionType
)
EAGO.VariableInfo
— Typestruct VariableInfo{T<:AbstractFloat}
A structure used to store information related to the bounds assigned to each variable.
is_integer::Bool
: Is the variable integer valued?
has_lower_bound::Bool
: Boolean indicating whether a finite lower bound exists.
has_upper_bound::Bool
: Boolean indicating whether a finite upper bound exists.
is_fixed::Bool
: Boolean indicating if variable is fixed to a finite value.
has_constraints::Bool
: Boolean indicating that constraints have been set
lower_bound::AbstractFloat
: Lower bound. May be -Inf.
upper_bound::AbstractFloat
: Upper bound. May be Inf.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
EAGO.AbstractCache
— Typeabstract type AbstractCache
Abstract supertype used for information storage object the directed acyclic graph.
EAGO.AbstractCacheAttribute
— Typeabstract type AbstractCacheAttribute
Abstract supertype used for attributes stored in a cache.
EAGO.AbstractDirectedGraph
— Typeabstract type AbstractDirectedGraph
Abstract supertype for generic directed graph structure.
EAGO.AbstractEAGOConstraint
— Typeabstract type AbstractEAGOConstraint
An abstract super-type used for representing constraints built by EAGO's backend.
EAGO.AffineFunctionEq
— Typemutable struct AffineFunctionEq <: EAGO.AbstractEAGOConstraint
Representation of an affine equality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.AffineFunctionIneq
— Typemutable struct AffineFunctionIneq <: EAGO.AbstractEAGOConstraint
Representation of an affine inequality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.AtomType
— TypeAtomType
EAGO.BufferedNonlinearFunction
— Typemutable struct BufferedNonlinearFunction{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general nonlinear function with a buffer represented by the sum of a tape and a scalar affine function.
EAGO.BufferedQuadraticEq
— Typemutable struct BufferedQuadraticEq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic equality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
minus_func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.BufferedQuadraticIneq
— Typemutable struct BufferedQuadraticIneq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic inequality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.BufferedSOC
— Typemutable struct BufferedSOC <: EAGO.AbstractEAGOConstraint
Representation of a second-order cone with a buffer.
EAGO.DirectedTree
— TypeDirectedTree
A tree graph with a single sink node.
EAGO.EAGOParameters
— Typemutable struct EAGOParameters
Storage for parameters that do not change during a global solve.
presolve_scrubber_flag::Bool
: Should EAGO attempt to remove type-assert issues for user-defined functions (default = false)
presolve_to_JuMP_flag::Bool
: Create and use DAG representations of user-defined functions (default = false)
presolve_flatten_flag::Bool
: Rerrange the DAG using registered transformations (default = false)
conic_convert_quadratic::Bool
: Attempt to bridge convex constraint to second-order cone (default = false)
log_on::Bool
: Turn logging on; record global bounds, node count, and run time. Additional options are available for recording information specific to subproblems (default = false)
log_subproblem_info::Bool
: Turn on logging of times and feasibility of subproblems (default = false)
log_interval::Int64
: Log data every log_interval
iterations (default = 1)
verbosity::Int64
: The amount of information that should be printed to console while solving. Values range from 0 - 4: 0 is silent, 1 shows iteration summary statistics only, 2-4 show varying degrees of detail about calculations within each iteration (default = 1)
output_iterations::Int64
: Display summary of iteration to console every output_iterations
(default = 1000)
header_iterations::Int64
: Display header for summary to console every output_iterations
(default = 100000)
branch_cvx_factor::Float64
: Convex coefficient used to select branch point. Branch point is given by branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
(default = 0.25)
branch_offset::Float64
: Minimum distance from bound to have branch point, normalized by width of dimension to branch on (default = 0.15)
branch_pseudocost_on::Bool
: Indicate that pseudocost branching should be used (default = false)
branch_variable::Vector{Bool}
: Variables to branch on (default is all nonlinear)
branch_max_repetitions::Int64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Number of times to repeat node processing prior to branching (default = 4)
branch_repetition_tol::Float64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Volume ratio tolerance required to repeat processing the current node (default = 0.9)
node_limit::Int64
: Maximum number of nodes (default = 1E7)
time_limit::Float64
: Maximum CPU time in seconds (default = 3600)
iteration_limit::Int64
: Maximum number of iterations (default 1E9)
absolute_tolerance::Float64
: Absolute tolerance for termination (default = 1E-3)
relative_tolerance::Float64
: Relative tolerance for termination (default = 1E-3)
absolute_constraint_feas_tolerance::Float64
: Absolute constraint feasibility tolerance (default = 1E-8)
cp_depth::Int64
: Depth in B&B tree above which constraint propagation should be disabled (default = 0)
cp_repetitions::Int64
: Number of times to repeat forward-reverse pass routine (default = 0)
cp_tolerance::Float64
: Disable constraint propagation if the ratio of new node volume to beginning node volume exceeds this number (default = 0.99)
cp_interval_only::Bool
: Use only valid interval bounds during constraint propagation (default = false)
obbt_depth::Int64
: Depth in B&B tree above which OBBT should be disabled (default = 6)
obbt_repetitions::Int64
: Number of repetitions of OBBT to perform in preprocessing (default = 3)
obbt_aggressive_on::Bool
: Turn on aggresive OBBT (default = true)
obbt_aggressive_max_iteration::Int64
: Maximum iteration to perform aggresive OBBT (default = 2)
obbt_aggressive_min_dimension::Int64
: Minimum dimension to perform aggresive OBBT (default = 2)
obbt_tolerance::Float64
: Tolerance to consider bounds equal (default = 1E-10)
fbbt_lp_depth::Int64
: Depth in B&B tree above which linear FBBT should be disabled (default = 1000)
fbbt_lp_repetitions::Int64
: Number of repetitions of linear FBBT to perform in preprocessing (default = 3)
dbbt_depth::Int64
: Depth in B&B tree above which duality-based bound tightening should be disabled (default = 1E10)
dbbt_tolerance::Float64
: New bound is considered equal to the prior bound if within dbbt_tolerance (default = 1E-8)
relax_tag::RelaxTag
: RelaxTag used to specify type of McCormick operator (default = NS())
subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a forward pass (default = true)
reverse_subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a reverse pass (default = false)
subgrad_tol::Float64
: Outer-round computed subgradient bounds by this amount (default = 1E-10)
mul_relax_style::Int64
: Select the type of relaxation to use for the bilinear term (multiplication): 0 corresponds to a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation with implied apriori relaxations: (1) corresponds to a subgradient-based apriori relaxation approach; (2) corresponds to an affine arithmetic-based apriori approach; and (3) corresponds to a enumerative apriori relaxation-based approach (default = 0)
cut_min_iterations::Int64
: Minimum number of cuts at each node to attempt (unsafe cuts not necessarily added) (default = 2)
cut_max_iterations::Int64
: Maximum number of cuts at each node to attempt (default = 8)
cut_tolerance_abs::Float64
: Absolute tolerance checked for continuing cut (default = 1E-6)
cut_tolerance_rel::Float64
: Relative tolerance checked for continuing cut (default = 1E-3)
cut_safe_on::Bool
: Use tolerances to determine safe cuts in a Khajavirad 2018 manner (default = true)
cut_safe_l::Float64
: Lower tolerance for safe-lp cut, Khajavirad 2018 (default = 1E-7)
cut_safe_u::Float64
: Upper tolerance for safe-lp cut, Khajavirad 2018 (default = 1E7)
cut_safe_b::Float64
: Constant tolerance for safe-lp cut, Khajavirad 2018 (default = 1E9)
upper_bounding_depth::Int64
: Solve upper problem for every node with depth less than upper_bounding_depth
, and otherwise solve upper problems with a probability of (1/2)^(depth-upper_bounding_depth)
(default = 8)
domain_violation_guard_on::Bool
: (Unused) Protect against domain violation (default = false)
domain_violation_ϵ::Float64
: (Unused) Amount about a domain violation to ignore when propagating bounds (default = 1E-9)
user_solver_config::Bool
: If true, EAGO forgoes its default configuration process for subsolvers (default = false)
integer_abs_tol::Float64
: Absolute tolerance used to check for integrality of decision variables (default = 1E-9)
integer_rel_tol::Float64
: Relative tolerance used to check for integrality of decision variables (default = 1E-9)
force_global_solve::Bool
: Ignore EAGO's ability to parse problem types and force it to run global optimization (default = false)
unbounded_check::Bool
: Check that all branching variables have finite bounds and set them to +/- 1E10 if not (default = true)
EAGO.Evaluator
— TypeEvaluator
MOI.AbstractNLPEvaluator for calculating relaxations of nonlinear terms.
Checks that the resulting value should be a number.
user_operators::EAGO.OperatorRegistry
has_user_mv_operator::Bool
num_mv_buffer::Vector{Float64}
parameter_values::Vector{Float64}
node::NodeBB
variable_values::EAGO.VariableValues{Float64}
subgrad_tighten::Bool
reverse_subgrad_tighten::Bool
subexpressions::Vector{EAGO.NonlinearExpression}
subexpressions_eval::Vector{Bool}
is_post::Bool
is_intersect::Bool
is_first_eval::Bool
interval_intersect::Bool
subgrad_tol::Float64
relax_type::EAGO.RelaxType
pass_number::Int64
EAGO.ExtensionType
— Typeabstract type ExtensionType
An abstract type the subtypes of which are associated with functions method overloaded for new extensions. An instance of this is the DefaultExt <: ExtensionType
structure in the ext_type
field of the Optimizer
.
EAGO.GlobalEndState
— Typeprimitive type GlobalEndState <: Enum{Int32} 32
An Enum of possible values for EAGO's termination status. This attribute is used by EAGO to explain why the optimizer stopped executing in the most recent call to optimize!
. See also MathOptInterface.TerminationStatusCode
.
If no call has been made to optimize!
, the GlobalEndState
value is:
GS_UNSET
: The optimization algorithm has not stated.OK
GS_OPTIMAL
: A globally optimal solution was found.GS_INFEASIBLE
: The algorithm concluded that no feasible solution exists.Limits reached
GS_NODE_LIMIT
: The branch-and-bound algorithm stopped because it reached the user-set maximum number of nodes in the branch-and-bound tree.GS_ITERATION_LIMIT
: The maximum number of iterations was reached.GS_RELATIVE_TOL
: The gap between the lower and upper bounds, relative to the bound with the larger magnitude, is within the user-set relative tolerance.GS_ABSOLUTE_TOL
: The gap between the lower and upper bounds is within the user-set absolute tolerance.GS_TIME_LIMIT
: The algorithm stopped after the user-specified time limit was reached.EAGO.GlobalOptimizer
— Typemutable struct GlobalOptimizer{Q, S, T<:ExtensionType} <: MathOptInterface.AbstractOptimizer
Optimizer internal to EAGO which holds information used to perform branch-and-bound in order to solve nonconvex MINLPs.
Descriptions of all fields available in extended help.
Extended Help
_subsolvers::SubSolvers{Q, S} where {Q, S}
: Storage for relaxed and upper optimizers to use, and any custom extensions
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions)
enable_optimize_hook::Bool
: Specifies that the optimize_hook!
function should be called rather than throw the problem to the standard routine
ext::Any
: (Deprecated, use _subsolvers instead) Storage for custom extension types
_end_state::EAGO.GlobalEndState
: The completion status code for the branch-and-bound algorithm
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_obj_mult::Float64
: Multiplier used internally to convert objective sense from Max to Min. Only takes on values of {-1.0, 1.0}
_obj_var_slack_added::Bool
: Flag to indicate if a slack variable was added for the objective function. This is done in some epigraph reformulations (see reform_epigraph_min!
)
_stack::DataStructures.BinaryMinMaxHeap{NodeBB}
: A heap of all nodes in the branch-and-bound tree
_current_node::NodeBB
: The individual node being examined at any particular time. Nodes are removed from the stack and placed here, evaluated, and then sent back to the stack
_first_relax_point_set::Bool
: (Unused) Flag for relaxation points
_current_xref::Vector{Float64}
: (Unused) Variable values of a particular point
_candidate_xref::Vector{Float64}
: (Unused) Variable values of a candidate point
_use_prior_objective_xref::Bool
: (Unused) Flag to use variable values from previous evaluation on the current step
_current_objective_xref::Vector{Float64}
: (Unused) Variable values for objective evaluation
_prior_objective_xref::Vector{Float64}
: (Unused) Variable values for previous objective evaluation
_user_branch_variables::Bool
: Flag for if the user has specified branch variables (see label_branch_variables!
)
_fixed_variable::Vector{Bool}
: Variables that are fixed in place
_branch_variable_count::Int64
: Number of variables that can be branched on
_branch_to_sol_map::Vector{Int64}
: Mapping from the branch variables to the full set of variables in the problem
_sol_to_branch_map::Vector{Int64}
: Mapping from the full set of variables in the problem to the branch variables
_continuous_solution::Vector{Float64}
: The final (or intermediate) variable values of the solution
_preprocess_feasibility::Bool
: Flag to ensure preprocessing result is feasible
_preprocess_termination_status::MathOptInterface.TerminationStatusCode
: Status codes for use in bounds tightening
_preprocess_primal_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_preprocess_dual_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_lower_primal_status::MathOptInterface.ResultStatusCode
: Primal status of the lower problem
_lower_dual_status::MathOptInterface.ResultStatusCode
: Dual status of the lower problem
_lower_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the lower problem
_lower_feasibility::Bool
: Flag for lower problem feasibility
_lower_objective_value::Float64
: Objective value result from the lower problem
_lower_solution::Vector{Float64}
: Variable values of the lower problem solution
_lower_lvd::Vector{Float64}
: Lower variable duals for use in duality-based bound tightening
_lower_uvd::Vector{Float64}
: Upper variable duals for use in duality-based bound tightening
_last_cut_objective::Float64
: Objective value associated with the previous cut in the cutting planes algorithm
_upper_result_status::MathOptInterface.ResultStatusCode
: Primal status of the upper problem
_upper_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the upper problem
_upper_feasibility::Bool
: Flag for upper problem feasibility
_upper_objective_value::Float64
: Objective value result from the upper problem
_upper_variables::Vector{MathOptInterface.VariableIndex}
:
_upper_solution::Vector{Float64}
:
_postprocess_feasibility::Bool
: (Unused) Flag to ensure postprocessing result is feasible
_time_left::Float64
: Time remaining for the optimization algorithm. This is set in initial_parse!
to the user-defined time limit and is decremented throughout global_solve!
_start_time::Float64
: Storage for the time()
when optimization began
_run_time::Float64
: Current run time, incremented using time()-_start_time
_parse_time::Float64
: A field to keep track of time spent on initial problem parsing
_presolve_time::Float64
: Used in optimize_nonconvex.jl
to track how long the presolve step takes
_last_preprocess_time::Float64
: Updated each iteration to track the time of the preprocess step
_last_lower_problem_time::Float64
: Updated each iteration to track the time of the lower problem step
_last_upper_problem_time::Float64
: Updated each iteration to track the time of the upper problem step
_last_postprocessing_time::Float64
: Updated each iteration to track the time of the postprocess step
_min_converged_value::Float64
: A field to track convergence progress across iterations
_global_lower_bound::Float64
: The best-known lower bound
_global_upper_bound::Float64
: The best-known upper bound
_maximum_node_id::Int64
: The total number of nodes that have been created
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
_solution_value::Float64
: (Unused) The best-known solution value
_feasible_solution_found::Bool
: A flag for if a feasible solution was identified. Updated if preprocessing, lower problem, and upper problem all return feasible values
_solution_node::Int64
: The node ID of the best-known feasible upper problem solution (default = -1, if no feasible solution is found)
_best_upper_value::Float64
: The best-known upper bound
_obbt_working_lower_index::Vector{Bool}
: Indices of variables to perform OBBT on
_obbt_working_upper_index::Vector{Bool}
: Indices of variables to perform OBBT on
_lower_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkinglowerindex across iterations
_upper_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkingupperindex across iterations
_old_low_index::Vector{Bool}
: Storage for indices prior to OBBT step
_old_upp_index::Vector{Bool}
: Storage for indices prior to OBBT step
_new_low_index::Vector{Bool}
: New indices following OBBT step; compared with _old_low_index
_new_upp_index::Vector{Bool}
: New indices following OBBT step; compared with _old_upp_index
_obbt_variables::Vector{MathOptInterface.VariableIndex}
: (Deprecated) Variables to perform OBBT on. Replaced by _obbt_working_lower_index
and _obbt_working_upper_index
_obbt_variable_count::Int64
: The number of variables to perform OBBT on
_obbt_performed_flag::Bool
: (Unused) Flag to indicate whether OBBT has been performed
_lower_fbbt_buffer::Vector{Float64}
: Buffer for FBBT lower bounds. Set in presolve, used in preprocess
_upper_fbbt_buffer::Vector{Float64}
: Buffer for FBBT upper bounds. Set in presolve, used in preprocess
_cp_improvement::Float64
: (Unused) Improvement in constraint propagation
_cp_evaluation_reverse::Bool
: (Unused) Flag for if constraint propagation results need to be reversed
_cut_iterations::Int64
: Iterations of the cutting planes algorithm completed
_cut_add_flag::Bool
: (Unused) Flag to check if cuts should be added
_node_repetitions::Int64
: Counter for number of times a node is evaluated. If the repeat_check
function is overloaded to return true
, a node will not be branched on, but will instead be added back into the stack using single_storage!
. In this case, _node_repetitions
is incremented
_log::Log
: Storage for logging information during a branch-and-bound run
_affine_relax_ci::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
: Storage for affine constraints
_affine_objective_cut_ci::Union{Nothing, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for a linear objective cut constraint
_relaxed_variable_number::Int64
: (Unused) Number of relaxed variables
_relaxed_variable_index::Vector{MathOptInterface.VariableIndex}
: Indices of relaxed variables
_relaxed_variable_et::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Int64}}
: Stored EqualTo constraints
_relaxed_variable_lt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Int64}}
: Stored LessThan constraints
_relaxed_variable_gt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Int64}}
: Stored GreaterThan constraints
_relaxed_variable_integer::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
: Stored Integer constraints
_branch_variables::Vector{Bool}
: List of variables that can be branched on. If not user-specified, branch variables are identified in label_branch_variables!
_nonbranching_int::Bool
: (Unused) Flag for non-branching integers
_new_eval_constraint::Bool
: Flag indicating if an initial evaluation of the constraints has occurred
_new_eval_objective::Bool
: Flag indicating if the objective expression was evaluated
_node_to_sv_leq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for carrying LessThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_node_to_sv_geq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
: Storage for carrying GreaterThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_nonlinear_evaluator_created::Bool
: Flag to check for nonlinear evaluators. Set to true
in add_nonlinear_evaluator!
_branch_cost::EAGO.BranchCostStorage{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Storage for pseudocost branching
_branch_variable_sparsity::SparseArrays.SparseMatrixCSC{Bool, Int64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Sparsity information of the branch variables
_constraint_infeasiblity::Vector{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Information on the infeasibility of each constraint
EAGO.Incremental
— Typemutable struct Incremental{S<:MathOptInterface.AbstractOptimizer} <: MathOptInterface.AbstractOptimizer
A type-stable cache used to wrapper for an optimizer that enables incremental modification of solvers that don't inherently suppport this. Explicitly checks support of MOI functionality used in EAGO.
(Deprecated) For Q = Val{true}
, the subsolver supports incremental loading. For Q = Val{false}
, the subsolver does not.
EAGO.InputProblem
— Typemutable struct InputProblem
A structure used to hold objectives and constraints added to the EAGO model. The constraints generally aren't used for relaxations.
All field information available in extended help.
Extended Help
_variable_count::Int64
: Count for the number of variables
_variable_names::Dict{MathOptInterface.VariableIndex, String}
: Dictionary containing variable indices and their names
_constraint_count::Int64
: Count for the number of constraints
_vi_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
_vi_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
_vi_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}}
_vi_it_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}}
_vi_zo_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}}
_vi_int_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
_linear_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_conic_second_order::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}, Tuple{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}}
_linear_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_linear_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_linear_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_quadratic_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_quadratic_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_quadratic_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_linear_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_objective::Union{Nothing, MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarQuadraticFunction{Float64}}
: Storage for the objective function
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
: Storage for NLP constraints (set by MOI.set(m, ::NLPBlockData...)
in moi_wrapper.jl
)
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
EAGO.LocalResultStatus
— TypeLocalResultStatus
Status code used internally to determine how to interpret the results from the solution of a local problem solve.
EAGO.Log
— Typemutable struct Log
A structure used to store information on the history of the solution procedure for generating convergence plots and other analyses.
current_lower_bound::Vector{Float64}
: Storage for lower bound calculated for current node.
current_upper_bound::Vector{Float64}
: Storage for upper bound calculated for current node.
preprocessing_time::Vector{Float64}
: Storage for preprocessing time of each iteration.
lower_problem_time::Vector{Float64}
: Storage for lower bounding time of each iteration.
upper_problem_time::Vector{Float64}
: Storage for upper bounding time of each iteration.
postprocessing_time::Vector{Float64}
: Storage for postprocessing time of each iteration.
preprocessing_feas::Vector{Bool}
: Storage for preprocessing feasibility of each iteration.
lower_problem_feas::Vector{Bool}
: Storage for lower bounding feasibility of each iteration.
upper_problem_feas::Vector{Bool}
: Storage for upper bounding feasibility of each iteration.
postprocessing_feas::Vector{Bool}
: Storage for postprocessing feasibility of each iteration.
global_lower_bound::Vector{Float64}
: Storage for best (global) lower bound at each iteration.
global_upper_bound::Vector{Float64}
: Storage for best (global) upper bound at each iteration.
node_count::Vector{Int64}
: Number of nodes at each iteration.
run_time::Vector{Float64}
: Run time at each iteration.
EAGO.Node
— Typestruct Node <: EAGO.AbstractNode
Describes connectivity and expression represented by node.
EAGO.NodeBB
— Typestruct NodeBB
Store information associated with each node in the branch-and-bound tree.
lower_variable_bounds::Vector{Float64}
: Lower bounds of variable box.
upper_variable_bounds::Vector{Float64}
: Upper bounds of variable box.
is_integer::BitVector
: Is dimension integer valued
continuous::Bool
: Are all dimensions continuous (or fixed)
lower_bound::Float64
: Lower bound of problem solution on nodeBB
upper_bound::Float64
: Upper bound of problem solution on nodeBB
depth::Int64
: Depth of node in B&B tree.
cont_depth::Int64
: Depth of first parent in B&B tree that was continuously valued
id::Int64
: Unique ID for each node.
branch_direction::EAGO.BranchDirection
: Whether last branch was negative or positive in direction
last_branch::Int64
: Dimension of last branch
branch_extent::Float64
: Extent of last branch (using for psuedocost calculation)
EAGO.NodeClass
— TypeNodeType
Each node in the directed graph can be classified into the following types
EAGO.NonlinearExpression
— Typemutable struct NonlinearExpression{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general quadratic function with a buffer.
EAGO.Optimizer
— Typemutable struct Optimizer{Q, S, T} <: MathOptInterface.AbstractOptimizer
The highest level optimizer object used by EAGO to solve problems during the optimization routine. Additional options and temporary storage are located in the _global_optimizer::GlobalOptimizer{Q,S,T}
field. Parameters which are expected to be constant over the entire solve are stored in the _parameters::EAGOParameters
field. Some user-facing keywords not in the EAGOParameters
field include:
relaxed_optimizer::MOI.AbstractOptimizer
: An instance of the optimizer used to solve the relaxed subproblems (default = Cbc.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.upper_optimizer::MOI.AbstractOptimizer
: Optimizer used to solve upper bounding problems (default = Ipopt.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.ext::ExtensionType
: Holds an instance of a subtype of EAGO.ExtensionType
, used to define new custom subroutines (default = DefaultExt()
). Located in subsolver_block::SubSolvers{Q,S,T}
.enable_optimize_hook::Bool
: Specifies that the user-defined optimize_hook!
function should be called rather than use the standard EAGO optimization routines. Located in Optimizer
and _global_optimizer::GlobalOptimizer{Q,S,T}
.obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions). Located in _global_optimizer::GlobalOptimizer{Q,S,T}
.Descriptions of all Optimizer
fields available in extended help.
Extended Help
subsolver_block::SubSolvers{Q, S, T} where {Q, S, T}
: Holds definitions of the relaxed and upper optimizers, as well as any user-defined extension types
enable_optimize_hook::Bool
: Specifies that the optimize_hook! function should be called rather than throw the problem to the standard routine
ext::Union{Nothing, T} where T
: (Deprecated, use subsolver_block
instead) Storage for custom extension types
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
_global_optimizer::GlobalOptimizer{Q, S, T} where {Q, S, T}
: Additional options and temporary storage for solving optimization problems
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_optimizer_attributes_set::Vector{MathOptInterface.AbstractOptimizerAttribute}
: Set of optimizer attributes
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_run_time::Float64
: Optimization run time
_objective_value::Float64
: The objective value of the primal solution
_objective_bound::Float64
: The best-known bound on the optimal objective value
_relative_gap::Float64
: The gap between the upper and lower bound, relative to the bound with the larger magnitude
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
EAGO.ParsedProblem
— Typemutable struct ParsedProblem
A structure used to store expressions and problem descriptions EAGO uses to formulate relaxed problems.
All field information available in extended help.
Extended Help
_problem_type::Union{Nothing, EAGO.DIFF_CVX, EAGO.LP, EAGO.MILP, EAGO.MINCVX, EAGO.MISOCP, EAGO.SOCP}
: Problem classification (set in parse_classify_problem!
)
_objective_saf::MathOptInterface.ScalarAffineFunction{Float64}
: Stores the objective and is used for constructing linear affine cuts
_objective::Union{Nothing, MathOptInterface.VariableIndex, EAGO.AffineFunctionIneq, EAGO.BufferedQuadraticIneq, EAGO.BufferedNonlinearFunction}
: Storage for the objective function
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
_saf_leq::Vector{EAGO.AffineFunctionIneq}
_saf_eq::Vector{EAGO.AffineFunctionEq}
_sqf_leq::Vector{EAGO.BufferedQuadraticIneq}
_sqf_eq::Vector{EAGO.BufferedQuadraticEq}
_conic_second_order::Vector{EAGO.BufferedSOC}
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
_nonlinear_constr::Vector{EAGO.BufferedNonlinearFunction}
_relaxed_evaluator::Evaluator
_variable_info::Vector{VariableInfo{Float64}}
: Variable information (set in initial_parse!
)
_variable_count::Int64
: Count for the number of variables
EAGO.Relax
— TypeRelax
Used to dispatch relaxations to a standard
EAGO.RelaxAA
— TypeRelaxAA
EAGO.RelaxMulEnum
— TypeRelaxMulEnum
EAGO.RelaxResultStatus
— TypeRelaxResultStatus
Status code used internally to determine how to interpret the results from the solution of a relaxed problem.
EAGO.SIPHybrid
— TypeSIPHybrid
Specifies that the SIPHybrid algorithm which implements Algorithm #2 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPProblem
— Type SIPProblem
Structure storing problem information for the solution routine.
EAGO.SIPRes
— TypeSIPRes
Specifies that the SIPRes algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResRev
— TypeSIPResRev
Specifies that the SIPResRev algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResult
— TypeSIPResult
Structure storing the results of the SIPRes
algorithm.
EAGO.SIPSubResult
— TypeSIPBuffer
Hold objective value, solution, discretization set, and feasibility status of each subproblem encountered by SIP algorithm.
EAGO.SubSolvers
— Typemutable struct SubSolvers{Q<:MathOptInterface.AbstractOptimizer, S<:MathOptInterface.AbstractOptimizer, T<:ExtensionType}
A structure containing the relaxed and upper optimizers to be used, as well as any user-defined extension.
relaxed_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve relaxed subproblems. Set using r = [...]
(<: MOI.AbstractOptimizer
) (default = Cbc.Optimizer()
)
upper_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve upper bounding problems. Set using u = [...]
(<: MOI.AbstractOptimizer
) (default = Ipopt.Optimizer()
)
ext::ExtensionType
: User-defined extension to use. Set using t = [...]
(<: EAGO.ExtensionType
)
EAGO.VariableInfo
— Typestruct VariableInfo{T<:AbstractFloat}
A structure used to store information related to the bounds assigned to each variable.
is_integer::Bool
: Is the variable integer valued?
has_lower_bound::Bool
: Boolean indicating whether a finite lower bound exists.
has_upper_bound::Bool
: Boolean indicating whether a finite upper bound exists.
is_fixed::Bool
: Boolean indicating if variable is fixed to a finite value.
has_constraints::Bool
: Boolean indicating that constraints have been set
lower_bound::AbstractFloat
: Lower bound. May be -Inf.
upper_bound::AbstractFloat
: Upper bound. May be Inf.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
We're always happy to welcome work with additional collaborators and contributors. One of the easy ways for newcomers to contribute is by adding additional McCormick relaxations.
If you have any requests for additional functionality, bug fixes, or comments, please feel free to open a new issue using the GitHub issue tracker or reach out to us.
Please direct technical issues and/or bugs to the active developers:
All other questions should be directed to Prof. Stuber.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
We're always happy to welcome work with additional collaborators and contributors. One of the easy ways for newcomers to contribute is by adding additional McCormick relaxations.
If you have any requests for additional functionality, bug fixes, or comments, please feel free to open a new issue using the GitHub issue tracker or reach out to us.
Please direct technical issues and/or bugs to the active developers:
All other questions should be directed to Prof. Stuber.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This example is also provided here as a Jupyter Notebook.
In this example, we will demonstrate the use of a user-defined lower-bounding problem that uses $\alpha$BB convex relaxations. In this example, we wish to solve the nonconvex quadratically constrained quadratic program (QCQP):
\[\begin{aligned} +
This example is also provided here as a Jupyter Notebook.
In this example, we will demonstrate the use of a user-defined lower-bounding problem that uses $\alpha$BB convex relaxations. In this example, we wish to solve the nonconvex quadratically constrained quadratic program (QCQP):
\[\begin{aligned} & \min_{\mathbf x \in \mathbb{IR}^{2}} \frac{1}{2} \mathbf x^{\rm T} \mathbf Q_{f} \mathbf x + \mathbf c_{f}^{\rm T} \mathbf x \\ {\rm s.t.} \; \; & g_{1}(\mathbf x) = \frac{1}{2} \mathbf x^{\rm T} \mathbf Q_{g_{1}}\mathbf x + \mathbf c_{g_{1}}^{\rm T} \mathbf x \leq 0 \\ & g_{2}(\mathbf x) = \frac{1}{2} \mathbf x^{\rm T} \mathbf Q_{g_{2}} \mathbf x + \mathbf c_{g_{2}}^{\rm T} \mathbf x \leq 0 \\ @@ -106,4 +106,4 @@ JuMP.value(x[2])," f* = ",JuMP.objective_value(m)) TermStatus = JuMP.termination_status(m) PrimStatus = JuMP.primal_status(m) -println("Algorithm terminated with a status of $TermStatus and result code of $PrimStatus")
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This example is also provided here as a Jupyter Notebook.
In [1, 2], a surrogate artificial neural network (ANN) model of bioreactor productivity was constructed by fitting results from computationally expensive computational fluid dynamics (CFD) simulations. The authors then optimized this surrogate model to obtain ideal processing conditions. The optimization problem is given by:
\[\begin{aligned} +
This example is also provided here as a Jupyter Notebook.
In [1, 2], a surrogate artificial neural network (ANN) model of bioreactor productivity was constructed by fitting results from computationally expensive computational fluid dynamics (CFD) simulations. The authors then optimized this surrogate model to obtain ideal processing conditions. The optimization problem is given by:
\[\begin{aligned} \max_{\mathbf x \in X} B_{2} + \sum_{r = 1}^{3} W_{2,r} \frac{2}{1 + \exp (-2y_{r} + B_{1,r})} \; \; {\rm where} \; \; y_{r} = \sum_{i = 1}^{8} W_{1,ir} x_{i} \end{aligned}\]
In the first block, we input parameters values supplied in the paper for $W_1$, $W_2$, $B_1$, and $B_2$ into Julia as simple array objects. We also input bounds for the variables which are used to scale the values obtained from optimization from $[-1, 1]$ back into the design values.
using JuMP, EAGO
@@ -41,4 +41,4 @@
rescaled_xsol = ((xsol .+ 1.0)./2.0).*(xUBD - xLBD) .+ xLBD
println("Rescaled optimal value and solution values:")
println("The rescaled optimal value is: $(round(rescaled_fval, digits=4))")
-println("The rescaled solution is $(round.(rescaled_xsol, digits=3)).")
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This example is also provided here as a Jupyter Notebook.
In this section, we construct an optimizer that uses EAGO's basic NLP solution routine with user-defined lower and upper-bounding problems. The Optimizer
structure supplies a number of parameters and stored structures that advanced users may find useful for constructing specialized solution routines.
In this example, we'll forgo extensive integration into the Optimizer
and simply replace the lower and upper-bounding problems to construct a B&B routine that solves the following problem to global optimality using bounds obtained from interval arithmetic:
\[\begin{aligned} +
This example is also provided here as a Jupyter Notebook.
In this section, we construct an optimizer that uses EAGO's basic NLP solution routine with user-defined lower and upper-bounding problems. The Optimizer
structure supplies a number of parameters and stored structures that advanced users may find useful for constructing specialized solution routines.
In this example, we'll forgo extensive integration into the Optimizer
and simply replace the lower and upper-bounding problems to construct a B&B routine that solves the following problem to global optimality using bounds obtained from interval arithmetic:
\[\begin{aligned} & \min_{\mathbf x \in X} \; \; \sin(x_{1}) x_{2}^{2} - \cos(x_{3}) / x_{4} \\ & X = [-10, 10] \times [-1, 1] \times [-10, 10] \times [2, 20]. \end{aligned}\]
We begin by importing EAGO, IntervalArithmetic [1], and JuMP [2].
using EAGO, IntervalArithmetic, JuMP
We now define the IntervalExt
struct as a subtype of the ExtensionType
.
struct IntervalExt <: EAGO.ExtensionType end
A valid lower bound is obtained from the lower bound of the natural interval extension using the IntervalArithmetic.jl [1] package. The LowerProblem
is dispatched using the new IntervalExt
structure and the GlobalOptimizer
structure, computes the bound using interval arithmetic, and stores the results to the appropriate field of the GlobalOptimizer
. Note that the problem is unconstrained on the domain so we can assume it is always feasible. Further, since the interval bound is constrained along the entire domain associated with a node, no additional cuts will be beneficial and thus we've disabled them using the _cut_add_flag
field.
import EAGO: lower_problem!
@@ -63,4 +63,4 @@
status_prim = JuMP.primal_status(m)
println("EAGO terminated with a status of $status_term and a result code of $status_prim")
-println("The optimal value is: $(round(fval, digits=3)), the solution found is $(round.(xsol, digits=4)).")
The default lower_problem!
and upper_problem!
should be used as templates for error handling and retrieving information from MOI models.
Essentially all of EAGO's subroutines stored to a field in the Optimizer
structure can be reset as user-defined functions.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
The default lower_problem!
and upper_problem!
should be used as templates for error handling and retrieving information from MOI models.
Essentially all of EAGO's subroutines stored to a field in the Optimizer
structure can be reset as user-defined functions.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This example is also provided here as a Jupyter Notebook.
In this example, we'll adapt EAGO to implement the bisection-based algorithm used to solve a quasiconvex optimization problem presented in [1]:
\[\begin{aligned} +
This example is also provided here as a Jupyter Notebook.
In this example, we'll adapt EAGO to implement the bisection-based algorithm used to solve a quasiconvex optimization problem presented in [1]:
\[\begin{aligned} f^{*} = & \min_{\mathbf y \in Y} f(\mathbf y) \\ {\rm s.t.} \; \; & \sum_{i = 1}^{5} i \cdot y_{i} - 5 = 0 \\ & \sum_{i = 1}^{5} y_{i}^{2} - 0.5 \pi \leq 0 \\ @@ -75,4 +75,4 @@ JuMP.optimize!(m)
We then recover the solution values and the objective value using standard JuMP syntax.
solution = JuMP.value.(y[1:5])
global_obj_value = JuMP.value.(y[6])
-print("Global solution at y*=$solution with a value of f*=$global_obj_value")
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
A development environment for robust and global optimization in Julia.
If you would like to contribute, contact us.
EAGO is a global and robust optimization platform based on McCormick relaxations. It contains the first widely accessible global optimization routine based on generalized McCormick relaxations. With the exception of calls to local solvers and linear algebra routines, EAGO is written entirely in native Julia. The solver is flexibly arranged so the end user can easily customize low-level routines.
EAGO is a registered Julia package and it can be installed using the Julia package manager. From the Julia REPL, type ]
to enter the Package manager (Pkg) mode and run the following command:
pkg> add EAGO
Currently, EAGO is compatible with version 1.12 of JuMP. This allows a replication of some of the internal features shared by EAGO and JuMP's automatic differentiation scheme, e.g., generation of Wengert Tapes, passing evaluators between JuMP and EAGO, etc.
pkg> add JuMP
EAGO v0.8.1 is the current tagged version and requires Julia 1.6+ for full functionality (however Julia 1.0+ versions support partial functionality). Use with version 1.8 is recommended as the majority of in-house testing has occurred using this version of Julia. The user is directed to the High-Performance Configuration for instructions on how to install a high performance version of EAGO (rather than the basic entirely open-source version). If any issues are encountered when loading EAGO (or when using it), please submit an issue using the GitHub issue tracker.
Several examples are provided within this documentation, but additional examples are provided in the form of Jupyter Notebooks at EAGO-notebooks which can be run using IJulia. To add IJulia, run the command:
pkg> add IJulia
Then launch the Jupyter Notebook using the following command from the Julia terminal:
julia> using IJulia; notebook()
And then simply navigate to the example directory and run the example of most interest.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
A development environment for robust and global optimization in Julia.
If you would like to contribute, contact us.
EAGO is a global and robust optimization platform based on McCormick relaxations. It contains the first widely accessible global optimization routine based on generalized McCormick relaxations. With the exception of calls to local solvers and linear algebra routines, EAGO is written entirely in native Julia. The solver is flexibly arranged so the end user can easily customize low-level routines.
EAGO is a registered Julia package and it can be installed using the Julia package manager. From the Julia REPL, type ]
to enter the Package manager (Pkg) mode and run the following command:
pkg> add EAGO
Currently, EAGO is compatible with version 1.12 of JuMP. This allows a replication of some of the internal features shared by EAGO and JuMP's automatic differentiation scheme, e.g., generation of Wengert Tapes, passing evaluators between JuMP and EAGO, etc.
pkg> add JuMP
EAGO v0.8.1 is the current tagged version and requires Julia 1.6+ for full functionality (however Julia 1.0+ versions support partial functionality). Use with version 1.8 is recommended as the majority of in-house testing has occurred using this version of Julia. The user is directed to the High-Performance Configuration for instructions on how to install a high performance version of EAGO (rather than the basic entirely open-source version). If any issues are encountered when loading EAGO (or when using it), please submit an issue using the GitHub issue tracker.
Several examples are provided within this documentation, but additional examples are provided in the form of Jupyter Notebooks at EAGO-notebooks which can be run using IJulia. To add IJulia, run the command:
pkg> add IJulia
Then launch the Jupyter Notebook using the following command from the Julia terminal:
julia> using IJulia; notebook()
And then simply navigate to the example directory and run the example of most interest.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO is an open-source development environment for robust and global optimization in Julia. See the full README for more information.
PSOR Lab | Current Version | Build Status | Documentation |
---|---|---|---|
EAGO is a deterministic global optimizer designed to address a wide variety of optimization problems, emphasizing nonlinear programs (NLPs), by propagating McCormick relaxations along the factorable structure of each expression in the NLP. Most operators supported by modern automatic differentiation (AD) packages are supported by EAGO and a number utilities for sanitizing native Julia code and generating relaxations on a wide variety of user-defined functions have been included. Currently, EAGO supports problems that have a priori variable bounds defined and have differentiable constraints. That is, problems should be specified in the generic form below:
\[\begin{aligned} +
EAGO is an open-source development environment for robust and global optimization in Julia. See the full README for more information.
PSOR Lab | Current Version | Build Status | Documentation |
---|---|---|---|
EAGO is a deterministic global optimizer designed to address a wide variety of optimization problems, emphasizing nonlinear programs (NLPs), by propagating McCormick relaxations along the factorable structure of each expression in the NLP. Most operators supported by modern automatic differentiation (AD) packages are supported by EAGO and a number utilities for sanitizing native Julia code and generating relaxations on a wide variety of user-defined functions have been included. Currently, EAGO supports problems that have a priori variable bounds defined and have differentiable constraints. That is, problems should be specified in the generic form below:
\[\begin{aligned} f^{*} = & \min_{\mathbf y \in Y \subset \mathbb R^{n_{y}}} f(\mathbf y) \\ {\rm s.t.} \; \; & \mathbf h(\mathbf y) = \mathbf 0 \\ & \mathbf g(\mathbf y) \leq \mathbf 0 \\ @@ -67,4 +67,4 @@ doi = {10.1080/10556788.2020.1786566}, URL = {https://doi.org/10.1080/10556788.2020.1786566}, eprint = {https://doi.org/10.1080/10556788.2020.1786566} -}
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
McCormick.implicit_relax_h!
— Functionimplicit_relax_h!(d)
+Relaxation of Implicit Functions · EAGO.jl Relaxation of Implicit Functions
High-Level Functions
McCormick.implicit_relax_h!
— Functionimplicit_relax_h!(d)
implicit_relax_h!(d, interval_bnds)
-
Compute relaxations of x(p)
defined by h(x,p) = 0
where h
is specifed as h(out, x, p)
.
sourceData Structures
McCormick.AbstractContractorMC
— Typeabstract type AbstractContractorMC
An abstract type for each manner of contractor using in the implicit function relaxation algorithms.
sourceMcCormick.NewtonGS
— Typestruct NewtonGS <: McCormick.AbstractContractorMC
The Gauss-Seidel implementation of the Newton contractor used in the implicit relaxation scheme.
sourceMcCormick.KrawczykCW
— Typestruct KrawczykCW <: McCormick.AbstractContractorMC
The componentwise implementation of the Krawczyk contractor used in the implicit relaxation scheme.
sourceMcCormick.AbstractPreconditionerMC
— Typeabstract type AbstractPreconditionerMC
An abstract type for each manner of preconditioner used in the implicit function relaxation algorithms.
sourceMcCormick.DenseMidInv
— Typestruct DenseMidInv{S<:VecOrMat{Float64}} <: McCormick.AbstractPreconditionerMC
A dense LU preconditioner for implicit McCormick relaxation.
sourceMcCormick.AbstractMCCallback
— Typeabstract type AbstractMCCallback
An abstract type for each manner of callback functions used in the implicit function relaxation algorithms.
sourceMcCormick.MCCallback
— Typemutable struct MCCallback{FH, FJ, C<:McCormick.AbstractContractorMC, PRE<:McCormick.AbstractPreconditionerMC, N, T<:RelaxTag, AMAT<:(AbstractMatrix)} <: AbstractMCCallback
A structure used to compute implicit relaxations.
h!::Any
: Function h(x,p) = 0 defined in place by h!(out,x,p)
hj!::Any
: Jacobian of h(x,p) w.r.t x
H::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Intermediate inplace storage for output of h!
J::AbstractMatrix
: Intermediate inplace storage for output of hj!
J0::Vector{AMAT} where AMAT<:(AbstractMatrix)
xz0::Vector{AMAT} where AMAT<:(AbstractMatrix)
xmid::Vector{Float64}
X::Vector{Interval{Float64}}
: State space x
interval bounds
P::Vector{Interval{Float64}}
: Decision space p
interval bounds
nx::Int64
: State space dimension
np::Int64
: Decision space dimension
λ::Float64
: Convex combination parameter
eps::Float64
: Tolerance for interval equality
kmax::Int64
: Number of contractor steps to take
pref_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Reference decision point at which affine relaxations are calculated (and used in subsequent calculations).
p_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Decision point at which relaxation is evaluated.
p_temp_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Vector used to temporarily store p in genexpansionparams! routine.
x0_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
x_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
xa_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
xA_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
aff_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
z_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
contractor::McCormick.AbstractContractorMC
: Type of contractor used in implicit relaxation routine.
preconditioner::McCormick.AbstractPreconditionerMC
: Preconditioner used in the implicit relaxation routine.
apply_precond::Bool
: Boolean indicating that the preconditioner should be applied
param::Array{Array{MC{N, T}, 1}, 1} where {N, T<:RelaxTag}
: Vector of relaxations of x
at each iteration used to generated affine relaxations used in intermediate calculation.
use_apriori::Bool
: Indicates that subgradient-based apriori relaxations of multiplication should be used.
sourceSubroutines
McCormick.preconditioner_storage
— Functionpreconditioner_storage(x, t)
-
Creates storage corresponding to x::AbstractPreconditionerMC
and t::T where T<:RelaxTag
.
sourceMcCormick.affine_exp!
— Functionaffine_exp!(x, p, d)
-
Computates the affine relaxations of the state variable.
sourceMcCormick.correct_exp!
— Functioncorrect_exp!(d)
-
Corrects the relaxation of the state variable x_mc
if the affine relaxation,
sourceMcCormick.contract!
— FunctionPerforms a single step of the parametric method associated with t
assumes that the inputs have been preconditioned.
sourceMcCormick.precond_and_contract!
— Functionprecond_and_contract!(d!, k, b)
-
sourceMcCormick.final_cut
— Functionfinal_cut(x, y)
-
An operator that cuts the x
object using the y bounds
in a differentiable or nonsmooth fashion to achieve a composite relaxation within y
.
sourceMcCormick.gen_expansion_params!
— Functiongen_expansion_params!(d)
+
Compute relaxations of x(p)
defined by h(x,p) = 0
where h
is specifed as h(out, x, p)
.
sourceData Structures
McCormick.AbstractContractorMC
— Typeabstract type AbstractContractorMC
An abstract type for each manner of contractor using in the implicit function relaxation algorithms.
sourceMcCormick.NewtonGS
— Typestruct NewtonGS <: McCormick.AbstractContractorMC
The Gauss-Seidel implementation of the Newton contractor used in the implicit relaxation scheme.
sourceMcCormick.KrawczykCW
— Typestruct KrawczykCW <: McCormick.AbstractContractorMC
The componentwise implementation of the Krawczyk contractor used in the implicit relaxation scheme.
sourceMcCormick.AbstractPreconditionerMC
— Typeabstract type AbstractPreconditionerMC
An abstract type for each manner of preconditioner used in the implicit function relaxation algorithms.
sourceMcCormick.DenseMidInv
— Typestruct DenseMidInv{S<:VecOrMat{Float64}} <: McCormick.AbstractPreconditionerMC
A dense LU preconditioner for implicit McCormick relaxation.
sourceMcCormick.AbstractMCCallback
— Typeabstract type AbstractMCCallback
An abstract type for each manner of callback functions used in the implicit function relaxation algorithms.
sourceMcCormick.MCCallback
— Typemutable struct MCCallback{FH, FJ, C<:McCormick.AbstractContractorMC, PRE<:McCormick.AbstractPreconditionerMC, N, T<:RelaxTag, AMAT<:(AbstractMatrix)} <: AbstractMCCallback
A structure used to compute implicit relaxations.
h!::Any
: Function h(x,p) = 0 defined in place by h!(out,x,p)
hj!::Any
: Jacobian of h(x,p) w.r.t x
H::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Intermediate inplace storage for output of h!
J::AbstractMatrix
: Intermediate inplace storage for output of hj!
J0::Vector{AMAT} where AMAT<:(AbstractMatrix)
xz0::Vector{AMAT} where AMAT<:(AbstractMatrix)
xmid::Vector{Float64}
X::Vector{Interval{Float64}}
: State space x
interval bounds
P::Vector{Interval{Float64}}
: Decision space p
interval bounds
nx::Int64
: State space dimension
np::Int64
: Decision space dimension
λ::Float64
: Convex combination parameter
eps::Float64
: Tolerance for interval equality
kmax::Int64
: Number of contractor steps to take
pref_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Reference decision point at which affine relaxations are calculated (and used in subsequent calculations).
p_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Decision point at which relaxation is evaluated.
p_temp_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
: Vector used to temporarily store p in genexpansionparams! routine.
x0_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
x_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
xa_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
xA_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
aff_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
z_mc::Array{MC{N, T}, 1} where {N, T<:RelaxTag}
contractor::McCormick.AbstractContractorMC
: Type of contractor used in implicit relaxation routine.
preconditioner::McCormick.AbstractPreconditionerMC
: Preconditioner used in the implicit relaxation routine.
apply_precond::Bool
: Boolean indicating that the preconditioner should be applied
param::Array{Array{MC{N, T}, 1}, 1} where {N, T<:RelaxTag}
: Vector of relaxations of x
at each iteration used to generated affine relaxations used in intermediate calculation.
use_apriori::Bool
: Indicates that subgradient-based apriori relaxations of multiplication should be used.
sourceSubroutines
McCormick.preconditioner_storage
— Functionpreconditioner_storage(x, t)
+
Creates storage corresponding to x::AbstractPreconditionerMC
and t::T where T<:RelaxTag
.
sourceMcCormick.affine_exp!
— Functionaffine_exp!(x, p, d)
+
Computates the affine relaxations of the state variable.
sourceMcCormick.correct_exp!
— Functioncorrect_exp!(d)
+
Corrects the relaxation of the state variable x_mc
if the affine relaxation,
sourceMcCormick.contract!
— FunctionPerforms a single step of the parametric method associated with t
assumes that the inputs have been preconditioned.
sourceMcCormick.precond_and_contract!
— Functionprecond_and_contract!(d!, k, b)
+
sourceMcCormick.final_cut
— Functionfinal_cut(x, y)
+
An operator that cuts the x
object using the y bounds
in a differentiable or nonsmooth fashion to achieve a composite relaxation within y
.
sourceMcCormick.gen_expansion_params!
— Functiongen_expansion_params!(d)
gen_expansion_params!(d, interval_bnds)
-
Constructs parameters need to compute relaxations of h
.
sourceMcCormick.populate_affine!
— Functionpopulate_affine!(d, interval_bnds)
-
Populates x_mc
, xa_mc
, xA_mc
, and z_mc
with affine bounds.
sourceSettings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+
Constructs parameters need to compute relaxations of h
.
McCormick.populate_affine!
— Functionpopulate_affine!(d, interval_bnds)
+
Populates x_mc
, xa_mc
, xA_mc
, and z_mc
with affine bounds.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
The operators currently supported are listed below. The operators with a check box have been subject to a large degree of scrutiny and have been implemented for both forward and reverse McCormick relaxations (Wechsung2015). Each McCormick object is associated with a parameter T <: RelaxTag
which is either NS
for nonsmooth relaxations (Mitsos2009, Scott2011), MV
for multivariate relaxations (Tsoukalas2014, Najman2017), or Diff
for differentiable relaxations (Khan2016, Khan2018, Khan2019). Conversion between NS
, MV
, and Diff
relax tags is not currently supported. Convex and concave envelopes are used to compute relaxations of univariate functions.
Arbitrarily differentiable relaxations can be constructed for the following operators:
inv
)log
, log2
, log10
)exp
, exp2
, exp10
)sqrt
)abs
)Both nonsmooth and Whitney-1 (once differentiable) relaxations are supported for the following operators:
step
, sign
)sin
, cos
, tan
)asin
, acos
, atan
)sinh
, cosh
, tanh
)asinh
, acosh
, atanh
)relu
, leaky_relu
, param_relu
, sigmoid
, bisigmoid
, softsign
, softplu
s, maxtanh
, pentanh
, gelu
, elu
, selu
, swish
)erf
)The following bivariate operators are supported for two MC
objects. Both nonsmooth and Whitney-1 (once differentiable) relaxations are supported.
*
)/
)Arbitrarily differentiable relaxations can be constructed for the following operators:
+
)-
)min
)max
)The following functions can be used in place of common subexpressions encountered in optimization and will result in improved performance (in each case, the standard McCormick composition rules are often more expansive).
McCormick.xexpax
— Functionexpax
The expax
function is defined as expax(x, a) = x*exp(a*x)
.
Form defined in Najman, Jaromił, Dominik Bongartz, and Alexander Mitsos. "Relaxations of thermodynamic property and costing models in process engineering." Computers & Chemical Engineering 130 (2019): 106571.
McCormick.arh
— Functionarh
The arrhenius function arh
is defined as arh(x) = exp(-k/x)
.
McCormick.xlogx
— Functionxlogx
The function xlogx
is defined as xlogx(x) = x*log(x)
.
McCormick.mm
— Functionmm(X,v,K) = v*X / (X + K)
A Michaelis-Menten rate function.
The following functions are used to specify that known bounds on a subexpression exist and that the relaxation/interval bounds propagated should make use of this information. The utility functions can be helpful in avoiding domain violations that arise due to the overly expansive nature of composite relaxations. Improper use of these functions may lead to cases in which the resulting relaxations are empty, so the user is encouraged to use discretion.
McCormick.positive
— Functionpositive(x::MC)
Sets the lower interval bound and the convex relaxation of x
to a value of at least McCormick.MC_DOMAIN_TOL
. (Sub)gradients are adjusted appropriately.
McCormick.negative
— Functionnegative(x::MC)
Sets the upper interval bound and the concave relaxation of x
to a value of at most -McCormick.MC_DOMAIN_TOL
. (Sub)gradients are adjusted appropriately.
McCormick.lower_bnd
— Functionlower_bnd(x::MC, lb::Float64)
Sets the lower interval bound and the convex relaxation of x
to a value of at least lb
. (Sub)gradients are adjusted appropriately.
McCormick.upper_bnd
— Functionupper_bnd(x::MC, ub)
Sets the upper interval bound and the concave relaxation of x
to a value of at most ub
. (Sub)gradients are adjusted appropriately.
McCormick.bnd
— Functionbnd(x::MC, lb, ub)
Sets the lower interval bound and the convex relaxation of x
to a value of at least lb
. Sets the upper interval bound and the concave relaxation of x
to a value of at most ub
. (Sub)gradients are adjusted appropriately.
McCormick.pentanh
— Functionpentanh
The pentanh
activation function pentanh(x) = x > 0.0 ? tanh(x) : tanh(0.25*x)
.
McCormick.leaky_relu
— Functionleaky_relu
The leaky Rectified Linear Unit activation function leaky_relu(x) = max(x, 0.01x)
.
McCormick.param_relu
— Functionparam_relu
The parametric Rectified Linear Unit activation function param_relu(x, α) = (max(x, αx)
with α in [0,1].
McCormick.maxtanh
— Functionmaxtanh
The maxtanh
activation function maxtanh(x) = max(x, tanh(x))
.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
The operators currently supported are listed below. The operators with a check box have been subject to a large degree of scrutiny and have been implemented for both forward and reverse McCormick relaxations (Wechsung2015). Each McCormick object is associated with a parameter T <: RelaxTag
which is either NS
for nonsmooth relaxations (Mitsos2009, Scott2011), MV
for multivariate relaxations (Tsoukalas2014, Najman2017), or Diff
for differentiable relaxations (Khan2016, Khan2018, Khan2019). Conversion between NS
, MV
, and Diff
relax tags is not currently supported. Convex and concave envelopes are used to compute relaxations of univariate functions.
Arbitrarily differentiable relaxations can be constructed for the following operators:
inv
)log
, log2
, log10
)exp
, exp2
, exp10
)sqrt
)abs
)Both nonsmooth and Whitney-1 (once differentiable) relaxations are supported for the following operators:
step
, sign
)sin
, cos
, tan
)asin
, acos
, atan
)sinh
, cosh
, tanh
)asinh
, acosh
, atanh
)relu
, leaky_relu
, param_relu
, sigmoid
, bisigmoid
, softsign
, softplu
s, maxtanh
, pentanh
, gelu
, elu
, selu
, swish
)erf
)The following bivariate operators are supported for two MC
objects. Both nonsmooth and Whitney-1 (once differentiable) relaxations are supported.
*
)/
)Arbitrarily differentiable relaxations can be constructed for the following operators:
+
)-
)min
)max
)The following functions can be used in place of common subexpressions encountered in optimization and will result in improved performance (in each case, the standard McCormick composition rules are often more expansive).
McCormick.xexpax
— Functionexpax
The expax
function is defined as expax(x, a) = x*exp(a*x)
.
Form defined in Najman, Jaromił, Dominik Bongartz, and Alexander Mitsos. "Relaxations of thermodynamic property and costing models in process engineering." Computers & Chemical Engineering 130 (2019): 106571.
McCormick.arh
— Functionarh
The arrhenius function arh
is defined as arh(x) = exp(-k/x)
.
McCormick.xlogx
— Functionxlogx
The function xlogx
is defined as xlogx(x) = x*log(x)
.
McCormick.mm
— Functionmm(X,v,K) = v*X / (X + K)
A Michaelis-Menten rate function.
The following functions are used to specify that known bounds on a subexpression exist and that the relaxation/interval bounds propagated should make use of this information. The utility functions can be helpful in avoiding domain violations that arise due to the overly expansive nature of composite relaxations. Improper use of these functions may lead to cases in which the resulting relaxations are empty, so the user is encouraged to use discretion.
McCormick.positive
— Functionpositive(x::MC)
Sets the lower interval bound and the convex relaxation of x
to a value of at least McCormick.MC_DOMAIN_TOL
. (Sub)gradients are adjusted appropriately.
McCormick.negative
— Functionnegative(x::MC)
Sets the upper interval bound and the concave relaxation of x
to a value of at most -McCormick.MC_DOMAIN_TOL
. (Sub)gradients are adjusted appropriately.
McCormick.lower_bnd
— Functionlower_bnd(x::MC, lb::Float64)
Sets the lower interval bound and the convex relaxation of x
to a value of at least lb
. (Sub)gradients are adjusted appropriately.
McCormick.upper_bnd
— Functionupper_bnd(x::MC, ub)
Sets the upper interval bound and the concave relaxation of x
to a value of at most ub
. (Sub)gradients are adjusted appropriately.
McCormick.bnd
— Functionbnd(x::MC, lb, ub)
Sets the lower interval bound and the convex relaxation of x
to a value of at least lb
. Sets the upper interval bound and the concave relaxation of x
to a value of at most ub
. (Sub)gradients are adjusted appropriately.
McCormick.pentanh
— Functionpentanh
The pentanh
activation function pentanh(x) = x > 0.0 ? tanh(x) : tanh(0.25*x)
.
McCormick.leaky_relu
— Functionleaky_relu
The leaky Rectified Linear Unit activation function leaky_relu(x) = max(x, 0.01x)
.
McCormick.param_relu
— Functionparam_relu
The parametric Rectified Linear Unit activation function param_relu(x, α) = (max(x, αx)
with α in [0,1].
McCormick.maxtanh
— Functionmaxtanh
The maxtanh
activation function maxtanh(x) = max(x, tanh(x))
.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO provides a library of McCormick relaxations in native Julia code. The EAGO optimizer supports relaxing functions using nonsmooth McCormick relaxations (Mitsos2009, Scott2011), smooth McCormick relaxations (Khan2016, Khan2018, Khan2019), and multi-variant McCormick relaxations (Tsoukalas2014; a variant of subgradient-based interval refinement (Najman2017)). For functions with arbitrarily differentiable relaxations, the differentiable constant μ can be modified by adjusting a constant value in the package. Additionally, validated and nonvalidated interval bounds are supported via IntervalArithmetic.jl which is reexported. The basic McCormick operator and reverse McCormick operator (Wechsung2015) libraries are included in two dependent subpackages which can loaded and used independently:
When a relaxation is computed at an undefined point or over an unbounded domain, the resulting relaxation is defined as "not a number" (NaN
) rather than throwing an error. This allows algorithms to check for these cases without resorting to try-catch
statements. Moreover, when the interval domain is extensive enough to cause a domain violation, an x::MC
structure is returned that satisfies isnan(x) === true
.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
EAGO provides a library of McCormick relaxations in native Julia code. The EAGO optimizer supports relaxing functions using nonsmooth McCormick relaxations (Mitsos2009, Scott2011), smooth McCormick relaxations (Khan2016, Khan2018, Khan2019), and multi-variant McCormick relaxations (Tsoukalas2014; a variant of subgradient-based interval refinement (Najman2017)). For functions with arbitrarily differentiable relaxations, the differentiable constant μ can be modified by adjusting a constant value in the package. Additionally, validated and nonvalidated interval bounds are supported via IntervalArithmetic.jl which is reexported. The basic McCormick operator and reverse McCormick operator (Wechsung2015) libraries are included in two dependent subpackages which can loaded and used independently:
When a relaxation is computed at an undefined point or over an unbounded domain, the resulting relaxation is defined as "not a number" (NaN
) rather than throwing an error. This allows algorithms to check for these cases without resorting to try-catch
statements. Moreover, when the interval domain is extensive enough to cause a domain violation, an x::MC
structure is returned that satisfies isnan(x) === true
.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
McCormick.MC
— Typestruct MC{N, T<:RelaxTag} <: Real
MC{N, T <: RelaxTag} <: Real
is the McCormick (w/ (sub)gradient) structure which is used to overload standard calculations. The fields are:
cv::Float64
: Convex relaxation
cc::Float64
: Concave relaxation
Intv::Interval{Float64}
: Interval bounds
cv_grad::SVector{N, Float64} where N
: (Sub)gradient of convex relaxation
cc_grad::SVector{N, Float64} where N
: (Sub)gradient of concave relaxation
cnst::Bool
: Boolean indicating whether the relaxations are constant over the domain. True if bounding an interval/constant. False, otherwise. This may change over the course of a calculation cnst
for zero(x)
is true
even if x.cnst
is false
.
McCormick.RelaxTag
— Typeabstract type RelaxTag
An abstract type
the subtypes of which define the manner of relaxation that will be performed for each operator applied to the MC object. Currently, the struct NS
which specifies that standard (Mitsos 2009) are to be used is fully supported. Limited support is provided for differentiable McCormick relaxations specified by struct Diff
(Khan 2017) and struct MV struct MV
(Tsoukalas 2011.) A rounding-safe implementation of the standard McCormick relaxations is specified by the struct NSSafe
which is work in progress.
McCormick.MC
— MethodMC{N,T}(y::Interval{Float64})
Constructs a McCormick relaxation with the convex relaxation equal to y.lo
and concave relaxation equal to y.hi
.
MC{N,T}(y::Float64)
Constructs a McCormick relaxation with the convex relaxation equal to y
and concave relaxation equal to y
.
McCormick.mid3
— Functionmid3(
+Types · EAGO.jl Types
McCormick.MC
— Typestruct MC{N, T<:RelaxTag} <: Real
MC{N, T <: RelaxTag} <: Real
is the McCormick (w/ (sub)gradient) structure which is used to overload standard calculations. The fields are:
cv::Float64
: Convex relaxation
cc::Float64
: Concave relaxation
Intv::Interval{Float64}
: Interval bounds
cv_grad::SVector{N, Float64} where N
: (Sub)gradient of convex relaxation
cc_grad::SVector{N, Float64} where N
: (Sub)gradient of concave relaxation
cnst::Bool
: Boolean indicating whether the relaxations are constant over the domain. True if bounding an interval/constant. False, otherwise. This may change over the course of a calculation cnst
for zero(x)
is true
even if x.cnst
is false
.
sourceMcCormick.RelaxTag
— Typeabstract type RelaxTag
An abstract type
the subtypes of which define the manner of relaxation that will be performed for each operator applied to the MC object. Currently, the struct NS
which specifies that standard (Mitsos 2009) are to be used is fully supported. Limited support is provided for differentiable McCormick relaxations specified by struct Diff
(Khan 2017) and struct MV struct MV
(Tsoukalas 2011.) A rounding-safe implementation of the standard McCormick relaxations is specified by the struct NSSafe
which is work in progress.
sourceConstructors for MC
McCormick.MC
— MethodMC{N,T}(y::Interval{Float64})
Constructs a McCormick relaxation with the convex relaxation equal to y.lo
and concave relaxation equal to y.hi
.
sourceMC{N,T}(y::Float64)
Constructs a McCormick relaxation with the convex relaxation equal to y
and concave relaxation equal to y
.
sourceInternal Utilities
McCormick.mid3
— Functionmid3(
x::Float64,
y::Float64,
z::Float64
) -> Tuple{Float64, Int64}
-
Calculates the middle of three numbers returning the value and the index where x >= y
.
sourceMcCormick.mid3v
— Functionmid3v(x::Float64, y::Float64, z::Float64) -> Float64
-
Calculates the middle of three numbers (x,y,z) returning the value where x <= y
.
sourceMcCormick.mid_grad
— Functionmid_grad(
+
Calculates the middle of three numbers returning the value and the index where x >= y
.
sourceMcCormick.mid3v
— Functionmid3v(x::Float64, y::Float64, z::Float64) -> Float64
+
Calculates the middle of three numbers (x,y,z) returning the value where x <= y
.
sourceMcCormick.mid_grad
— Functionmid_grad(
cc_grad::SArray{Tuple{N}, Float64, 1, N},
cv_grad::SArray{Tuple{N}, Float64, 1, N},
id::Int64
) -> Any
-
Takes the concave relaxation gradient 'ccgrad', the convex relaxation gradient 'cvgrad', and the index of the midpoint returned 'id' and outputs the appropriate gradient according to McCormick relaxation rules.
sourceMcCormick.dline_seg
— Functiondline_seg(
+
Takes the concave relaxation gradient 'ccgrad', the convex relaxation gradient 'cvgrad', and the index of the midpoint returned 'id' and outputs the appropriate gradient according to McCormick relaxation rules.
sourceMcCormick.dline_seg
— Functiondline_seg(
f::Function,
df::Function,
x::Float64,
xL::Float64,
xU::Float64
) -> Tuple{Any, Any}
-
Calculates the value of the slope line segment between (xL, f(xL))
and (xU, f(xU))
defaults to evaluating the derivative of the function if the interval is tight.
sourceMcCormick.seed_gradient
— Functionseed_gradient(j::Int64, x::Val{N}) -> Any
-
Creates a x::SVector{N,Float64}
object that is one at x[j]
and zero everywhere else.
sourceMcCormick.cut
— Functioncut(
+
Calculates the value of the slope line segment between (xL, f(xL))
and (xU, f(xU))
defaults to evaluating the derivative of the function if the interval is tight.
sourceMcCormick.seed_gradient
— Functionseed_gradient(j::Int64, x::Val{N}) -> Any
+
Creates a x::SVector{N,Float64}
object that is one at x[j]
and zero everywhere else.
sourceMcCormick.cut
— Functioncut(
xL::Float64,
xU::Float64,
cv::Float64,
@@ -26,7 +26,7 @@
cv_grad::SArray{Tuple{N}, Float64, 1, N},
cc_grad::SArray{Tuple{N}, Float64, 1, N}
) -> Tuple{Float64, Float64, Any, Any}
-
Refines convex/concave relaxations cv
and cc
with associated subgradients cv_grad
and cc_grad
by intersecting them with the interval boudns xL
and xU
.
sourceMcCormick.secant
— Functionsecant(
+
Refines convex/concave relaxations cv
and cc
with associated subgradients cv_grad
and cc_grad
by intersecting them with the interval boudns xL
and xU
.
sourceMcCormick.secant
— Functionsecant(
x0::Float64,
x1::Float64,
xL::Float64,
@@ -35,7 +35,7 @@
envp1::Float64,
envp2::Float64
) -> Tuple{Float64, Bool}
-
Defines a local 1D secant method to solve for the root of f
between the bounds xL
and xU
using x0
and x1
as a starting points. The inputs envp1
and envp2
are the envelope calculation parameters.
sourceMcCormick.newton
— Functionnewton(
+
Defines a local 1D secant method to solve for the root of f
between the bounds xL
and xU
using x0
and x1
as a starting points. The inputs envp1
and envp2
are the envelope calculation parameters.
sourceMcCormick.newton
— Functionnewton(
x0::Float64,
xL::Float64,
xU::Float64,
@@ -44,7 +44,7 @@
envp1::Float64,
envp2::Float64
) -> Tuple{Any, Bool}
-
Defines a local 1D newton method to solve for the root of f
between the bounds xL
and xU
using x0
as a starting point. The derivative of f
is df
. The inputs envp1
and envp2
are the envelope calculation parameters.
sourceMcCormick.golden_section_it
— Functiongolden_section_it(
+
Defines a local 1D newton method to solve for the root of f
between the bounds xL
and xU
using x0
as a starting point. The derivative of f
is df
. The inputs envp1
and envp2
are the envelope calculation parameters.
sourceMcCormick.golden_section_it
— Functiongolden_section_it(
init::Int64,
a::Float64,
fa::Float64,
@@ -56,11 +56,11 @@
envp1::Float64,
envp2::Float64
) -> Float64
-
Define iteration used in golden section method. The inputs fa
,fb
, and fc
, are the function f
evaluated at a
,b
, and c
respectively. The inputs envp1
and envp2
are the envelope calculation parameters. The value init
is the iteration number of the golden section method.
sourceMcCormick.golden_section
— Functiongolden_section(
+
Define iteration used in golden section method. The inputs fa
,fb
, and fc
, are the function f
evaluated at a
,b
, and c
respectively. The inputs envp1
and envp2
are the envelope calculation parameters. The value init
is the iteration number of the golden section method.
sourceMcCormick.golden_section
— Functiongolden_section(
xL::Float64,
xU::Float64,
f::Function,
envp1::Float64,
envp2::Float64
) -> Float64
-
Defines a local 1D golden section method to solve for the root of f
between the bounds xL
and xU
using x0
as a starting point. Define iteration used in golden section method. The inputs envp1
and envp2
are the envelope calculation parameters.
source(Under Development) MCNoGrad
A handful of applications make use of McCormick relaxations directly without the need for subgradients. We are currently adding support for a McCormick struct
which omits subgradient propagation in favor of return a MCNoGrad object and associated derivative information. This is currently under development and likely lacking key functionality.
McCormick.MCNoGrad
— Typestruct MCNoGrad <: Real
MCNoGrad <: Real
is a McCormick structure without RelaxType Tag or subgradients. This structure is used for source-code transformation approaches to constructing McCormick relaxations. Methods definitions and calls should specify the relaxation type used (i.e.) +(::NS, x::MCNoGrad, y::MCNoGrad)...
. Moreover, the kernel associated with this returns all intermediate calculations necessary to compute subgradient information whereas the overloading calculation simply returns the MCNoGrad
object. For univariate calculations without tiepoints such as we log2(::NS, x::MCNoGrad)::MCNoGrad
whereas log2_kernel(::NS, x::MCNoGrad, ::Bool) = (::MCNoGrad, cv_id::Int, cc_id::Int, dcv, dcc)
. Univariate NS functions follow convention (MCNoGrad, cvid, ccid, dcv, dcc, tp1cv, tp1cc, .... tpncv, tpncc) where cv_id is the subgradient selected (1 = cv, 2 = cc, 3 = 0), dcv and dcc are derivatives (or elements of subdifferential) of the outside function evaluated per theorem at the point being evaluated and tpicv, tpicc are the ith tiepoints associated with computing the envelope of the outside function. .
cv::Float64
: Convex relaxation
cc::Float64
: Concave relaxation
Intv::Interval{Float64}
: Interval bounds
cnst::Bool
: Boolean indicating whether the relaxations are constant over the domain. True if bounding an interval/constant. False, otherwise. This may change over the course of a calculation cnst
for zero(x)
is true
even if x.cnst
is false
.
sourceMcCormick.MCNoGrad
— MethodMCNoGrad(y::Float64)
Constructs McCormick relaxation with convex relaxation equal to y
and concave relaxation equal to y
.
sourceMcCormick.MCNoGrad
— MethodMCNoGrad(y::Interval{Float64})
Constructs McCormick relaxation with convex relaxation equal to y.lo
and concave relaxation equal to y.hi
.
sourceMcCormick.MCNoGrad
— MethodMCNoGrad(cv::Float64, cc::Float64)
Constructs McCormick relaxation with convex relaxation equal to cv
and concave relaxation equal to cc
.
sourceSettings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+
Defines a local 1D golden section method to solve for the root of f
between the bounds xL
and xU
using x0
as a starting point. Define iteration used in golden section method. The inputs envp1
and envp2
are the envelope calculation parameters.
A handful of applications make use of McCormick relaxations directly without the need for subgradients. We are currently adding support for a McCormick struct
which omits subgradient propagation in favor of return a MCNoGrad object and associated derivative information. This is currently under development and likely lacking key functionality.
McCormick.MCNoGrad
— Typestruct MCNoGrad <: Real
MCNoGrad <: Real
is a McCormick structure without RelaxType Tag or subgradients. This structure is used for source-code transformation approaches to constructing McCormick relaxations. Methods definitions and calls should specify the relaxation type used (i.e.) +(::NS, x::MCNoGrad, y::MCNoGrad)...
. Moreover, the kernel associated with this returns all intermediate calculations necessary to compute subgradient information whereas the overloading calculation simply returns the MCNoGrad
object. For univariate calculations without tiepoints such as we log2(::NS, x::MCNoGrad)::MCNoGrad
whereas log2_kernel(::NS, x::MCNoGrad, ::Bool) = (::MCNoGrad, cv_id::Int, cc_id::Int, dcv, dcc)
. Univariate NS functions follow convention (MCNoGrad, cvid, ccid, dcv, dcc, tp1cv, tp1cc, .... tpncv, tpncc) where cv_id is the subgradient selected (1 = cv, 2 = cc, 3 = 0), dcv and dcc are derivatives (or elements of subdifferential) of the outside function evaluated per theorem at the point being evaluated and tpicv, tpicc are the ith tiepoints associated with computing the envelope of the outside function. .
cv::Float64
: Convex relaxation
cc::Float64
: Concave relaxation
Intv::Interval{Float64}
: Interval bounds
cnst::Bool
: Boolean indicating whether the relaxations are constant over the domain. True if bounding an interval/constant. False, otherwise. This may change over the course of a calculation cnst
for zero(x)
is true
even if x.cnst
is false
.
McCormick.MCNoGrad
— MethodMCNoGrad(y::Float64)
Constructs McCormick relaxation with convex relaxation equal to y
and concave relaxation equal to y
.
McCormick.MCNoGrad
— MethodMCNoGrad(y::Interval{Float64})
Constructs McCormick relaxation with convex relaxation equal to y.lo
and concave relaxation equal to y.hi
.
McCormick.MCNoGrad
— MethodMCNoGrad(cv::Float64, cc::Float64)
Constructs McCormick relaxation with convex relaxation equal to cv
and concave relaxation equal to cc
.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
In order to bound a function using a McCormick relaxation, you first construct a McCormick object (x::MC
) that bounds the input variables, and then you pass these variables to the desired function.
In the example below, convex/concave relaxations of the function $f(x) = x (x - 5) \sin(x)$ are calculated at $x = 2$ on the interval $[1, 4]$.
using McCormick
+Basic Usage · EAGO.jl Basic Usage
Bounding a Univariate Function
In order to bound a function using a McCormick relaxation, you first construct a McCormick object (x::MC
) that bounds the input variables, and then you pass these variables to the desired function.
In the example below, convex/concave relaxations of the function $f(x) = x (x - 5) \sin(x)$ are calculated at $x = 2$ on the interval $[1, 4]$.
using McCormick
# Create MC object for x = 2.0 on [1.0, 4.0] for relaxing
# a function f(x) on the interval Intv
@@ -44,4 +44,4 @@
cv = fMC.cv # Convex relaxation
cc = fMC.cc # Concave relaxation
end
-end
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+end
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
MathOptInterface.UpperBoundAlreadySet
error.unbounded_check!
which warns users if they are missing variable bounds and sets them to +/- 1E10 by default.unbounded_check
which defaults to true
and enables unbounded_check!
.MOI.Nonlinear
submodule instead of JuMP._Derivatives
.EAGO.OperatorRegistry
.help?
information for various functions and structures.print_problem_summary
, an internal script used to display all constraints, objectives in a linear program which is added to functions for debug purposes while writing code.EAGOParameters
.branch_cvx_factor
: 0.5 => 0.25branch_offset
: 0.2 => 0.15time_limit
and _time_left
: 1000.0 => 3600.0obbt_depth
: 0 => 6obbt_repetitions
: 1 => 3cut_tolerance_rel
: 1E-2 => 1E-3Ipopt.Optimizer
attributes.max_iter
: 20000 => 10000acceptable_iter
: 10000 => 1000test_quadratic_nonconvex_constraint_basic
from MOI tests.xabsx
, logcosh
estimator_extrema
, estimator_under
, and estimator_over
functions to EAGO for bilinear relaxations.RelaxCache
structure to hold relaxed problem information.SIPRes
detailed in Djelassi, H. and Mitsos A. 2017.register_eago_operators!(m::JuMP.Model)
which can be used to register all nonstandard nonlinear terms used in EAGO in any JuMP model.positive
, negative
, lower_bnd
, upper_bnd
, and bnd
functions which can be used to enforce bounds on intermediate terms in nonlinear expressions (EAGO.Optimizer
only).abs2
, sinpi
, cospi
, fma
, cbrt
xlogx
erf
, erfc
, erfinv
, erfcinv
relu
, gelu
, elu
, selu
, swish
, sigmoid
, softsign
, softplus
, bisigmoid
, pentanh
, leaky_relu
, param_relu
sip_explicit
have been made more transparent.RawParameter
input and a number of new attributes.EAGO.Optimizer
(no changes to API): fully decouples input problem specifications from the formulation used internally, stack only stores variables that are branched on, and a number of internal rearrangements to clearly delineate different routines.This update is intended to be the last to create a large number of breaking changes to the EAGO API. Please review the use cases provided in the documentation to update examples.
Optimizer
object and storage types (e.g. LowerInfo
) have been removed.BinaryMinMaxHeap
structure is now used to store nodes.ExtensionType
and defining subroutines which dispatch on this new structure.MOI.MAX_SENSE
(max objective sense).This update creates a number of breaking changes to the EAGO API. Please review the use cases provided in the documentation to update examples.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
MathOptInterface.UpperBoundAlreadySet
error.unbounded_check!
which warns users if they are missing variable bounds and sets them to +/- 1E10 by default.unbounded_check
which defaults to true
and enables unbounded_check!
.MOI.Nonlinear
submodule instead of JuMP._Derivatives
.EAGO.OperatorRegistry
.help?
information for various functions and structures.print_problem_summary
, an internal script used to display all constraints, objectives in a linear program which is added to functions for debug purposes while writing code.EAGOParameters
.branch_cvx_factor
: 0.5 => 0.25branch_offset
: 0.2 => 0.15time_limit
and _time_left
: 1000.0 => 3600.0obbt_depth
: 0 => 6obbt_repetitions
: 1 => 3cut_tolerance_rel
: 1E-2 => 1E-3Ipopt.Optimizer
attributes.max_iter
: 20000 => 10000acceptable_iter
: 10000 => 1000test_quadratic_nonconvex_constraint_basic
from MOI tests.xabsx
, logcosh
estimator_extrema
, estimator_under
, and estimator_over
functions to EAGO for bilinear relaxations.RelaxCache
structure to hold relaxed problem information.SIPRes
detailed in Djelassi, H. and Mitsos A. 2017.register_eago_operators!(m::JuMP.Model)
which can be used to register all nonstandard nonlinear terms used in EAGO in any JuMP model.positive
, negative
, lower_bnd
, upper_bnd
, and bnd
functions which can be used to enforce bounds on intermediate terms in nonlinear expressions (EAGO.Optimizer
only).abs2
, sinpi
, cospi
, fma
, cbrt
xlogx
erf
, erfc
, erfinv
, erfcinv
relu
, gelu
, elu
, selu
, swish
, sigmoid
, softsign
, softplus
, bisigmoid
, pentanh
, leaky_relu
, param_relu
sip_explicit
have been made more transparent.RawParameter
input and a number of new attributes.EAGO.Optimizer
(no changes to API): fully decouples input problem specifications from the formulation used internally, stack only stores variables that are branched on, and a number of internal rearrangements to clearly delineate different routines.This update is intended to be the last to create a large number of breaking changes to the EAGO API. Please review the use cases provided in the documentation to update examples.
Optimizer
object and storage types (e.g. LowerInfo
) have been removed.BinaryMinMaxHeap
structure is now used to store nodes.ExtensionType
and defining subroutines which dispatch on this new structure.MOI.MAX_SENSE
(max objective sense).This update creates a number of breaking changes to the EAGO API. Please review the use cases provided in the documentation to update examples.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This component is meant to provide a flexible framework for implementing spatial branch-and-bound based optimization routines in Julia. All components of the branch-and-bound routine can be customized by the individual user: lower-bounding problem, upper-bounding problem.
EAGO.NodeBB
— Typestruct NodeBB
Store information associated with each node in the branch-and-bound tree.
lower_variable_bounds::Vector{Float64}
: Lower bounds of variable box.
upper_variable_bounds::Vector{Float64}
: Upper bounds of variable box.
is_integer::BitVector
: Is dimension integer valued
continuous::Bool
: Are all dimensions continuous (or fixed)
lower_bound::Float64
: Lower bound of problem solution on nodeBB
upper_bound::Float64
: Upper bound of problem solution on nodeBB
depth::Int64
: Depth of node in B&B tree.
cont_depth::Int64
: Depth of first parent in B&B tree that was continuously valued
id::Int64
: Unique ID for each node.
branch_direction::EAGO.BranchDirection
: Whether last branch was negative or positive in direction
last_branch::Int64
: Dimension of last branch
branch_extent::Float64
: Extent of last branch (using for psuedocost calculation)
The GlobalOptimizer
structure holds all information relevant to branch-and-bound.
EAGO.GlobalOptimizer
— Typemutable struct GlobalOptimizer{Q, S, T<:ExtensionType} <: MathOptInterface.AbstractOptimizer
Optimizer internal to EAGO which holds information used to perform branch-and-bound in order to solve nonconvex MINLPs.
Descriptions of all fields available in extended help.
Extended Help
_subsolvers::SubSolvers{Q, S} where {Q, S}
: Storage for relaxed and upper optimizers to use, and any custom extensions
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions)
enable_optimize_hook::Bool
: Specifies that the optimize_hook!
function should be called rather than throw the problem to the standard routine
ext::Any
: (Deprecated, use _subsolvers instead) Storage for custom extension types
_end_state::EAGO.GlobalEndState
: The completion status code for the branch-and-bound algorithm
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_obj_mult::Float64
: Multiplier used internally to convert objective sense from Max to Min. Only takes on values of {-1.0, 1.0}
_obj_var_slack_added::Bool
: Flag to indicate if a slack variable was added for the objective function. This is done in some epigraph reformulations (see reform_epigraph_min!
)
_stack::DataStructures.BinaryMinMaxHeap{NodeBB}
: A heap of all nodes in the branch-and-bound tree
_current_node::NodeBB
: The individual node being examined at any particular time. Nodes are removed from the stack and placed here, evaluated, and then sent back to the stack
_first_relax_point_set::Bool
: (Unused) Flag for relaxation points
_current_xref::Vector{Float64}
: (Unused) Variable values of a particular point
_candidate_xref::Vector{Float64}
: (Unused) Variable values of a candidate point
_use_prior_objective_xref::Bool
: (Unused) Flag to use variable values from previous evaluation on the current step
_current_objective_xref::Vector{Float64}
: (Unused) Variable values for objective evaluation
_prior_objective_xref::Vector{Float64}
: (Unused) Variable values for previous objective evaluation
_user_branch_variables::Bool
: Flag for if the user has specified branch variables (see label_branch_variables!
)
_fixed_variable::Vector{Bool}
: Variables that are fixed in place
_branch_variable_count::Int64
: Number of variables that can be branched on
_branch_to_sol_map::Vector{Int64}
: Mapping from the branch variables to the full set of variables in the problem
_sol_to_branch_map::Vector{Int64}
: Mapping from the full set of variables in the problem to the branch variables
_continuous_solution::Vector{Float64}
: The final (or intermediate) variable values of the solution
_preprocess_feasibility::Bool
: Flag to ensure preprocessing result is feasible
_preprocess_termination_status::MathOptInterface.TerminationStatusCode
: Status codes for use in bounds tightening
_preprocess_primal_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_preprocess_dual_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_lower_primal_status::MathOptInterface.ResultStatusCode
: Primal status of the lower problem
_lower_dual_status::MathOptInterface.ResultStatusCode
: Dual status of the lower problem
_lower_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the lower problem
_lower_feasibility::Bool
: Flag for lower problem feasibility
_lower_objective_value::Float64
: Objective value result from the lower problem
_lower_solution::Vector{Float64}
: Variable values of the lower problem solution
_lower_lvd::Vector{Float64}
: Lower variable duals for use in duality-based bound tightening
_lower_uvd::Vector{Float64}
: Upper variable duals for use in duality-based bound tightening
_last_cut_objective::Float64
: Objective value associated with the previous cut in the cutting planes algorithm
_upper_result_status::MathOptInterface.ResultStatusCode
: Primal status of the upper problem
_upper_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the upper problem
_upper_feasibility::Bool
: Flag for upper problem feasibility
_upper_objective_value::Float64
: Objective value result from the upper problem
_upper_variables::Vector{MathOptInterface.VariableIndex}
:
_upper_solution::Vector{Float64}
:
_postprocess_feasibility::Bool
: (Unused) Flag to ensure postprocessing result is feasible
_time_left::Float64
: Time remaining for the optimization algorithm. This is set in initial_parse!
to the user-defined time limit and is decremented throughout global_solve!
_start_time::Float64
: Storage for the time()
when optimization began
_run_time::Float64
: Current run time, incremented using time()-_start_time
_parse_time::Float64
: A field to keep track of time spent on initial problem parsing
_presolve_time::Float64
: Used in optimize_nonconvex.jl
to track how long the presolve step takes
_last_preprocess_time::Float64
: Updated each iteration to track the time of the preprocess step
_last_lower_problem_time::Float64
: Updated each iteration to track the time of the lower problem step
_last_upper_problem_time::Float64
: Updated each iteration to track the time of the upper problem step
_last_postprocessing_time::Float64
: Updated each iteration to track the time of the postprocess step
_min_converged_value::Float64
: A field to track convergence progress across iterations
_global_lower_bound::Float64
: The best-known lower bound
_global_upper_bound::Float64
: The best-known upper bound
_maximum_node_id::Int64
: The total number of nodes that have been created
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
_solution_value::Float64
: (Unused) The best-known solution value
_feasible_solution_found::Bool
: A flag for if a feasible solution was identified. Updated if preprocessing, lower problem, and upper problem all return feasible values
_solution_node::Int64
: The node ID of the best-known feasible upper problem solution (default = -1, if no feasible solution is found)
_best_upper_value::Float64
: The best-known upper bound
_obbt_working_lower_index::Vector{Bool}
: Indices of variables to perform OBBT on
_obbt_working_upper_index::Vector{Bool}
: Indices of variables to perform OBBT on
_lower_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkinglowerindex across iterations
_upper_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkingupperindex across iterations
_old_low_index::Vector{Bool}
: Storage for indices prior to OBBT step
_old_upp_index::Vector{Bool}
: Storage for indices prior to OBBT step
_new_low_index::Vector{Bool}
: New indices following OBBT step; compared with _old_low_index
_new_upp_index::Vector{Bool}
: New indices following OBBT step; compared with _old_upp_index
_obbt_variables::Vector{MathOptInterface.VariableIndex}
: (Deprecated) Variables to perform OBBT on. Replaced by _obbt_working_lower_index
and _obbt_working_upper_index
_obbt_variable_count::Int64
: The number of variables to perform OBBT on
_obbt_performed_flag::Bool
: (Unused) Flag to indicate whether OBBT has been performed
_lower_fbbt_buffer::Vector{Float64}
: Buffer for FBBT lower bounds. Set in presolve, used in preprocess
_upper_fbbt_buffer::Vector{Float64}
: Buffer for FBBT upper bounds. Set in presolve, used in preprocess
_cp_improvement::Float64
: (Unused) Improvement in constraint propagation
_cp_evaluation_reverse::Bool
: (Unused) Flag for if constraint propagation results need to be reversed
_cut_iterations::Int64
: Iterations of the cutting planes algorithm completed
_cut_add_flag::Bool
: (Unused) Flag to check if cuts should be added
_node_repetitions::Int64
: Counter for number of times a node is evaluated. If the repeat_check
function is overloaded to return true
, a node will not be branched on, but will instead be added back into the stack using single_storage!
. In this case, _node_repetitions
is incremented
_log::Log
: Storage for logging information during a branch-and-bound run
_affine_relax_ci::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
: Storage for affine constraints
_affine_objective_cut_ci::Union{Nothing, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for a linear objective cut constraint
_relaxed_variable_number::Int64
: (Unused) Number of relaxed variables
_relaxed_variable_index::Vector{MathOptInterface.VariableIndex}
: Indices of relaxed variables
_relaxed_variable_et::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Int64}}
: Stored EqualTo constraints
_relaxed_variable_lt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Int64}}
: Stored LessThan constraints
_relaxed_variable_gt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Int64}}
: Stored GreaterThan constraints
_relaxed_variable_integer::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
: Stored Integer constraints
_branch_variables::Vector{Bool}
: List of variables that can be branched on. If not user-specified, branch variables are identified in label_branch_variables!
_nonbranching_int::Bool
: (Unused) Flag for non-branching integers
_new_eval_constraint::Bool
: Flag indicating if an initial evaluation of the constraints has occurred
_new_eval_objective::Bool
: Flag indicating if the objective expression was evaluated
_node_to_sv_leq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for carrying LessThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_node_to_sv_geq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
: Storage for carrying GreaterThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_nonlinear_evaluator_created::Bool
: Flag to check for nonlinear evaluators. Set to true
in add_nonlinear_evaluator!
_branch_cost::EAGO.BranchCostStorage{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Storage for pseudocost branching
_branch_variable_sparsity::SparseArrays.SparseMatrixCSC{Bool, Int64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Sparsity information of the branch variables
_constraint_infeasiblity::Vector{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Information on the infeasibility of each constraint
EAGO.branch_node!
— Methodbranch_node!(t::ExtensionType, m::GlobalOptimizer)
-
Create two nodes from current_node
and store them on the stack. Call select_branch_variable(t, m)
and select_branch_point(t, m, k)
to determine the variable that should be branched on and the point at which branching should occur, respectively.
EAGO.select_branch_variable
— Methodselect_branch_variable(
+EAGO's Branch and Bound Routine · EAGO.jl EAGO's Branch and Bound Routine
This component is meant to provide a flexible framework for implementing spatial branch-and-bound based optimization routines in Julia. All components of the branch-and-bound routine can be customized by the individual user: lower-bounding problem, upper-bounding problem.
Branch and Bound Node Storage
EAGO.NodeBB
— Typestruct NodeBB
Store information associated with each node in the branch-and-bound tree.
lower_variable_bounds::Vector{Float64}
: Lower bounds of variable box.
upper_variable_bounds::Vector{Float64}
: Upper bounds of variable box.
is_integer::BitVector
: Is dimension integer valued
continuous::Bool
: Are all dimensions continuous (or fixed)
lower_bound::Float64
: Lower bound of problem solution on nodeBB
upper_bound::Float64
: Upper bound of problem solution on nodeBB
depth::Int64
: Depth of node in B&B tree.
cont_depth::Int64
: Depth of first parent in B&B tree that was continuously valued
id::Int64
: Unique ID for each node.
branch_direction::EAGO.BranchDirection
: Whether last branch was negative or positive in direction
last_branch::Int64
: Dimension of last branch
branch_extent::Float64
: Extent of last branch (using for psuedocost calculation)
sourceThe GlobalOptimizer
structure holds all information relevant to branch-and-bound.
EAGO.GlobalOptimizer
— Typemutable struct GlobalOptimizer{Q, S, T<:ExtensionType} <: MathOptInterface.AbstractOptimizer
Optimizer internal to EAGO which holds information used to perform branch-and-bound in order to solve nonconvex MINLPs.
Descriptions of all fields available in extended help.
Extended Help
_subsolvers::SubSolvers{Q, S} where {Q, S}
: Storage for relaxed and upper optimizers to use, and any custom extensions
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions)
enable_optimize_hook::Bool
: Specifies that the optimize_hook!
function should be called rather than throw the problem to the standard routine
ext::Any
: (Deprecated, use _subsolvers instead) Storage for custom extension types
_end_state::EAGO.GlobalEndState
: The completion status code for the branch-and-bound algorithm
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_obj_mult::Float64
: Multiplier used internally to convert objective sense from Max to Min. Only takes on values of {-1.0, 1.0}
_obj_var_slack_added::Bool
: Flag to indicate if a slack variable was added for the objective function. This is done in some epigraph reformulations (see reform_epigraph_min!
)
_stack::DataStructures.BinaryMinMaxHeap{NodeBB}
: A heap of all nodes in the branch-and-bound tree
_current_node::NodeBB
: The individual node being examined at any particular time. Nodes are removed from the stack and placed here, evaluated, and then sent back to the stack
_first_relax_point_set::Bool
: (Unused) Flag for relaxation points
_current_xref::Vector{Float64}
: (Unused) Variable values of a particular point
_candidate_xref::Vector{Float64}
: (Unused) Variable values of a candidate point
_use_prior_objective_xref::Bool
: (Unused) Flag to use variable values from previous evaluation on the current step
_current_objective_xref::Vector{Float64}
: (Unused) Variable values for objective evaluation
_prior_objective_xref::Vector{Float64}
: (Unused) Variable values for previous objective evaluation
_user_branch_variables::Bool
: Flag for if the user has specified branch variables (see label_branch_variables!
)
_fixed_variable::Vector{Bool}
: Variables that are fixed in place
_branch_variable_count::Int64
: Number of variables that can be branched on
_branch_to_sol_map::Vector{Int64}
: Mapping from the branch variables to the full set of variables in the problem
_sol_to_branch_map::Vector{Int64}
: Mapping from the full set of variables in the problem to the branch variables
_continuous_solution::Vector{Float64}
: The final (or intermediate) variable values of the solution
_preprocess_feasibility::Bool
: Flag to ensure preprocessing result is feasible
_preprocess_termination_status::MathOptInterface.TerminationStatusCode
: Status codes for use in bounds tightening
_preprocess_primal_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_preprocess_dual_status::MathOptInterface.ResultStatusCode
: Status codes for use in bounds tightening
_lower_primal_status::MathOptInterface.ResultStatusCode
: Primal status of the lower problem
_lower_dual_status::MathOptInterface.ResultStatusCode
: Dual status of the lower problem
_lower_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the lower problem
_lower_feasibility::Bool
: Flag for lower problem feasibility
_lower_objective_value::Float64
: Objective value result from the lower problem
_lower_solution::Vector{Float64}
: Variable values of the lower problem solution
_lower_lvd::Vector{Float64}
: Lower variable duals for use in duality-based bound tightening
_lower_uvd::Vector{Float64}
: Upper variable duals for use in duality-based bound tightening
_last_cut_objective::Float64
: Objective value associated with the previous cut in the cutting planes algorithm
_upper_result_status::MathOptInterface.ResultStatusCode
: Primal status of the upper problem
_upper_termination_status::MathOptInterface.TerminationStatusCode
: Termination status of the upper problem
_upper_feasibility::Bool
: Flag for upper problem feasibility
_upper_objective_value::Float64
: Objective value result from the upper problem
_upper_variables::Vector{MathOptInterface.VariableIndex}
:
_upper_solution::Vector{Float64}
:
_postprocess_feasibility::Bool
: (Unused) Flag to ensure postprocessing result is feasible
_time_left::Float64
: Time remaining for the optimization algorithm. This is set in initial_parse!
to the user-defined time limit and is decremented throughout global_solve!
_start_time::Float64
: Storage for the time()
when optimization began
_run_time::Float64
: Current run time, incremented using time()-_start_time
_parse_time::Float64
: A field to keep track of time spent on initial problem parsing
_presolve_time::Float64
: Used in optimize_nonconvex.jl
to track how long the presolve step takes
_last_preprocess_time::Float64
: Updated each iteration to track the time of the preprocess step
_last_lower_problem_time::Float64
: Updated each iteration to track the time of the lower problem step
_last_upper_problem_time::Float64
: Updated each iteration to track the time of the upper problem step
_last_postprocessing_time::Float64
: Updated each iteration to track the time of the postprocess step
_min_converged_value::Float64
: A field to track convergence progress across iterations
_global_lower_bound::Float64
: The best-known lower bound
_global_upper_bound::Float64
: The best-known upper bound
_maximum_node_id::Int64
: The total number of nodes that have been created
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
_solution_value::Float64
: (Unused) The best-known solution value
_feasible_solution_found::Bool
: A flag for if a feasible solution was identified. Updated if preprocessing, lower problem, and upper problem all return feasible values
_solution_node::Int64
: The node ID of the best-known feasible upper problem solution (default = -1, if no feasible solution is found)
_best_upper_value::Float64
: The best-known upper bound
_obbt_working_lower_index::Vector{Bool}
: Indices of variables to perform OBBT on
_obbt_working_upper_index::Vector{Bool}
: Indices of variables to perform OBBT on
_lower_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkinglowerindex across iterations
_upper_indx_diff::Vector{Bool}
: Tracker for changes in obbtworkingupperindex across iterations
_old_low_index::Vector{Bool}
: Storage for indices prior to OBBT step
_old_upp_index::Vector{Bool}
: Storage for indices prior to OBBT step
_new_low_index::Vector{Bool}
: New indices following OBBT step; compared with _old_low_index
_new_upp_index::Vector{Bool}
: New indices following OBBT step; compared with _old_upp_index
_obbt_variables::Vector{MathOptInterface.VariableIndex}
: (Deprecated) Variables to perform OBBT on. Replaced by _obbt_working_lower_index
and _obbt_working_upper_index
_obbt_variable_count::Int64
: The number of variables to perform OBBT on
_obbt_performed_flag::Bool
: (Unused) Flag to indicate whether OBBT has been performed
_lower_fbbt_buffer::Vector{Float64}
: Buffer for FBBT lower bounds. Set in presolve, used in preprocess
_upper_fbbt_buffer::Vector{Float64}
: Buffer for FBBT upper bounds. Set in presolve, used in preprocess
_cp_improvement::Float64
: (Unused) Improvement in constraint propagation
_cp_evaluation_reverse::Bool
: (Unused) Flag for if constraint propagation results need to be reversed
_cut_iterations::Int64
: Iterations of the cutting planes algorithm completed
_cut_add_flag::Bool
: (Unused) Flag to check if cuts should be added
_node_repetitions::Int64
: Counter for number of times a node is evaluated. If the repeat_check
function is overloaded to return true
, a node will not be branched on, but will instead be added back into the stack using single_storage!
. In this case, _node_repetitions
is incremented
_log::Log
: Storage for logging information during a branch-and-bound run
_affine_relax_ci::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
: Storage for affine constraints
_affine_objective_cut_ci::Union{Nothing, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for a linear objective cut constraint
_relaxed_variable_number::Int64
: (Unused) Number of relaxed variables
_relaxed_variable_index::Vector{MathOptInterface.VariableIndex}
: Indices of relaxed variables
_relaxed_variable_et::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Int64}}
: Stored EqualTo constraints
_relaxed_variable_lt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Int64}}
: Stored LessThan constraints
_relaxed_variable_gt::Vector{Tuple{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Int64}}
: Stored GreaterThan constraints
_relaxed_variable_integer::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
: Stored Integer constraints
_branch_variables::Vector{Bool}
: List of variables that can be branched on. If not user-specified, branch variables are identified in label_branch_variables!
_nonbranching_int::Bool
: (Unused) Flag for non-branching integers
_new_eval_constraint::Bool
: Flag indicating if an initial evaluation of the constraints has occurred
_new_eval_objective::Bool
: Flag indicating if the objective expression was evaluated
_node_to_sv_leq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
: Storage for carrying LessThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_node_to_sv_geq_ci::Dict{Int64, MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
: Storage for carrying GreaterThan constraint information. Used in obbt!
and update_relaxed_problem_box!
_nonlinear_evaluator_created::Bool
: Flag to check for nonlinear evaluators. Set to true
in add_nonlinear_evaluator!
_branch_cost::EAGO.BranchCostStorage{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Storage for pseudocost branching
_branch_variable_sparsity::SparseArrays.SparseMatrixCSC{Bool, Int64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Sparsity information of the branch variables
_constraint_infeasiblity::Vector{Float64}
: (FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED) Information on the infeasibility of each constraint
sourceCustomizable Subroutines
Stack Management Subroutines
EAGO.branch_node!
— Methodbranch_node!(t::ExtensionType, m::GlobalOptimizer)
+
Create two nodes from current_node
and store them on the stack. Call select_branch_variable(t, m)
and select_branch_point(t, m, k)
to determine the variable that should be branched on and the point at which branching should occur, respectively.
sourceEAGO.select_branch_variable
— Methodselect_branch_variable(
t::ExtensionType,
m::GlobalOptimizer
) -> Any
-
Choose a variable to branch on. A maximum relative width branching rule is used by default.
sourceEAGO.select_branch_point
— Methodselect_branch_point(
+
Choose a variable to branch on. A maximum relative width branching rule is used by default.
sourceEAGO.select_branch_point
— Methodselect_branch_point(
t::ExtensionType,
m::GlobalOptimizer,
i
) -> Float64
-
Select a point xb
within the domain of the i
th branching variable. By default, this point is a convex combination of the solution to the relaxation and the midpoint of the node (branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
). If the solution lies within branch_offset
of a bound, then the branch point is moved to a distance of branch_offset
from that bound.
sourceEAGO.node_selection!
— Methodnode_selection!(t::ExtensionType, m::GlobalOptimizer)
-
Select the next node in the stack to evaluate. By default, perform best-first node selection (select the node with the lowest lower bound in the stack).
sourceEAGO.fathom!
— Methodfathom!(t::ExtensionType, m::GlobalOptimizer)
-
Remove nodes from the stack. By default, delete nodes from the stack if their lower bounds are greater than the current global upper bound.
sourceEAGO.initialize_stack!
— Methodinitialize_stack!(t::ExtensionType, m::GlobalOptimizer)
-
Prepare the stack for the branch-and-bound routine. By default, create an initial node with the variable bounds as box constraints and add it to the stack.
sourceEAGO.single_storage!
— Methodsingle_storage!(t::ExtensionType, m::GlobalOptimizer)
-
Store the current node to the stack, without branching, after updating lower/upper bounds.
sourceInternal Subproblem Status Codes and Subsolver Management
EAGO.RelaxResultStatus
— TypeRelaxResultStatus
Status code used internally to determine how to interpret the results from the solution of a relaxed problem.
sourceEAGO.LocalResultStatus
— TypeLocalResultStatus
Status code used internally to determine how to interpret the results from the solution of a local problem solve.
sourceEAGO.Incremental
— Typemutable struct Incremental{S<:MathOptInterface.AbstractOptimizer} <: MathOptInterface.AbstractOptimizer
A type-stable cache used to wrapper for an optimizer that enables incremental modification of solvers that don't inherently suppport this. Explicitly checks support of MOI functionality used in EAGO.
(Deprecated) For Q = Val{true}
, the subsolver supports incremental loading. For Q = Val{false}
, the subsolver does not.
sourceEAGO.SubSolvers
— Typemutable struct SubSolvers{Q<:MathOptInterface.AbstractOptimizer, S<:MathOptInterface.AbstractOptimizer, T<:ExtensionType}
A structure containing the relaxed and upper optimizers to be used, as well as any user-defined extension.
relaxed_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve relaxed subproblems. Set using r = [...]
(<: MOI.AbstractOptimizer
) (default = Cbc.Optimizer()
)
upper_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve upper bounding problems. Set using u = [...]
(<: MOI.AbstractOptimizer
) (default = Ipopt.Optimizer()
)
ext::ExtensionType
: User-defined extension to use. Set using t = [...]
(<: EAGO.ExtensionType
)
sourceEAGO.set_default_config!
— Methodset_default_config!
Configures subsolver tolerances based on tolerance parameters provided to EAGO (provided that a specialized subsolver configuration routine has been provided and m.user_solver_config = false
).
sourceMain Subproblem and Termination Subroutines
EAGO.convergence_check
— Methodconvergence_check(
+
Select a point xb
within the domain of the i
th branching variable. By default, this point is a convex combination of the solution to the relaxation and the midpoint of the node (branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
). If the solution lies within branch_offset
of a bound, then the branch point is moved to a distance of branch_offset
from that bound.
sourceEAGO.node_selection!
— Methodnode_selection!(t::ExtensionType, m::GlobalOptimizer)
+
Select the next node in the stack to evaluate. By default, perform best-first node selection (select the node with the lowest lower bound in the stack).
sourceEAGO.fathom!
— Methodfathom!(t::ExtensionType, m::GlobalOptimizer)
+
Remove nodes from the stack. By default, delete nodes from the stack if their lower bounds are greater than the current global upper bound.
sourceEAGO.initialize_stack!
— Methodinitialize_stack!(t::ExtensionType, m::GlobalOptimizer)
+
Prepare the stack for the branch-and-bound routine. By default, create an initial node with the variable bounds as box constraints and add it to the stack.
sourceEAGO.single_storage!
— Methodsingle_storage!(t::ExtensionType, m::GlobalOptimizer)
+
Store the current node to the stack, without branching, after updating lower/upper bounds.
sourceInternal Subproblem Status Codes and Subsolver Management
EAGO.RelaxResultStatus
— TypeRelaxResultStatus
Status code used internally to determine how to interpret the results from the solution of a relaxed problem.
sourceEAGO.LocalResultStatus
— TypeLocalResultStatus
Status code used internally to determine how to interpret the results from the solution of a local problem solve.
sourceEAGO.Incremental
— Typemutable struct Incremental{S<:MathOptInterface.AbstractOptimizer} <: MathOptInterface.AbstractOptimizer
A type-stable cache used to wrapper for an optimizer that enables incremental modification of solvers that don't inherently suppport this. Explicitly checks support of MOI functionality used in EAGO.
(Deprecated) For Q = Val{true}
, the subsolver supports incremental loading. For Q = Val{false}
, the subsolver does not.
sourceEAGO.SubSolvers
— Typemutable struct SubSolvers{Q<:MathOptInterface.AbstractOptimizer, S<:MathOptInterface.AbstractOptimizer, T<:ExtensionType}
A structure containing the relaxed and upper optimizers to be used, as well as any user-defined extension.
relaxed_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve relaxed subproblems. Set using r = [...]
(<: MOI.AbstractOptimizer
) (default = Cbc.Optimizer()
)
upper_optimizer::MathOptInterface.AbstractOptimizer
: Optimizer used to solve upper bounding problems. Set using u = [...]
(<: MOI.AbstractOptimizer
) (default = Ipopt.Optimizer()
)
ext::ExtensionType
: User-defined extension to use. Set using t = [...]
(<: EAGO.ExtensionType
)
sourceEAGO.set_default_config!
— Methodset_default_config!
Configures subsolver tolerances based on tolerance parameters provided to EAGO (provided that a specialized subsolver configuration routine has been provided and m.user_solver_config = false
).
sourceMain Subproblem and Termination Subroutines
EAGO.convergence_check
— Methodconvergence_check(
t::ExtensionType,
m::GlobalOptimizer
) -> Bool
-
Check for problem convergence.
By default, check if the lower and upper bounds have converged to within absolute and/or relative tolerances.
sourceEAGO.cut_condition
— Methodcut_condition(t::ExtensionType, m::GlobalOptimizer) -> Bool
-
Returns true
if a cut should be added and computes a new reference point to add the cut at. By default, checks that cut_max_iterations
are not exceeded and that the improvement in the objective value associated with the previous cut is greater than both an absolute tolerance cut_ϵ_abs
and a relative tolerance cut_ϵ_rel
. Returns false
otherwise.
sourceEAGO.lower_problem!
— Methodlower_problem!(
+
Check for problem convergence.
By default, check if the lower and upper bounds have converged to within absolute and/or relative tolerances.
sourceEAGO.cut_condition
— Methodcut_condition(t::ExtensionType, m::GlobalOptimizer) -> Bool
+
Returns true
if a cut should be added and computes a new reference point to add the cut at. By default, checks that cut_max_iterations
are not exceeded and that the improvement in the objective value associated with the previous cut is greater than both an absolute tolerance cut_ϵ_abs
and a relative tolerance cut_ϵ_rel
. Returns false
otherwise.
sourceEAGO.lower_problem!
— Methodlower_problem!(
t::ExtensionType,
m::GlobalOptimizer{R, S, Q<:ExtensionType}
)
-
Constructs a relaxation of the MINLP on node y
and solves it using the default EAGO relaxation scheme. By default, EAGO applies Kelley's algorithm (from Kelley Jr., J.E.: The cutting-plane method for solving convex programs. J. Soc. Ind. Appl. Math. 8(4), 703 to 712 (1960)) while cut_condition(m)
returns true
then activates the integrality constraints of the relaxed problems and solves the resulting MILP relaxation. results are stored to the _lower_solution
, _lower_termination_status
, _lower_primal_status
, _lower_dual_status
, _lower_objective_value
, and _lower_feasibility
. Further, lower and upper variable duals are stored _lower_lvd
and _lower_uvd
, respectively, for use in duality based bound tightening. If relaxation-based bounds are weaker or cutting-planes are numerically poorly ill-posed, then interval bounds are used instead. If the problem is dual feasible but the primal status is ambiguous the dual objective value is used for the lower bound to avoid numerical issues.
sourceEAGO.preprocess!
— Methodpreprocess!(
+
Constructs a relaxation of the MINLP on node y
and solves it using the default EAGO relaxation scheme. By default, EAGO applies Kelley's algorithm (from Kelley Jr., J.E.: The cutting-plane method for solving convex programs. J. Soc. Ind. Appl. Math. 8(4), 703 to 712 (1960)) while cut_condition(m)
returns true
then activates the integrality constraints of the relaxed problems and solves the resulting MILP relaxation. results are stored to the _lower_solution
, _lower_termination_status
, _lower_primal_status
, _lower_dual_status
, _lower_objective_value
, and _lower_feasibility
. Further, lower and upper variable duals are stored _lower_lvd
and _lower_uvd
, respectively, for use in duality based bound tightening. If relaxation-based bounds are weaker or cutting-planes are numerically poorly ill-posed, then interval bounds are used instead. If the problem is dual feasible but the primal status is ambiguous the dual objective value is used for the lower bound to avoid numerical issues.
sourceEAGO.preprocess!
— Methodpreprocess!(
t::ExtensionType,
m::GlobalOptimizer{R, S, Q<:ExtensionType}
)
-
Runs contractor methods prior to solving lower bounding problem. By default linear and quadratic contractor methods followed by interval constraint propagation then optimization-based bound tightening for a specified number of iterations while the subproblem at current node n
has not been proven infeasible.
sourceEAGO.postprocess!
— Methodpostprocess!(t::ExtensionType, m::GlobalOptimizer)
-
Default postprocess perfoms duality-based bound tightening (Tawarmalani, M., Sahinidis, N.V.: Global optimization of mixed-integer nonlinear programs: a theoretical and computational study. Math. Progr. 99, 563–591 (2004).) up to an iteration limit set by dbbt_depth
.
sourceEAGO.repeat_check
— Methodrepeat_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
-
Check to see if current node should be reprocessed. Without any custom extension, return false
by default.
sourceEAGO.termination_check
— Methodtermination_check(m::GlobalOptimizer)
-termination_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
Check for termination of the branch-and-bound algorithm.
If only the GlobalOptimizer
is given as an argument, termination_check
dispatches to the other form using the ExtensionType
given in the SubSolvers
. If there is no user-defined extension, then by default, this will check for satisfaction of absolute or relative tolerances, solution infeasibility, and other specified limits. Returns true
if any conditions are met and branch-and-bound should end, and false
otherwise.
sourceEAGO.upper_problem!
— Methodupper_problem!(t::ExtensionType, m::GlobalOptimizer)
-
Default upper bounding problem which simply calls solve_local_nlp!
to solve the NLP locally.
sourceEAGO.parse_global!
— MethodBasic parsing for global solutions (no extensive manipulation). By default, does nothing.
sourceEAGO.optimize_hook!
— Methodoptimize_hook!(t::ExtensionType, m::Optimizer)
Provide a hook for extensions to EAGO.
The user-defined extension of optimize_hook!
is used in EAGO's overloading of MOI.optimize!
(see EAGO.jl/src/eago_optimizer/optimize/optimize.jl
). Without the optimize_hook!
specified, EAGO will run initial_parse!
, parse_classify_problem!
, and then optimize!
using the parsed problem type. The user-specified optimize_hook!
should thus take the new extension and Optimizer
as inputs and will execute when the user writes optimize!(model)
.
Example
Here, optimize_hook!
is used to bypass EAGO's problem parsing and treat every problem using its branch-and-bound routine. This is done in this example by telling EAGO to treat the problem as a mixed integer nonconvex problem, which normally dispatches to branch-and-bound.
struct MyNewExtension <: EAGO.ExtensionType end
+
Runs contractor methods prior to solving lower bounding problem. By default linear and quadratic contractor methods followed by interval constraint propagation then optimization-based bound tightening for a specified number of iterations while the subproblem at current node n
has not been proven infeasible.
sourceEAGO.postprocess!
— Methodpostprocess!(t::ExtensionType, m::GlobalOptimizer)
+
Default postprocess perfoms duality-based bound tightening (Tawarmalani, M., Sahinidis, N.V.: Global optimization of mixed-integer nonlinear programs: a theoretical and computational study. Math. Progr. 99, 563–591 (2004).) up to an iteration limit set by dbbt_depth
.
sourceEAGO.repeat_check
— Methodrepeat_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
+
Check to see if current node should be reprocessed. Without any custom extension, return false
by default.
sourceEAGO.termination_check
— Methodtermination_check(m::GlobalOptimizer)
+termination_check(t::ExtensionType, m::GlobalOptimizer) -> Bool
Check for termination of the branch-and-bound algorithm.
If only the GlobalOptimizer
is given as an argument, termination_check
dispatches to the other form using the ExtensionType
given in the SubSolvers
. If there is no user-defined extension, then by default, this will check for satisfaction of absolute or relative tolerances, solution infeasibility, and other specified limits. Returns true
if any conditions are met and branch-and-bound should end, and false
otherwise.
sourceEAGO.upper_problem!
— Methodupper_problem!(t::ExtensionType, m::GlobalOptimizer)
+
Default upper bounding problem which simply calls solve_local_nlp!
to solve the NLP locally.
sourceEAGO.parse_global!
— MethodBasic parsing for global solutions (no extensive manipulation). By default, does nothing.
sourceEAGO.optimize_hook!
— Methodoptimize_hook!(t::ExtensionType, m::Optimizer)
Provide a hook for extensions to EAGO.
The user-defined extension of optimize_hook!
is used in EAGO's overloading of MOI.optimize!
(see EAGO.jl/src/eago_optimizer/optimize/optimize.jl
). Without the optimize_hook!
specified, EAGO will run initial_parse!
, parse_classify_problem!
, and then optimize!
using the parsed problem type. The user-specified optimize_hook!
should thus take the new extension and Optimizer
as inputs and will execute when the user writes optimize!(model)
.
Example
Here, optimize_hook!
is used to bypass EAGO's problem parsing and treat every problem using its branch-and-bound routine. This is done in this example by telling EAGO to treat the problem as a mixed integer nonconvex problem, which normally dispatches to branch-and-bound.
struct MyNewExtension <: EAGO.ExtensionType end
import EAGO: optimize_hook!
function EAGO.optimize_hook!(t::MyNewExtension, m::Optimizer)
initial_parse!(m)
optimize!(EAGO.MINCVX(), m)
-end
The same functionality could be accomplished by setting the EAGOParameter
field force_global_solve
to be true.
sourceInternal Subroutines
EAGO.is_integer_subproblem
— Methodis_integer_subproblem(m)
-
Returns true
that the subproblem at the current node n
has participating integer variables that have not been fixed to constant valued as the branch-and-bound algorithm progresses. Returns false
otherwise.
sourceEAGO.is_integer_feasible_local
— Methodis_integer_feasible_local(m::GlobalOptimizer, d) -> Bool
-
Checks that the solution of a local solve is integer feasible to within the tolerances specified by integer_abs_tol
and integer_rel_tol
.
sourceEAGO.is_integer_feasible_relaxed
— Methodis_integer_feasible_relaxed(m::GlobalOptimizer) -> Bool
-
Check that the solution of the lower (relaxed problem) is integer feasible to within tolerances specified by the parameters: integer_abs_tol
(absolute tolerance) and integer_rel_tol
(relative tolerance).
sourceEAGO.interval_bound
— Functioninterval_bound(::GlobalOptimizer, ::T)
Compute a tuple representing the lower and upper interval bounds for an AbstractEAGOConstraint
representing an equality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionEq
- AffineFunctionIneq
- BufferedQuadraticEq
- BufferedQuadraticIneq
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.lower_interval_bound
— Functionlower_interval_bound(::GlobalOptimizer, ::T)
Compute the lower interval bound for an AbstractEAGOConstraint
representing an inequality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- BufferedQuadraticIneq
- BufferedSOC
- BufferedNonlinearFunction{V,N,T} where {V,N,T}
sourceEAGO.same_box
— Methodsame_box(x::NodeBB, y::NodeBB, r::Float64) -> Bool
-
Check that node x
and y
have equal domains within an absolute tolerance of r
.
sourceEAGO.solve_local_nlp!
— MethodConstructs and solves the problem locally on node y
updated the upper solution informaton in the optimizer.
sourceEAGO.set_dual!
— Methodset_dual!(m)
-
Retrieves the lower and upper duals for variable bounds from the relaxed_optimizer
and sets the appropriate values in the _lower_lvd
and _lower_uvd
storage fields.
sourceEAGO.update_relaxed_problem_box!
— Functionupdate_relaxed_problem_box!(m)
-
Update the relaxed constraint by setting the constraint set of v == x*
, xL_i <= x_i
, and x_i <= xU_i
for each such constraint added to the relaxed optimizer. Resets integral valued constraints to either EqualTo
or Interval
constraints.
sourceEAGO.reform_epigraph_min!
— Methodreform_epigraph_min!(m::GlobalOptimizer)
-
Perform an epigraph reformulation assuming the working_problem is a minimization problem.
sourceEAGO.label_fixed_variables!
— Methodlabel_fixed_variables!(m::GlobalOptimizer) -> Vector{Bool}
-
Detect any variables set to a fixed value by equality or inequality constraints and populate the _fixed_variable
storage array.
sourceEAGO.label_branch_variables!
— Methodlabel_branch_variables!(m::GlobalOptimizer)
-
Detect any variables participating in nonconvex terms and populate the _branch_variables
storage array.
sourceEAGO.add_nonlinear!
— Methodadd_nonlinear!(m::GlobalOptimizer)
-
Add an Evaluator and nonlinear functions and populate each appropriately.
sourceEAGO.parse_classify_problem!
— Methodparse_classify_problem!(m::GlobalOptimizer)
Interprets the type/number of constraints and the type of objective function to infer a problem type. Current possible types include:
LP
: Linear program; sent to optimize_lp.jl
- 'MILP
: Mixed integer linear program; sent to
optimize_lp.jl` SOCP
: Second-order cone program; sent to optimize_conic.jl
MINCVX
: Mixed-integer nonconvex; sent to optimize_nonconvex.jl
If the force_global_solve
parameter is set to true
, parse_classify_problem!
will set the problem type to MINCVX
to pass the problem to optimize_nonconvex.jl
.
sourceEAGO.local_problem_status
— Methodlocal_problem_status(t, r)
-
Takes an MOI.TerminationStatusCode
and a MOI.ResultStatusCode
and returns true
if this corresponds to a solution that is proven to be feasible. Returns false
otherwise.
sourceFunctions for Generating Console Output
EAGO.print_iteration!
— Functionprint_iteration!
Print status information based on iteration count. The header print frequency is based on the header_iterations
setting, and the data print frequency is based on the output_iterations
setting.
sourceEAGO.print_node!
— Functionprint_node!
Print information about the current node. Includes node ID, lower bound, upper bound, and interval box.
sourceEAGO.print_results!
— Functionprint_results!(m::GlobalOptimizer, lower_flag::Bool)
-
Print the results of a single (lower or upper) bounding problem. lower_flag=true
prints information for the lower problem, lower_flag=false
prints information for the upper problem.
sourceEAGO.print_solution!
— Functionprint_solution!
Print solution information for the B&B problem. Display node with the best solution, solution value, solution, and time spent solving subproblems. This print occurs following termination of the B&B algorithm.
sourceSupport for Log Output at Each Iteration
EAGO.Log
— Typemutable struct Log
A structure used to store information on the history of the solution procedure for generating convergence plots and other analyses.
current_lower_bound::Vector{Float64}
: Storage for lower bound calculated for current node.
current_upper_bound::Vector{Float64}
: Storage for upper bound calculated for current node.
preprocessing_time::Vector{Float64}
: Storage for preprocessing time of each iteration.
lower_problem_time::Vector{Float64}
: Storage for lower bounding time of each iteration.
upper_problem_time::Vector{Float64}
: Storage for upper bounding time of each iteration.
postprocessing_time::Vector{Float64}
: Storage for postprocessing time of each iteration.
preprocessing_feas::Vector{Bool}
: Storage for preprocessing feasibility of each iteration.
lower_problem_feas::Vector{Bool}
: Storage for lower bounding feasibility of each iteration.
upper_problem_feas::Vector{Bool}
: Storage for upper bounding feasibility of each iteration.
postprocessing_feas::Vector{Bool}
: Storage for postprocessing feasibility of each iteration.
global_lower_bound::Vector{Float64}
: Storage for best (global) lower bound at each iteration.
global_upper_bound::Vector{Float64}
: Storage for best (global) upper bound at each iteration.
node_count::Vector{Int64}
: Number of nodes at each iteration.
run_time::Vector{Float64}
: Run time at each iteration.
sourceEAGO.log_iteration!
— Methodlog_iteration!(m::GlobalOptimizer)
-
If log_on
is true, the global_lower_bound
, global_upper_bound
, run_time
, and node_count
are stored every log_interval
. If log_subproblem_info
then the lower bound, feasibility and run times of the subproblems are logged every log_interval
.
sourceInterval Representations of Expressions
EAGO.AbstractEAGOConstraint
— Typeabstract type AbstractEAGOConstraint
An abstract super-type used for representing constraints built by EAGO's backend.
sourceEAGO.AffineFunctionEq
— Typemutable struct AffineFunctionEq <: EAGO.AbstractEAGOConstraint
Representation of an affine equality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
sourceEAGO.AffineFunctionIneq
— Typemutable struct AffineFunctionIneq <: EAGO.AbstractEAGOConstraint
Representation of an affine inequality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
sourceEAGO.BufferedQuadraticIneq
— Typemutable struct BufferedQuadraticIneq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic inequality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
sourceEAGO.BufferedQuadraticEq
— Typemutable struct BufferedQuadraticEq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic equality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
minus_func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
sourceEAGO.NonlinearExpression
— Typemutable struct NonlinearExpression{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general quadratic function with a buffer.
sourceEAGO.BufferedNonlinearFunction
— Typemutable struct BufferedNonlinearFunction{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general nonlinear function with a buffer represented by the sum of a tape and a scalar affine function.
sourceSettings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+end
The same functionality could be accomplished by setting the EAGOParameter
field force_global_solve
to be true.
EAGO.is_integer_subproblem
— Methodis_integer_subproblem(m)
+
Returns true
that the subproblem at the current node n
has participating integer variables that have not been fixed to constant valued as the branch-and-bound algorithm progresses. Returns false
otherwise.
EAGO.is_integer_feasible_local
— Methodis_integer_feasible_local(m::GlobalOptimizer, d) -> Bool
+
Checks that the solution of a local solve is integer feasible to within the tolerances specified by integer_abs_tol
and integer_rel_tol
.
EAGO.is_integer_feasible_relaxed
— Methodis_integer_feasible_relaxed(m::GlobalOptimizer) -> Bool
+
Check that the solution of the lower (relaxed problem) is integer feasible to within tolerances specified by the parameters: integer_abs_tol
(absolute tolerance) and integer_rel_tol
(relative tolerance).
EAGO.interval_bound
— Functioninterval_bound(::GlobalOptimizer, ::T)
Compute a tuple representing the lower and upper interval bounds for an AbstractEAGOConstraint
representing an equality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
EAGO.lower_interval_bound
— Functionlower_interval_bound(::GlobalOptimizer, ::T)
Compute the lower interval bound for an AbstractEAGOConstraint
representing an inequality constraint.
Options for T (all are subtypes of AbstractEAGOConstraint):
EAGO.same_box
— Methodsame_box(x::NodeBB, y::NodeBB, r::Float64) -> Bool
+
Check that node x
and y
have equal domains within an absolute tolerance of r
.
EAGO.solve_local_nlp!
— MethodConstructs and solves the problem locally on node y
updated the upper solution informaton in the optimizer.
EAGO.set_dual!
— Methodset_dual!(m)
+
Retrieves the lower and upper duals for variable bounds from the relaxed_optimizer
and sets the appropriate values in the _lower_lvd
and _lower_uvd
storage fields.
EAGO.update_relaxed_problem_box!
— Functionupdate_relaxed_problem_box!(m)
+
Update the relaxed constraint by setting the constraint set of v == x*
, xL_i <= x_i
, and x_i <= xU_i
for each such constraint added to the relaxed optimizer. Resets integral valued constraints to either EqualTo
or Interval
constraints.
EAGO.reform_epigraph_min!
— Methodreform_epigraph_min!(m::GlobalOptimizer)
+
Perform an epigraph reformulation assuming the working_problem is a minimization problem.
EAGO.label_fixed_variables!
— Methodlabel_fixed_variables!(m::GlobalOptimizer) -> Vector{Bool}
+
Detect any variables set to a fixed value by equality or inequality constraints and populate the _fixed_variable
storage array.
EAGO.label_branch_variables!
— Methodlabel_branch_variables!(m::GlobalOptimizer)
+
Detect any variables participating in nonconvex terms and populate the _branch_variables
storage array.
EAGO.add_nonlinear!
— Methodadd_nonlinear!(m::GlobalOptimizer)
+
Add an Evaluator and nonlinear functions and populate each appropriately.
EAGO.parse_classify_problem!
— Methodparse_classify_problem!(m::GlobalOptimizer)
Interprets the type/number of constraints and the type of objective function to infer a problem type. Current possible types include:
LP
: Linear program; sent to optimize_lp.jl
: Mixed integer linear program; sent to
optimize_lp.jl`SOCP
: Second-order cone program; sent to optimize_conic.jl
MINCVX
: Mixed-integer nonconvex; sent to optimize_nonconvex.jl
If the force_global_solve
parameter is set to true
, parse_classify_problem!
will set the problem type to MINCVX
to pass the problem to optimize_nonconvex.jl
.
EAGO.local_problem_status
— Methodlocal_problem_status(t, r)
+
Takes an MOI.TerminationStatusCode
and a MOI.ResultStatusCode
and returns true
if this corresponds to a solution that is proven to be feasible. Returns false
otherwise.
EAGO.print_iteration!
— Functionprint_iteration!
Print status information based on iteration count. The header print frequency is based on the header_iterations
setting, and the data print frequency is based on the output_iterations
setting.
EAGO.print_node!
— Functionprint_node!
Print information about the current node. Includes node ID, lower bound, upper bound, and interval box.
EAGO.print_results!
— Functionprint_results!(m::GlobalOptimizer, lower_flag::Bool)
+
Print the results of a single (lower or upper) bounding problem. lower_flag=true
prints information for the lower problem, lower_flag=false
prints information for the upper problem.
EAGO.print_solution!
— Functionprint_solution!
Print solution information for the B&B problem. Display node with the best solution, solution value, solution, and time spent solving subproblems. This print occurs following termination of the B&B algorithm.
EAGO.Log
— Typemutable struct Log
A structure used to store information on the history of the solution procedure for generating convergence plots and other analyses.
current_lower_bound::Vector{Float64}
: Storage for lower bound calculated for current node.
current_upper_bound::Vector{Float64}
: Storage for upper bound calculated for current node.
preprocessing_time::Vector{Float64}
: Storage for preprocessing time of each iteration.
lower_problem_time::Vector{Float64}
: Storage for lower bounding time of each iteration.
upper_problem_time::Vector{Float64}
: Storage for upper bounding time of each iteration.
postprocessing_time::Vector{Float64}
: Storage for postprocessing time of each iteration.
preprocessing_feas::Vector{Bool}
: Storage for preprocessing feasibility of each iteration.
lower_problem_feas::Vector{Bool}
: Storage for lower bounding feasibility of each iteration.
upper_problem_feas::Vector{Bool}
: Storage for upper bounding feasibility of each iteration.
postprocessing_feas::Vector{Bool}
: Storage for postprocessing feasibility of each iteration.
global_lower_bound::Vector{Float64}
: Storage for best (global) lower bound at each iteration.
global_upper_bound::Vector{Float64}
: Storage for best (global) upper bound at each iteration.
node_count::Vector{Int64}
: Number of nodes at each iteration.
run_time::Vector{Float64}
: Run time at each iteration.
EAGO.log_iteration!
— Methodlog_iteration!(m::GlobalOptimizer)
+
If log_on
is true, the global_lower_bound
, global_upper_bound
, run_time
, and node_count
are stored every log_interval
. If log_subproblem_info
then the lower bound, feasibility and run times of the subproblems are logged every log_interval
.
EAGO.AbstractEAGOConstraint
— Typeabstract type AbstractEAGOConstraint
An abstract super-type used for representing constraints built by EAGO's backend.
EAGO.AffineFunctionEq
— Typemutable struct AffineFunctionEq <: EAGO.AbstractEAGOConstraint
Representation of an affine equality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.AffineFunctionIneq
— Typemutable struct AffineFunctionIneq <: EAGO.AbstractEAGOConstraint
Representation of an affine inequality. Currently only used for bound tightening.
terms::Vector{Tuple{Float64, Int64}}
constant::Float64
len::Int64
EAGO.BufferedQuadraticIneq
— Typemutable struct BufferedQuadraticIneq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic inequality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.BufferedQuadraticEq
— Typemutable struct BufferedQuadraticEq <: EAGO.AbstractEAGOConstraint
Representation of a general quadratic equality constraint with a buffer.
func::MathOptInterface.ScalarQuadraticFunction{Float64}
minus_func::MathOptInterface.ScalarQuadraticFunction{Float64}
buffer::Dict{Int64, Float64}
saf::MathOptInterface.ScalarAffineFunction{Float64}
len::Int64
EAGO.NonlinearExpression
— Typemutable struct NonlinearExpression{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general quadratic function with a buffer.
EAGO.BufferedNonlinearFunction
— Typemutable struct BufferedNonlinearFunction{V, N, T<:RelaxTag} <: EAGO.AbstractEAGOConstraint
Stores a general nonlinear function with a buffer represented by the sum of a tape and a scalar affine function.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
Variable bound tightening based on the duality multipliers are supported.
EAGO.variable_dbbt!
— Functionvariable_dbbt!(
+Domain Reduction · EAGO.jl Domain Reduction
Duality-Based Bound Tightening
Variable bound tightening based on the duality multipliers are supported.
EAGO.variable_dbbt!
— Functionvariable_dbbt!(
n::NodeBB,
mult_lo::Vector{Float64},
mult_hi::Vector{Float64},
@@ -7,21 +7,21 @@
UBD::Float64,
nx::Int64
)
-
Tighten the bounds of the _current_node
using the current global upper bound and the duality information obtained from the relaxation.
sourceSpecial Forms
Bound tightening for linear forms, univariate quadratic forms, and bivariate quadratic forms are also supported.
EAGO.fbbt!
— Functionfbbt!(m::GlobalOptimizer, f::T)
Performs feasibility-based bound tightening on a back-end constraint and returns true
if it is feasible or false
if it is infeasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
sourceConstraint Propagation
EAGO contains a constraint propagation architecture that supported forward and reverse evaluation of set-valued functions on the directed acyclic graph. The interval contractor and reverse McCormick relaxation-based contractors are currently available.
EAGO.set_constraint_propagation_fbbt!
— Functionset_constraint_propagation_fbbt!(
+
Tighten the bounds of the _current_node
using the current global upper bound and the duality information obtained from the relaxation.
sourceSpecial Forms
Bound tightening for linear forms, univariate quadratic forms, and bivariate quadratic forms are also supported.
EAGO.fbbt!
— Functionfbbt!(m::GlobalOptimizer, f::T)
Performs feasibility-based bound tightening on a back-end constraint and returns true
if it is feasible or false
if it is infeasible.
Options for T (all are subtypes of AbstractEAGOConstraint):
- AffineFunctionIneq
- AffineFunctionEq
sourceConstraint Propagation
EAGO contains a constraint propagation architecture that supported forward and reverse evaluation of set-valued functions on the directed acyclic graph. The interval contractor and reverse McCormick relaxation-based contractors are currently available.
EAGO.set_constraint_propagation_fbbt!
— Functionset_constraint_propagation_fbbt!(
m::GlobalOptimizer{R, S, Q<:ExtensionType}
) -> Bool
-
Performs bound tightening based on forward/reverse interval and/or McCormick passes. This routine resets the current node with new interval bounds.
sourceOptimization-Based Bound Tightening
EAGO makes use of an optimization-based bound tightening scheme using filtering and greedy ordering as detailed in [1].
EAGO.obbt!
— Functionobbt!(m::GlobalOptimizer{R, S, Q<:ExtensionType}) -> Bool
-
Performs OBBT with filtering and greedy ordering as detailed in: Gleixner, A.M., Berthold, T., Müller, B. et al. J Glob Optim (2017) 67: 731. https://doi.org/10.1007/s10898-016-0450-4
sourceEAGO.trivial_filtering!
— Methodtrivial_filtering!(
+
Performs bound tightening based on forward/reverse interval and/or McCormick passes. This routine resets the current node with new interval bounds.
sourceOptimization-Based Bound Tightening
EAGO makes use of an optimization-based bound tightening scheme using filtering and greedy ordering as detailed in [1].
EAGO.obbt!
— Functionobbt!(m::GlobalOptimizer{R, S, Q<:ExtensionType}) -> Bool
+
Performs OBBT with filtering and greedy ordering as detailed in: Gleixner, A.M., Berthold, T., Müller, B. et al. J Glob Optim (2017) 67: 731. https://doi.org/10.1007/s10898-016-0450-4
sourceEAGO.trivial_filtering!
— Methodtrivial_filtering!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
n::NodeBB
)
-
Excludes OBBT on variable indices that are tight for the solution of the relaxation.
sourceEAGO.aggressive_filtering!
— Methodaggressive_filtering!(
+
Excludes OBBT on variable indices that are tight for the solution of the relaxation.
sourceEAGO.aggressive_filtering!
— Methodaggressive_filtering!(
m::GlobalOptimizer{R, S, Q<:ExtensionType},
n::NodeBB
) -> Bool
-
Excludes OBBT on variable indices after a search in a filtering direction.
sourceEAGO.bool_indx_diff!
— Methodbool_indx_diff!(
+
Excludes OBBT on variable indices after a search in a filtering direction.
sourceEAGO.bool_indx_diff!
— Methodbool_indx_diff!(
z::Vector{Bool},
x::Vector{Bool},
y::Vector{Bool}
) -> Vector{Bool}
-
Utility function used to set vector of booleans z to x & ~y. Avoids the generation of conversion of the BitArray created by broadcasting logical operators.
sourceReferences
- Gleixner, A.M., Berthold, T., Müller, B. et al. J Glob Optim (2017) 67: 731. https://doi.org/10.1007/s10898-016-0450-4
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+
Utility function used to set vector of booleans z to x & ~y. Avoids the generation of conversion of the BitArray created by broadcasting logical operators.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
By default, EAGO uses GLPK for solving linear subproblems introduced. Using a commercial linear programming (LP) solver is highly recommended, such as Gurobi, CPLEX, or XPRESS. Both Gurobi and CPLEX are free for academics and installation information can be found on the Gurobi website and the IBM website, respectively.
A non-default LP solver can then be selected by the user via a series of keyword argument inputs as illustrated in the code snippet below. The relaxed_optimizer
contains an instance optimizer with valid relaxations that are made at the root node and is updated with affine relaxations in place.
# Create opt EAGO Optimizer with Gurobi as a lower subsolver
+High-Performance Configuration · EAGO.jl High-Performance Configuration
Linear Programming Solver Selection
By default, EAGO uses GLPK for solving linear subproblems introduced. Using a commercial linear programming (LP) solver is highly recommended, such as Gurobi, CPLEX, or XPRESS. Both Gurobi and CPLEX are free for academics and installation information can be found on the Gurobi website and the IBM website, respectively.
A non-default LP solver can then be selected by the user via a series of keyword argument inputs as illustrated in the code snippet below. The relaxed_optimizer
contains an instance optimizer with valid relaxations that are made at the root node and is updated with affine relaxations in place.
# Create opt EAGO Optimizer with Gurobi as a lower subsolver
eago_factory = () -> EAGO.Optimizer(SubSolvers(; r = Gurobi.Optimizer()))
m = Model(eago_factory)
Rounding Mode
The IntervalArithmetic.jl package supports a number of different directed rounding modes. The default directed rounding mode is :tight
. It is recommended that the user specify that :accurate
directed rounding mode be used as it may results in a significant performance improvement. Setting a rounding mode can requires the redefinition of a number of functions. As a result, this should only be done at the top-level by the user (rather than by using keyword arguments). To set the rounding mode to :accurate
using the following syntax when loading the EAGO package initially:
using IntervalArithmetic; setrounding(Interval, :accurate)
using EAGO
-# REST OF CODE
Ipopt Build
Ipopt is the recommended solver for upper-bounding problems. Ipopt's performance is highly dependent on the linear algebra package used (up to 30x). By default MUMPS is used. It is recommended that you either compile Ipopt with HSL MA57 or the Pardiso linear algebra packages with a machine specific Blas library (for Intel users the JuliaPro MKL version is recommended). For information on this, see the links below:
- Compiling Ipopt
- Julia specifics:
- Pointing Ipopt to a compiled version:
- Issues using Pardiso:
- HSL website
- Pardiso website
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+# REST OF CODE
Ipopt is the recommended solver for upper-bounding problems. Ipopt's performance is highly dependent on the linear algebra package used (up to 30x). By default MUMPS is used. It is recommended that you either compile Ipopt with HSL MA57 or the Pardiso linear algebra packages with a machine specific Blas library (for Intel users the JuliaPro MKL version is recommended). For information on this, see the links below:
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
The Optimizer
object holds all algorithm solution information. A description of all user-facing options has been provided in the docstring.
EAGO.Optimizer
— Typemutable struct Optimizer{Q, S, T} <: MathOptInterface.AbstractOptimizer
The highest level optimizer object used by EAGO to solve problems during the optimization routine. Additional options and temporary storage are located in the _global_optimizer::GlobalOptimizer{Q,S,T}
field. Parameters which are expected to be constant over the entire solve are stored in the _parameters::EAGOParameters
field. Some user-facing keywords not in the EAGOParameters
field include:
relaxed_optimizer::MOI.AbstractOptimizer
: An instance of the optimizer used to solve the relaxed subproblems (default = Cbc.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.upper_optimizer::MOI.AbstractOptimizer
: Optimizer used to solve upper bounding problems (default = Ipopt.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.ext::ExtensionType
: Holds an instance of a subtype of EAGO.ExtensionType
, used to define new custom subroutines (default = DefaultExt()
). Located in subsolver_block::SubSolvers{Q,S,T}
.enable_optimize_hook::Bool
: Specifies that the user-defined optimize_hook!
function should be called rather than use the standard EAGO optimization routines. Located in Optimizer
and _global_optimizer::GlobalOptimizer{Q,S,T}
.obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions). Located in _global_optimizer::GlobalOptimizer{Q,S,T}
.Descriptions of all Optimizer
fields available in extended help.
Extended Help
subsolver_block::SubSolvers{Q, S, T} where {Q, S, T}
: Holds definitions of the relaxed and upper optimizers, as well as any user-defined extension types
enable_optimize_hook::Bool
: Specifies that the optimize_hook! function should be called rather than throw the problem to the standard routine
ext::Union{Nothing, T} where T
: (Deprecated, use subsolver_block
instead) Storage for custom extension types
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
_global_optimizer::GlobalOptimizer{Q, S, T} where {Q, S, T}
: Additional options and temporary storage for solving optimization problems
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_optimizer_attributes_set::Vector{MathOptInterface.AbstractOptimizerAttribute}
: Set of optimizer attributes
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_run_time::Float64
: Optimization run time
_objective_value::Float64
: The objective value of the primal solution
_objective_bound::Float64
: The best-known bound on the optimal objective value
_relative_gap::Float64
: The gap between the upper and lower bound, relative to the bound with the larger magnitude
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
EAGO supports a number of functions and operators that for which specialized relaxation routines are available. These can be registered and added to a JuMP model using the function:
EAGO.register_eago_operators!
— Methodregistereagooperators!
Registers all nonstandard nonlinear terms available in EAGO in a JuMP. Uses of these is generally preferable in EAGO as the relaxations EAGO will generate will usually be tighter (speeding up convergence time). Note that this will work can be used by other nonlinear solvers (Ipopt for instance).
EAGO.EAGOParameters
— Typemutable struct EAGOParameters
Storage for parameters that do not change during a global solve.
presolve_scrubber_flag::Bool
: Should EAGO attempt to remove type-assert issues for user-defined functions (default = false)
presolve_to_JuMP_flag::Bool
: Create and use DAG representations of user-defined functions (default = false)
presolve_flatten_flag::Bool
: Rerrange the DAG using registered transformations (default = false)
conic_convert_quadratic::Bool
: Attempt to bridge convex constraint to second-order cone (default = false)
log_on::Bool
: Turn logging on; record global bounds, node count, and run time. Additional options are available for recording information specific to subproblems (default = false)
log_subproblem_info::Bool
: Turn on logging of times and feasibility of subproblems (default = false)
log_interval::Int64
: Log data every log_interval
iterations (default = 1)
verbosity::Int64
: The amount of information that should be printed to console while solving. Values range from 0 - 4: 0 is silent, 1 shows iteration summary statistics only, 2-4 show varying degrees of detail about calculations within each iteration (default = 1)
output_iterations::Int64
: Display summary of iteration to console every output_iterations
(default = 1000)
header_iterations::Int64
: Display header for summary to console every output_iterations
(default = 100000)
branch_cvx_factor::Float64
: Convex coefficient used to select branch point. Branch point is given by branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
(default = 0.25)
branch_offset::Float64
: Minimum distance from bound to have branch point, normalized by width of dimension to branch on (default = 0.15)
branch_pseudocost_on::Bool
: Indicate that pseudocost branching should be used (default = false)
branch_variable::Vector{Bool}
: Variables to branch on (default is all nonlinear)
branch_max_repetitions::Int64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Number of times to repeat node processing prior to branching (default = 4)
branch_repetition_tol::Float64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Volume ratio tolerance required to repeat processing the current node (default = 0.9)
node_limit::Int64
: Maximum number of nodes (default = 1E7)
time_limit::Float64
: Maximum CPU time in seconds (default = 3600)
iteration_limit::Int64
: Maximum number of iterations (default 1E9)
absolute_tolerance::Float64
: Absolute tolerance for termination (default = 1E-3)
relative_tolerance::Float64
: Relative tolerance for termination (default = 1E-3)
absolute_constraint_feas_tolerance::Float64
: Absolute constraint feasibility tolerance (default = 1E-8)
cp_depth::Int64
: Depth in B&B tree above which constraint propagation should be disabled (default = 0)
cp_repetitions::Int64
: Number of times to repeat forward-reverse pass routine (default = 0)
cp_tolerance::Float64
: Disable constraint propagation if the ratio of new node volume to beginning node volume exceeds this number (default = 0.99)
cp_interval_only::Bool
: Use only valid interval bounds during constraint propagation (default = false)
obbt_depth::Int64
: Depth in B&B tree above which OBBT should be disabled (default = 6)
obbt_repetitions::Int64
: Number of repetitions of OBBT to perform in preprocessing (default = 3)
obbt_aggressive_on::Bool
: Turn on aggresive OBBT (default = true)
obbt_aggressive_max_iteration::Int64
: Maximum iteration to perform aggresive OBBT (default = 2)
obbt_aggressive_min_dimension::Int64
: Minimum dimension to perform aggresive OBBT (default = 2)
obbt_tolerance::Float64
: Tolerance to consider bounds equal (default = 1E-10)
fbbt_lp_depth::Int64
: Depth in B&B tree above which linear FBBT should be disabled (default = 1000)
fbbt_lp_repetitions::Int64
: Number of repetitions of linear FBBT to perform in preprocessing (default = 3)
dbbt_depth::Int64
: Depth in B&B tree above which duality-based bound tightening should be disabled (default = 1E10)
dbbt_tolerance::Float64
: New bound is considered equal to the prior bound if within dbbt_tolerance (default = 1E-8)
relax_tag::RelaxTag
: RelaxTag used to specify type of McCormick operator (default = NS())
subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a forward pass (default = true)
reverse_subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a reverse pass (default = false)
subgrad_tol::Float64
: Outer-round computed subgradient bounds by this amount (default = 1E-10)
mul_relax_style::Int64
: Select the type of relaxation to use for the bilinear term (multiplication): 0 corresponds to a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation with implied apriori relaxations: (1) corresponds to a subgradient-based apriori relaxation approach; (2) corresponds to an affine arithmetic-based apriori approach; and (3) corresponds to a enumerative apriori relaxation-based approach (default = 0)
cut_min_iterations::Int64
: Minimum number of cuts at each node to attempt (unsafe cuts not necessarily added) (default = 2)
cut_max_iterations::Int64
: Maximum number of cuts at each node to attempt (default = 8)
cut_tolerance_abs::Float64
: Absolute tolerance checked for continuing cut (default = 1E-6)
cut_tolerance_rel::Float64
: Relative tolerance checked for continuing cut (default = 1E-3)
cut_safe_on::Bool
: Use tolerances to determine safe cuts in a Khajavirad 2018 manner (default = true)
cut_safe_l::Float64
: Lower tolerance for safe-lp cut, Khajavirad 2018 (default = 1E-7)
cut_safe_u::Float64
: Upper tolerance for safe-lp cut, Khajavirad 2018 (default = 1E7)
cut_safe_b::Float64
: Constant tolerance for safe-lp cut, Khajavirad 2018 (default = 1E9)
upper_bounding_depth::Int64
: Solve upper problem for every node with depth less than upper_bounding_depth
, and otherwise solve upper problems with a probability of (1/2)^(depth-upper_bounding_depth)
(default = 8)
domain_violation_guard_on::Bool
: (Unused) Protect against domain violation (default = false)
domain_violation_ϵ::Float64
: (Unused) Amount about a domain violation to ignore when propagating bounds (default = 1E-9)
user_solver_config::Bool
: If true, EAGO forgoes its default configuration process for subsolvers (default = false)
integer_abs_tol::Float64
: Absolute tolerance used to check for integrality of decision variables (default = 1E-9)
integer_rel_tol::Float64
: Relative tolerance used to check for integrality of decision variables (default = 1E-9)
force_global_solve::Bool
: Ignore EAGO's ability to parse problem types and force it to run global optimization (default = false)
unbounded_check::Bool
: Check that all branching variables have finite bounds and set them to +/- 1E10 if not (default = true)
EAGO.VariableInfo
— Typestruct VariableInfo{T<:AbstractFloat}
A structure used to store information related to the bounds assigned to each variable.
is_integer::Bool
: Is the variable integer valued?
has_lower_bound::Bool
: Boolean indicating whether a finite lower bound exists.
has_upper_bound::Bool
: Boolean indicating whether a finite upper bound exists.
is_fixed::Bool
: Boolean indicating if variable is fixed to a finite value.
has_constraints::Bool
: Boolean indicating that constraints have been set
lower_bound::AbstractFloat
: Lower bound. May be -Inf.
upper_bound::AbstractFloat
: Upper bound. May be Inf.
EAGO.ExtensionType
— Typeabstract type ExtensionType
An abstract type the subtypes of which are associated with functions method overloaded for new extensions. An instance of this is the DefaultExt <: ExtensionType
structure in the ext_type
field of the Optimizer
.
EAGO.InputProblem
— Typemutable struct InputProblem
A structure used to hold objectives and constraints added to the EAGO model. The constraints generally aren't used for relaxations.
All field information available in extended help.
Extended Help
_variable_count::Int64
: Count for the number of variables
_variable_names::Dict{MathOptInterface.VariableIndex, String}
: Dictionary containing variable indices and their names
_constraint_count::Int64
: Count for the number of constraints
_vi_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
_vi_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
_vi_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}}
_vi_it_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}}
_vi_zo_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}}
_vi_int_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
_linear_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_conic_second_order::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}, Tuple{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}}
_linear_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_linear_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_linear_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_quadratic_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_quadratic_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_quadratic_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_linear_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_objective::Union{Nothing, MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarQuadraticFunction{Float64}}
: Storage for the objective function
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
: Storage for NLP constraints (set by MOI.set(m, ::NLPBlockData...)
in moi_wrapper.jl
)
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
EAGO.ParsedProblem
— Typemutable struct ParsedProblem
A structure used to store expressions and problem descriptions EAGO uses to formulate relaxed problems.
All field information available in extended help.
Extended Help
_problem_type::Union{Nothing, EAGO.DIFF_CVX, EAGO.LP, EAGO.MILP, EAGO.MINCVX, EAGO.MISOCP, EAGO.SOCP}
: Problem classification (set in parse_classify_problem!
)
_objective_saf::MathOptInterface.ScalarAffineFunction{Float64}
: Stores the objective and is used for constructing linear affine cuts
_objective::Union{Nothing, MathOptInterface.VariableIndex, EAGO.AffineFunctionIneq, EAGO.BufferedQuadraticIneq, EAGO.BufferedNonlinearFunction}
: Storage for the objective function
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
_saf_leq::Vector{EAGO.AffineFunctionIneq}
_saf_eq::Vector{EAGO.AffineFunctionEq}
_sqf_leq::Vector{EAGO.BufferedQuadraticIneq}
_sqf_eq::Vector{EAGO.BufferedQuadraticEq}
_conic_second_order::Vector{EAGO.BufferedSOC}
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
_nonlinear_constr::Vector{EAGO.BufferedNonlinearFunction}
_relaxed_evaluator::Evaluator
_variable_info::Vector{VariableInfo{Float64}}
: Variable information (set in initial_parse!
)
_variable_count::Int64
: Count for the number of variables
EAGO.initial_parse!
— Methodinitial_parse!(m::Optimizer{R, S, T})
-
Translate the input problem to the working problem. Any checks or optional manipulation are left to the presolve stage.
Functionality has been included that allows for extensions to EAGO's Optimizer
to be readily defined. This can be done in two ways first defining a new structure which is a subtype of ExtensionType
and overloading methods associated with this new structure. An instance of this new structure is provided to the Optimizer
using the ext_type
keyword. This results in EAGO now dispatch to the new methods rather than the generally defined methods for the parent type. For a complete example, the reader is directed to the interval bounding example and the quasiconvex example. Alternatively, the user can overload the optimize_hook!
for this subtype which will entirely circumvent the default global solution routine. Additional information can be stored in the ext
field of the Optimizer
. In order to allow for compatibility between packages the user is encouraged to append their extension name to the start of each variable name (e.g. newext_newdata
).
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
The Optimizer
object holds all algorithm solution information. A description of all user-facing options has been provided in the docstring.
EAGO.Optimizer
— Typemutable struct Optimizer{Q, S, T} <: MathOptInterface.AbstractOptimizer
The highest level optimizer object used by EAGO to solve problems during the optimization routine. Additional options and temporary storage are located in the _global_optimizer::GlobalOptimizer{Q,S,T}
field. Parameters which are expected to be constant over the entire solve are stored in the _parameters::EAGOParameters
field. Some user-facing keywords not in the EAGOParameters
field include:
relaxed_optimizer::MOI.AbstractOptimizer
: An instance of the optimizer used to solve the relaxed subproblems (default = Cbc.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.upper_optimizer::MOI.AbstractOptimizer
: Optimizer used to solve upper bounding problems (default = Ipopt.Optimizer()
). Located in subsolver_block::SubSolvers{Q,S,T}
.ext::ExtensionType
: Holds an instance of a subtype of EAGO.ExtensionType
, used to define new custom subroutines (default = DefaultExt()
). Located in subsolver_block::SubSolvers{Q,S,T}
.enable_optimize_hook::Bool
: Specifies that the user-defined optimize_hook!
function should be called rather than use the standard EAGO optimization routines. Located in Optimizer
and _global_optimizer::GlobalOptimizer{Q,S,T}
.obbt_variable_values::Vector{Bool}
: Variables to perform OBBT on (default: all variables in nonlinear expressions). Located in _global_optimizer::GlobalOptimizer{Q,S,T}
.Descriptions of all Optimizer
fields available in extended help.
Extended Help
subsolver_block::SubSolvers{Q, S, T} where {Q, S, T}
: Holds definitions of the relaxed and upper optimizers, as well as any user-defined extension types
enable_optimize_hook::Bool
: Specifies that the optimize_hook! function should be called rather than throw the problem to the standard routine
ext::Union{Nothing, T} where T
: (Deprecated, use subsolver_block
instead) Storage for custom extension types
_auxiliary_variable_info::Union{Nothing, EAGO._AuxVarData}
: Information on any auxiliary variables
_global_optimizer::GlobalOptimizer{Q, S, T} where {Q, S, T}
: Additional options and temporary storage for solving optimization problems
_input_problem::InputProblem
: Expressions and constraints added to the EAGO model (not directly used for relaxations)
_working_problem::ParsedProblem
: Expressions and problem descriptions that EAGO uses to formulate relaxed problems
_parameters::EAGOParameters
: Parameters that do not change during a global solve
_optimizer_attributes_set::Vector{MathOptInterface.AbstractOptimizerAttribute}
: Set of optimizer attributes
_termination_status_code::MathOptInterface.TerminationStatusCode
: The MathOptInterface-compliant completion status code
_result_status_code::MathOptInterface.ResultStatusCode
: Value indicating the feasibility status of the result
_run_time::Float64
: Optimization run time
_objective_value::Float64
: The objective value of the primal solution
_objective_bound::Float64
: The best-known bound on the optimal objective value
_relative_gap::Float64
: The gap between the upper and lower bound, relative to the bound with the larger magnitude
_iteration_count::Int64
: The number of iterations the branch-and-bound algorithm has completed
_node_count::Int64
: The number of nodes in the stack
EAGO supports a number of functions and operators that for which specialized relaxation routines are available. These can be registered and added to a JuMP model using the function:
EAGO.register_eago_operators!
— Methodregistereagooperators!
Registers all nonstandard nonlinear terms available in EAGO in a JuMP. Uses of these is generally preferable in EAGO as the relaxations EAGO will generate will usually be tighter (speeding up convergence time). Note that this will work can be used by other nonlinear solvers (Ipopt for instance).
EAGO.EAGOParameters
— Typemutable struct EAGOParameters
Storage for parameters that do not change during a global solve.
presolve_scrubber_flag::Bool
: Should EAGO attempt to remove type-assert issues for user-defined functions (default = false)
presolve_to_JuMP_flag::Bool
: Create and use DAG representations of user-defined functions (default = false)
presolve_flatten_flag::Bool
: Rerrange the DAG using registered transformations (default = false)
conic_convert_quadratic::Bool
: Attempt to bridge convex constraint to second-order cone (default = false)
log_on::Bool
: Turn logging on; record global bounds, node count, and run time. Additional options are available for recording information specific to subproblems (default = false)
log_subproblem_info::Bool
: Turn on logging of times and feasibility of subproblems (default = false)
log_interval::Int64
: Log data every log_interval
iterations (default = 1)
verbosity::Int64
: The amount of information that should be printed to console while solving. Values range from 0 - 4: 0 is silent, 1 shows iteration summary statistics only, 2-4 show varying degrees of detail about calculations within each iteration (default = 1)
output_iterations::Int64
: Display summary of iteration to console every output_iterations
(default = 1000)
header_iterations::Int64
: Display header for summary to console every output_iterations
(default = 100000)
branch_cvx_factor::Float64
: Convex coefficient used to select branch point. Branch point is given by branch_cvx_factor*xmid + (1-branch_cvx_factor)*xsol
(default = 0.25)
branch_offset::Float64
: Minimum distance from bound to have branch point, normalized by width of dimension to branch on (default = 0.15)
branch_pseudocost_on::Bool
: Indicate that pseudocost branching should be used (default = false)
branch_variable::Vector{Bool}
: Variables to branch on (default is all nonlinear)
branch_max_repetitions::Int64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Number of times to repeat node processing prior to branching (default = 4)
branch_repetition_tol::Float64
: [FUTURE FEATURE, NOT CURRENTLY IMPLEMENTED] Volume ratio tolerance required to repeat processing the current node (default = 0.9)
node_limit::Int64
: Maximum number of nodes (default = 1E7)
time_limit::Float64
: Maximum CPU time in seconds (default = 3600)
iteration_limit::Int64
: Maximum number of iterations (default 1E9)
absolute_tolerance::Float64
: Absolute tolerance for termination (default = 1E-3)
relative_tolerance::Float64
: Relative tolerance for termination (default = 1E-3)
absolute_constraint_feas_tolerance::Float64
: Absolute constraint feasibility tolerance (default = 1E-8)
cp_depth::Int64
: Depth in B&B tree above which constraint propagation should be disabled (default = 0)
cp_repetitions::Int64
: Number of times to repeat forward-reverse pass routine (default = 0)
cp_tolerance::Float64
: Disable constraint propagation if the ratio of new node volume to beginning node volume exceeds this number (default = 0.99)
cp_interval_only::Bool
: Use only valid interval bounds during constraint propagation (default = false)
obbt_depth::Int64
: Depth in B&B tree above which OBBT should be disabled (default = 6)
obbt_repetitions::Int64
: Number of repetitions of OBBT to perform in preprocessing (default = 3)
obbt_aggressive_on::Bool
: Turn on aggresive OBBT (default = true)
obbt_aggressive_max_iteration::Int64
: Maximum iteration to perform aggresive OBBT (default = 2)
obbt_aggressive_min_dimension::Int64
: Minimum dimension to perform aggresive OBBT (default = 2)
obbt_tolerance::Float64
: Tolerance to consider bounds equal (default = 1E-10)
fbbt_lp_depth::Int64
: Depth in B&B tree above which linear FBBT should be disabled (default = 1000)
fbbt_lp_repetitions::Int64
: Number of repetitions of linear FBBT to perform in preprocessing (default = 3)
dbbt_depth::Int64
: Depth in B&B tree above which duality-based bound tightening should be disabled (default = 1E10)
dbbt_tolerance::Float64
: New bound is considered equal to the prior bound if within dbbt_tolerance (default = 1E-8)
relax_tag::RelaxTag
: RelaxTag used to specify type of McCormick operator (default = NS())
subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a forward pass (default = true)
reverse_subgrad_tighten::Bool
: Perform tightening of interval bounds using subgradients at each factor in each nonlinear tape during a reverse pass (default = false)
subgrad_tol::Float64
: Outer-round computed subgradient bounds by this amount (default = 1E-10)
mul_relax_style::Int64
: Select the type of relaxation to use for the bilinear term (multiplication): 0 corresponds to a standard McCormick arithmetic approach. Settings 1-3 augment the standard McCormick relaxation with implied apriori relaxations: (1) corresponds to a subgradient-based apriori relaxation approach; (2) corresponds to an affine arithmetic-based apriori approach; and (3) corresponds to a enumerative apriori relaxation-based approach (default = 0)
cut_min_iterations::Int64
: Minimum number of cuts at each node to attempt (unsafe cuts not necessarily added) (default = 2)
cut_max_iterations::Int64
: Maximum number of cuts at each node to attempt (default = 8)
cut_tolerance_abs::Float64
: Absolute tolerance checked for continuing cut (default = 1E-6)
cut_tolerance_rel::Float64
: Relative tolerance checked for continuing cut (default = 1E-3)
cut_safe_on::Bool
: Use tolerances to determine safe cuts in a Khajavirad 2018 manner (default = true)
cut_safe_l::Float64
: Lower tolerance for safe-lp cut, Khajavirad 2018 (default = 1E-7)
cut_safe_u::Float64
: Upper tolerance for safe-lp cut, Khajavirad 2018 (default = 1E7)
cut_safe_b::Float64
: Constant tolerance for safe-lp cut, Khajavirad 2018 (default = 1E9)
upper_bounding_depth::Int64
: Solve upper problem for every node with depth less than upper_bounding_depth
, and otherwise solve upper problems with a probability of (1/2)^(depth-upper_bounding_depth)
(default = 8)
domain_violation_guard_on::Bool
: (Unused) Protect against domain violation (default = false)
domain_violation_ϵ::Float64
: (Unused) Amount about a domain violation to ignore when propagating bounds (default = 1E-9)
user_solver_config::Bool
: If true, EAGO forgoes its default configuration process for subsolvers (default = false)
integer_abs_tol::Float64
: Absolute tolerance used to check for integrality of decision variables (default = 1E-9)
integer_rel_tol::Float64
: Relative tolerance used to check for integrality of decision variables (default = 1E-9)
force_global_solve::Bool
: Ignore EAGO's ability to parse problem types and force it to run global optimization (default = false)
unbounded_check::Bool
: Check that all branching variables have finite bounds and set them to +/- 1E10 if not (default = true)
EAGO.VariableInfo
— Typestruct VariableInfo{T<:AbstractFloat}
A structure used to store information related to the bounds assigned to each variable.
is_integer::Bool
: Is the variable integer valued?
has_lower_bound::Bool
: Boolean indicating whether a finite lower bound exists.
has_upper_bound::Bool
: Boolean indicating whether a finite upper bound exists.
is_fixed::Bool
: Boolean indicating if variable is fixed to a finite value.
has_constraints::Bool
: Boolean indicating that constraints have been set
lower_bound::AbstractFloat
: Lower bound. May be -Inf.
upper_bound::AbstractFloat
: Upper bound. May be Inf.
EAGO.ExtensionType
— Typeabstract type ExtensionType
An abstract type the subtypes of which are associated with functions method overloaded for new extensions. An instance of this is the DefaultExt <: ExtensionType
structure in the ext_type
field of the Optimizer
.
EAGO.InputProblem
— Typemutable struct InputProblem
A structure used to hold objectives and constraints added to the EAGO model. The constraints generally aren't used for relaxations.
All field information available in extended help.
Extended Help
_variable_count::Int64
: Count for the number of variables
_variable_names::Dict{MathOptInterface.VariableIndex, String}
: Dictionary containing variable indices and their names
_constraint_count::Int64
: Count for the number of constraints
_vi_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.LessThan{Float64}}}
_vi_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}}
_vi_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}}
_vi_it_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Interval{Float64}}}
_vi_zo_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.ZeroOne}}
_vi_int_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.Integer}, Tuple{MathOptInterface.VariableIndex, MathOptInterface.Integer}}
_linear_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_constraints::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Tuple{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_conic_second_order::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}, Tuple{MathOptInterface.VectorOfVariables, MathOptInterface.SecondOrderCone}}
_linear_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_linear_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_linear_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_quadratic_leq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, Float64}
_quadratic_geq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, Float64}
_quadratic_eq_primal::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, Float64}
_linear_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_linear_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_linear_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_quadratic_leq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}}
_quadratic_geq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.GreaterThan{Float64}}}
_quadratic_eq_prob_to_ip::Dict{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}, MathOptInterface.ConstraintIndex{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.EqualTo{Float64}}}
_objective::Union{Nothing, MathOptInterface.VariableIndex, MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.ScalarQuadraticFunction{Float64}}
: Storage for the objective function
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
: Storage for NLP constraints (set by MOI.set(m, ::NLPBlockData...)
in moi_wrapper.jl
)
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
EAGO.ParsedProblem
— Typemutable struct ParsedProblem
A structure used to store expressions and problem descriptions EAGO uses to formulate relaxed problems.
All field information available in extended help.
Extended Help
_problem_type::Union{Nothing, EAGO.DIFF_CVX, EAGO.LP, EAGO.MILP, EAGO.MINCVX, EAGO.MISOCP, EAGO.SOCP}
: Problem classification (set in parse_classify_problem!
)
_objective_saf::MathOptInterface.ScalarAffineFunction{Float64}
: Stores the objective and is used for constructing linear affine cuts
_objective::Union{Nothing, MathOptInterface.VariableIndex, EAGO.AffineFunctionIneq, EAGO.BufferedQuadraticIneq, EAGO.BufferedNonlinearFunction}
: Storage for the objective function
_optimization_sense::MathOptInterface.OptimizationSense
: Objective sense information (set by MOI.set(m, ::ObjectiveSense...)
)
_saf_leq::Vector{EAGO.AffineFunctionIneq}
_saf_eq::Vector{EAGO.AffineFunctionEq}
_sqf_leq::Vector{EAGO.BufferedQuadraticIneq}
_sqf_eq::Vector{EAGO.BufferedQuadraticEq}
_conic_second_order::Vector{EAGO.BufferedSOC}
_nlp_data::Union{Nothing, MathOptInterface.NLPBlockData}
_nonlinear_constr::Vector{EAGO.BufferedNonlinearFunction}
_relaxed_evaluator::Evaluator
_variable_info::Vector{VariableInfo{Float64}}
: Variable information (set in initial_parse!
)
_variable_count::Int64
: Count for the number of variables
EAGO.initial_parse!
— Methodinitial_parse!(m::Optimizer{R, S, T})
+
Translate the input problem to the working problem. Any checks or optional manipulation are left to the presolve stage.
Functionality has been included that allows for extensions to EAGO's Optimizer
to be readily defined. This can be done in two ways first defining a new structure which is a subtype of ExtensionType
and overloading methods associated with this new structure. An instance of this new structure is provided to the Optimizer
using the ext_type
keyword. This results in EAGO now dispatch to the new methods rather than the generally defined methods for the parent type. For a complete example, the reader is directed to the interval bounding example and the quasiconvex example. Alternatively, the user can overload the optimize_hook!
for this subtype which will entirely circumvent the default global solution routine. Additional information can be stored in the ext
field of the Optimizer
. In order to allow for compatibility between packages the user is encouraged to append their extension name to the start of each variable name (e.g. newext_newdata
).
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO makes use of a specialized tape structure for each function in order to compute valid composite bounds and relaxations. Each variable, constant, and expression is represented by a node in a directed graph structure.
EAGO.Node
— Typestruct Node <: EAGO.AbstractNode
Describes connectivity and expression represented by node.
EAGO.NodeClass
— TypeNodeType
Each node in the directed graph can be classified into the following types
EAGO.AtomType
— TypeAtomType
EAGO.AbstractDirectedGraph
— Typeabstract type AbstractDirectedGraph
Abstract supertype for generic directed graph structure.
EAGO.DirectedTree
— TypeDirectedTree
A tree graph with a single sink node.
Each field of the ith EAGO.Node
using a basic access function. For instance the ith node's ex_type
for graph d
may be accessed by ex_type(d, i)
. The sparsity
of node i
returns an ordered list of children
nodes which form the argument tuple for the operator performed at node i
. The sparsity
of node i
returns a list of parent
nodes which form the argument tuple for the operator performed at node i
. The parameter_values
and constant_values
functions are used to access the ith parameter values or ith constant values.
EAGO organizes information associated with each node in a given graph structure using an EAGO.AbstractCache
which stores the given information.
EAGO.AbstractCache
— Typeabstract type AbstractCache
Abstract supertype used for information storage object the directed acyclic graph.
EAGO.initialize!
— Methodinitialize!(_::AbstractCache, _::AbstractDirectedGraph)
-
Function used to initialize the storage cache d::AbstractCache
for a given type of directed acyclic graph g::AbstractDirectedGraph
.
Information in a given EAGO.AbstractCache
is populated by performing a series of forward and reverse passes of the graph structure which dispatch off of an EAGO.AbstractCacheAttribute
which indicates what particular information is desired.
EAGO.AbstractCacheAttribute
— Typeabstract type AbstractCacheAttribute
Abstract supertype used for attributes stored in a cache.
Three included AbstractCacheAttributes
are used to
EAGO.Relax
— TypeRelax
Used to dispatch relaxations to a standard
EAGO.RelaxAA
— TypeRelaxAA
EAGO.RelaxMulEnum
— TypeRelaxMulEnum
The forward and reverse routines are overloaded as follows:
EAGO.f_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a forward-pass of attribute t
.
EAGO.fprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
.
EAGO.fprop!
— MethodPopulates information associated with attribute t
for a subexpression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
EAGO.fprop!
— MethodPopulates information associated with attribute t
for a expression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
EAGO.fprop!
— MethodPopulates information associated with attribute t
for a parameter v
at index k
in cache c
associated with graph g
using information at index k
.
EAGO.fprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
.
EAGO.r_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a reverse-pass of attribute t
.
EAGO.rprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
EAGO.rprop!
— MethodPopulates information associated with attribute t
for a subexpressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
EAGO.rprop!
— MethodPopulates information associated with attribute t
for a expressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
EAGO.rprop!
— MethodPopulates information associated with attribute t
for a parameters v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
EAGO.rprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
Forward and reverse subroutines are overloaded for individual operators using through functions of the forms fprop!(t::AbstractCacheAttribute, v::Val{AtomType}, g::AbstractDirectedGraph, b::AbstractCache, k::Int)
and rprop!(t::AbstractCacheAttribute, v::Val{AtomType}, g::AbstractDirectedGraph, b::AbstractCache, k::Int)
.
EAGO.is_safe_cut!
— Methodis_safe_cut!(
+Nonlinear Backend · EAGO.jl Nonlinear Backend
Graphs, Caches, Forward and Reverse Propagation
EAGO makes use of a specialized tape structure for each function in order to compute valid composite bounds and relaxations. Each variable, constant, and expression is represented by a node in a directed graph structure.
EAGO.Node
— Typestruct Node <: EAGO.AbstractNode
Describes connectivity and expression represented by node.
sourceEAGO.NodeClass
— TypeNodeType
Each node in the directed graph can be classified into the following types
- VARIABLE: Denotes a decision variable.
- PARAMETER: An adjustable parameter value (not a decision variable).
- CONSTANT: A constant value
- EXPRESSION: Any other expression that isn't a subexpression
- SUBEXPRESSION: Any expression referencing a different graph representation.
sourceEAGO.AtomType
— TypeAtomType
sourceEAGO.AbstractDirectedGraph
— Typeabstract type AbstractDirectedGraph
Abstract supertype for generic directed graph structure.
sourceEAGO.DirectedTree
— TypeDirectedTree
A tree graph with a single sink node.
sourceEach field of the ith EAGO.Node
using a basic access function. For instance the ith node's ex_type
for graph d
may be accessed by ex_type(d, i)
. The sparsity
of node i
returns an ordered list of children
nodes which form the argument tuple for the operator performed at node i
. The sparsity
of node i
returns a list of parent
nodes which form the argument tuple for the operator performed at node i
. The parameter_values
and constant_values
functions are used to access the ith parameter values or ith constant values.
EAGO organizes information associated with each node in a given graph structure using an EAGO.AbstractCache
which stores the given information.
EAGO.AbstractCache
— Typeabstract type AbstractCache
Abstract supertype used for information storage object the directed acyclic graph.
sourceEAGO.initialize!
— Methodinitialize!(_::AbstractCache, _::AbstractDirectedGraph)
+
Function used to initialize the storage cache d::AbstractCache
for a given type of directed acyclic graph g::AbstractDirectedGraph
.
sourceInformation in a given EAGO.AbstractCache
is populated by performing a series of forward and reverse passes of the graph structure which dispatch off of an EAGO.AbstractCacheAttribute
which indicates what particular information is desired.
EAGO.AbstractCacheAttribute
— Typeabstract type AbstractCacheAttribute
Abstract supertype used for attributes stored in a cache.
sourceThree included AbstractCacheAttributes
are used to
EAGO.Relax
— TypeRelax
Used to dispatch relaxations to a standard
sourceEAGO.RelaxAA
— TypeRelaxAA
sourceEAGO.RelaxMulEnum
— TypeRelaxMulEnum
sourceThe forward and reverse routines are overloaded as follows:
EAGO.f_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a forward-pass of attribute t
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a subexpression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a expression v
at index k
in cache c
associated with graph g
using information taken from the children of k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a parameter v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.fprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
.
sourceEAGO.r_init!
— MethodInitializes information in cache c
for each node in g
that may be used in a reverse-pass of attribute t
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a variable v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a subexpressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a expressions v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a parameters v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceEAGO.rprop!
— MethodPopulates information associated with attribute t
for a constant v
at index k
in cache c
associated with graph g
using information at index k
taken from the parents of k
.
sourceForward and reverse subroutines are overloaded for individual operators using through functions of the forms fprop!(t::AbstractCacheAttribute, v::Val{AtomType}, g::AbstractDirectedGraph, b::AbstractCache, k::Int)
and rprop!(t::AbstractCacheAttribute, v::Val{AtomType}, g::AbstractDirectedGraph, b::AbstractCache, k::Int)
.
Other Routines
EAGO.is_safe_cut!
— Methodis_safe_cut!(
m::GlobalOptimizer,
f::MathOptInterface.ScalarAffineFunction{Float64}
) -> Bool
-
Applies the safe cut checks detailed in Khajavirad, 2018 [Khajavirad, Aida, and Nikolaos V. Sahinidis. "A hybrid LP/NLP paradigm for global optimization relaxations." Mathematical Programming Computation 10.3 (2018): 383-421] to ensure that only numerically safe affine relaxations are added. Checks that:
|b| <= safe b
, safe_l <= abs(ai) <= safe u
, and safe_l <= abs(ai/aj) <= safe_u
.
sourceSettings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
+
Applies the safe cut checks detailed in Khajavirad, 2018 [Khajavirad, Aida, and Nikolaos V. Sahinidis. "A hybrid LP/NLP paradigm for global optimization relaxations." Mathematical Programming Computation 10.3 (2018): 383-421] to ensure that only numerically safe affine relaxations are added. Checks that:
|b| <= safe b
, safe_l <= abs(ai) <= safe u
, and safe_l <= abs(ai/aj) <= safe_u
.Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO has included basic functionality to manipulate user-defined functions (UDFs). EAGO also has utilities for directed acyclic graphs (DAGs). These features are largely experimental and we're interested in providing additional features for novel use cases.
EAGO.Script.dag_flattening!
— Functiondag_flattening!
Flattens (usually) the dag by making all registered substitutions for every nonlinear term in the Optimizer.
EAGO.Script.flatten_expression!
— Functionflatten_expression!
Flattens (usually) the dag by making all registered substitutions for the expression expr::MOINL.Expression
. Performs a depth-first search through the expression adding the terminal node to the stack, then checking to determine if it matches a registered substitution pattern. If it doesn't not then node is added to the new expression graph representation and it's children are added to the queue. If an expression (node) is identified as a pattern then it is substituted and any children expression nodes are then checked for patterns until the depth first search is exhausted.
EAGO.Script.register_substitution!
— Functionregister_substitution!
Specifies that the src::Template_Graph
should be subsituted out for the trg::Template_Graph
.
Conventions for substition, the expression to be checked always appears at key 1 in the Template_Graph and operations are ordered from low value to high value left to right so if 1 is a -, and 4 => 1, 3 => 1 then the expression is 4 - 3
EAGO.Script.Template_Graph
— TypeTemplate_Graph
Holds a list of Template_Nodes, set of directed edges, lengths, an adjacency matrix and the number of children.
EAGO.Script.Template_Node
— TypeTemplate_Node
A structure which holds a symbol indicating whether the node is an operator, a number, or an expression type
, a value which identifies the function or symbol value
, potentially a numeric value num_value
, and a check that can be run to verify the node is correct check
.
Missing docstring for scrub
. Check Documenter's build log for details.
Missing docstring for scrub!
. Check Documenter's build log for details.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
EAGO has included basic functionality to manipulate user-defined functions (UDFs). EAGO also has utilities for directed acyclic graphs (DAGs). These features are largely experimental and we're interested in providing additional features for novel use cases.
EAGO.Script.dag_flattening!
— Functiondag_flattening!
Flattens (usually) the dag by making all registered substitutions for every nonlinear term in the Optimizer.
EAGO.Script.flatten_expression!
— Functionflatten_expression!
Flattens (usually) the dag by making all registered substitutions for the expression expr::MOINL.Expression
. Performs a depth-first search through the expression adding the terminal node to the stack, then checking to determine if it matches a registered substitution pattern. If it doesn't not then node is added to the new expression graph representation and it's children are added to the queue. If an expression (node) is identified as a pattern then it is substituted and any children expression nodes are then checked for patterns until the depth first search is exhausted.
EAGO.Script.register_substitution!
— Functionregister_substitution!
Specifies that the src::Template_Graph
should be subsituted out for the trg::Template_Graph
.
Conventions for substition, the expression to be checked always appears at key 1 in the Template_Graph and operations are ordered from low value to high value left to right so if 1 is a -, and 4 => 1, 3 => 1 then the expression is 4 - 3
EAGO.Script.Template_Graph
— TypeTemplate_Graph
Holds a list of Template_Nodes, set of directed edges, lengths, an adjacency matrix and the number of children.
EAGO.Script.Template_Node
— TypeTemplate_Node
A structure which holds a symbol indicating whether the node is an operator, a number, or an expression type
, a value which identifies the function or symbol value
, potentially a numeric value num_value
, and a check that can be run to verify the node is correct check
.
Missing docstring for scrub
. Check Documenter's build log for details.
Missing docstring for scrub!
. Check Documenter's build log for details.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
EAGO is a global optimizer primarily meant to be used with the JuMP algebraic modeling language. Typical use will involve installing EAGO and JuMP, creating a problem using JuMP syntax, and passing the problem to the Optimizer
.
EAGO is designed to be easily extensible. Some of the examples that follow include use cases where the standard EAGO functionality is overloaded and readily incorporated into the main optimization routine. Information on how to extend the main branch-and-bound functions (including lower and upper-bounding routines) can be found in the Customization Guidelines section.
The following pages in this section include several representative examples of how EAGO can be used. Additional (and in some cases, shortened) examples can be found in the EAGO-notebooks repository. Examples and instructional pages in this section include:
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
EAGO is a global optimizer primarily meant to be used with the JuMP algebraic modeling language. Typical use will involve installing EAGO and JuMP, creating a problem using JuMP syntax, and passing the problem to the Optimizer
.
EAGO is designed to be easily extensible. Some of the examples that follow include use cases where the standard EAGO functionality is overloaded and readily incorporated into the main optimization routine. Information on how to extend the main branch-and-bound functions (including lower and upper-bounding routines) can be found in the Customization Guidelines section.
The following pages in this section include several representative examples of how EAGO can be used. Additional (and in some cases, shortened) examples can be found in the EAGO-notebooks repository. Examples and instructional pages in this section include:
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.
This example is also provided here as a Jupyter Notebook.
Semi-infinite programming remains an active area of research. In general, the solutions of semi-infinite programs (SIPs) with nonconvex semi-infinite constraints of the following form are extremely challenging:
\[\begin{aligned} +
This example is also provided here as a Jupyter Notebook.
Semi-infinite programming remains an active area of research. In general, the solutions of semi-infinite programs (SIPs) with nonconvex semi-infinite constraints of the following form are extremely challenging:
\[\begin{aligned} f^{*} = & \min_{\mathbf x \in X} f(\mathbf x) \\ {\rm s.t.} \; \; & g(\mathbf x, \mathbf p) \leq 0, \; \; \; \; \forall \mathbf p \in P \\ & \mathbf x \in X = \{ \mathbf x \in \mathbb R^{n_{x}} : \mathbf x^{L} \leq \mathbf x \leq \mathbf x^{U} \} \\ @@ -20,4 +20,4 @@ p_l = Float64[0.0] p_u = Float64[1.0] -sip_result = sip_solve(SIPRes(), x_l, x_u, p_l, p_u, f, Any[gSIP], res_sip_absolute_tolerance = 1E-3);
EAGO.SIPProblem
— Type SIPProblem
Structure storing problem information for the solution routine.
EAGO.SIPResult
— TypeSIPResult
Structure storing the results of the SIPRes
algorithm.
EAGO.SIPRes
— TypeSIPRes
Specifies that the SIPRes algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResRev
— TypeSIPResRev
Specifies that the SIPResRev algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPHybrid
— TypeSIPHybrid
Specifies that the SIPHybrid algorithm which implements Algorithm #2 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.get_sip_optimizer
— Functionget_sip_optimizer
Specifices the optimizer to be used in extension t::EAGO.ExtensionType
with algorithm alg::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command get_sip_optimizer(t::ExtensionType, alg::AbstractSIPAlgo, s::AbstractSubproblemType)
.
EAGO.build_model
— Functionbuild_model
Create the model and variables used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command build_model(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, p::SIPProblem)
.
EAGO.sip_llp!
— Functionsip_llp!
Solves the lower level problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_llp!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
EAGO.sip_bnd!
— Functionsip_bnd!
Solves the bounding problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_bnd!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
EAGO.sip_res!
— Functionsip_res!
Solves the restriction problem for extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_res!(t::ExtensionType, a::AbstractSIPAlgo, ...)
.
EAGO.sip_solve
— Functionsip_solve
Solve an SIP with decision variable bounds x_l
to x_u
, uncertain variable bounds p_l
to p_u
, an objective function of f
, and gSIP
seminfiniite constraint(s).
Settings
This document was generated with Documenter.jl version 1.3.0 on Friday 8 March 2024. Using Julia version 1.10.2.
EAGO.SIPProblem
— Type SIPProblem
Structure storing problem information for the solution routine.
EAGO.SIPResult
— TypeSIPResult
Structure storing the results of the SIPRes
algorithm.
EAGO.SIPRes
— TypeSIPRes
Specifies that the SIPRes algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPResRev
— TypeSIPResRev
Specifies that the SIPResRev algorithm which implements Algorithm #1 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.SIPHybrid
— TypeSIPHybrid
Specifies that the SIPHybrid algorithm which implements Algorithm #2 of Djelassi, Hatim, and Alexander Mitsos. "A hybrid discretization algorithm with guaranteed feasibility for the global solution of semi-infinite programs." Journal of Global Optimization 68.2 (2017): 227-253 should be used.
EAGO.get_sip_optimizer
— Functionget_sip_optimizer
Specifices the optimizer to be used in extension t::EAGO.ExtensionType
with algorithm alg::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command get_sip_optimizer(t::ExtensionType, alg::AbstractSIPAlgo, s::AbstractSubproblemType)
.
EAGO.build_model
— Functionbuild_model
Create the model and variables used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command build_model(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, p::SIPProblem)
.
EAGO.sip_llp!
— Functionsip_llp!
Solves the lower level problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_llp!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
EAGO.sip_bnd!
— Functionsip_bnd!
Solves the bounding problem for the ith-SIP used with extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_bnd!(t::ExtensionType, a::AbstractSIPAlgo, s::AbstractSubproblemType, ..., i, tol)
.
EAGO.sip_res!
— Functionsip_res!
Solves the restriction problem for extension t::EAGO.ExtensionType
in algorithm a::AbstractSIPAlgo
in subproblem s::AbstractSubproblemType
via the command sip_res!(t::ExtensionType, a::AbstractSIPAlgo, ...)
.
EAGO.sip_solve
— Functionsip_solve
Solve an SIP with decision variable bounds x_l
to x_u
, uncertain variable bounds p_l
to p_u
, an objective function of f
, and gSIP
seminfiniite constraint(s).
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.9.4.