Class PenaltyMethodMinimizer
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.general.penaltymethod.PenaltyMethodMinimizer
-
- All Implemented Interfaces:
Minimizer<ConstrainedOptimProblem,IterativeSolution<Vector>>
,ConstrainedMinimizer<ConstrainedOptimProblem,IterativeSolution<Vector>>
,Optimizer<ConstrainedOptimProblem,IterativeSolution<Vector>>
public class PenaltyMethodMinimizer extends Object implements ConstrainedMinimizer<ConstrainedOptimProblem,IterativeSolution<Vector>>
The penalty method is an algorithm for solving a constrained minimization problem with general constraints. It replaces a constrained optimization problem by a series of unconstrained problems whose solutions ideally converge to the solution of the original constrained problem. The unconstrained problems are formed by adding a term to the objective function that consists of a penalty parameter and a measure of violation of the constraints. The measure of violation is zero in the feasible region and is positive when the constraints are violated. In this implementation, we use only one iteration. In this iteration, we multiply the penalties by ɣ, which is a very big number, to penalize a solution outside the feasible region. This is to mimic when ɣ approaches infinity. A classical unconstrained minimization algorithm is then applied to the modified problem. It can be shown that if the penalty is large enough, the original and modified problems have the same solution.- See Also:
- @see Wikipedia: Penalty method
- "R. Fletcher, "Section 22.4, Penalty Methods, Chapter 22, Non-differentiable Optimization," Practical Methods of Optimization. 2nd ed. Wiley. May 2000."
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PenaltyMethodMinimizer.PenaltyFunctionFactory
For each constrained optimization problem, the solver creates a new penalty function for it.
-
Field Summary
Fields Modifier and Type Field Description static PenaltyMethodMinimizer.PenaltyFunctionFactory
DEFAULT_PENALTY_FUNCTION_FACTORY
the default penalty function factory
-
Constructor Summary
Constructors Constructor Description PenaltyMethodMinimizer()
Construct a constrained minimizer using the penalty method.PenaltyMethodMinimizer(double gamma)
Construct a constrained minimizer using the penalty method.PenaltyMethodMinimizer(PenaltyMethodMinimizer.PenaltyFunctionFactory penaltyFunctionFactory, double gamma, IterativeC2Minimizer minimizer)
Construct a constrained minimizer using the penalty method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IterativeSolution<Vector>
solve(ConstrainedOptimProblem problem)
Solve an optimization problem, e.g.,OptimProblem
.
-
-
-
Field Detail
-
DEFAULT_PENALTY_FUNCTION_FACTORY
public static final PenaltyMethodMinimizer.PenaltyFunctionFactory DEFAULT_PENALTY_FUNCTION_FACTORY
the default penalty function factory
-
-
Constructor Detail
-
PenaltyMethodMinimizer
public PenaltyMethodMinimizer(PenaltyMethodMinimizer.PenaltyFunctionFactory penaltyFunctionFactory, double gamma, IterativeC2Minimizer minimizer)
Construct a constrained minimizer using the penalty method.- Parameters:
penaltyFunctionFactory
- a factory to construct a penalty function from a constrained optimization problemgamma
- the ɣ as in R. Fletcherminimizer
- an unconstrained minimization solver
-
PenaltyMethodMinimizer
public PenaltyMethodMinimizer(double gamma)
Construct a constrained minimizer using the penalty method. ɣ should be big enough to reflect the penalty, but it cannot be too big to overflow the computations (to produce NaNs). It is recommended to experiment different ɣ's to get better results.- Parameters:
gamma
- the ɣ as in R. Fletcher
-
PenaltyMethodMinimizer
public PenaltyMethodMinimizer()
Construct a constrained minimizer using the penalty method.
-
-
Method Detail
-
solve
public IterativeSolution<Vector> solve(ConstrainedOptimProblem problem) throws Exception
Description copied from interface:Optimizer
Solve an optimization problem, e.g.,OptimProblem
.- Specified by:
solve
in interfaceOptimizer<ConstrainedOptimProblem,IterativeSolution<Vector>>
- Parameters:
problem
- an optimization problem- Returns:
- a solution to the optimization problem
- Throws:
Exception
- when there is an error solving the problem
-
-