# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.multivariate.constrained.general.penaltymethod

## Class PenaltyMethodMinimizer

• java.lang.Object
• com.numericalmethod.suanshu.optimization.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 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 and 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 and Description
static PenaltyMethodMinimizer.PenaltyFunctionFactory DEFAULT_PENALTY_FUNCTION_FACTORY
the default penalty function factory
• ### Constructor Summary

Constructors
Constructor and 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
Modifier and Type Method and Description
IterativeSolution<Vector> solve(ConstrainedOptimProblem problem)
Solve an optimization problem, e.g., OptimProblem.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### 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 problem
gamma - the ɣ as in R. Fletcher
minimizer - 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 interface Optimizer<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