SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.constrained.general.penaltymethod
Class PenaltyMethod

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.constrained.general.penaltymethod.PenaltyMethod
All Implemented Interfaces:
ConstrainedMinimizer, Minimizer

public class PenaltyMethod
extends java.lang.Object
implements ConstrainedMinimizer

The penalty method is an algorithm for solving the constrained minimization problem for 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 nonzero when the constraints are violated and is zero in the region where constraints are not 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 solver outside the feasible region. This is to mimic when γ approaches infinity. The classical unconstrained minimization is then applied to the modified problem. It can be shown that if the penalty is large enough, the original and modified problem have the same solver.

See Also:

Nested Class Summary
static interface PenaltyMethod.PenaltyFunctionFactory
          This defines a penalty function when a constrain is violated.
 
Field Summary
static PenaltyMethod.PenaltyFunctionFactory DEFAULT_PENALTY_FUNCTION_FACTORY
          the default penalty function factory
 double gamma
          γ as in R.
 PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory
          a way to construct a penalty function from a constrained optimization problem
 UnconstrainedMinimizer solver
          the unconstrained solver class
 
Constructor Summary
PenaltyMethod()
          Construct a PenaltyMethod solver for a constrained minimization problem using defaults.
PenaltyMethod(double gamma)
          Construct a PenaltyMethod solver for a constrained minimization problem using defaults.
PenaltyMethod(PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory, double gamma, UnconstrainedMinimizer solver)
          Construct a PenaltyMethod solver for a constrained minimization problem.
 
Method Summary
 double minimum()
          Get the minimum found.
 Vector search(int maxIterations, Vector... initials)
          Search for a minimizer that minimizes the objective function from the given starting points.
 void solve(ConstrainedProblem problem, double tol)
           
 
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 PenaltyMethod.PenaltyFunctionFactory DEFAULT_PENALTY_FUNCTION_FACTORY
the default penalty function factory


penaltyFunctionFactory

public final PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory
a way to construct a penalty function from a constrained optimization problem


gamma

public final double gamma
γ as in R. Fletcher


solver

public final UnconstrainedMinimizer solver
the unconstrained solver class

Constructor Detail

PenaltyMethod

public PenaltyMethod(PenaltyMethod.PenaltyFunctionFactory penaltyFunctionFactory,
                     double gamma,
                     UnconstrainedMinimizer solver)
Construct a PenaltyMethod solver for a constrained minimization problem.

Parameters:
penaltyFunctionFactory - the penalty function factory
gamma - γ as in R. Fletcher
solver - the unconstrained solver class

PenaltyMethod

public PenaltyMethod(double gamma)
Construct a PenaltyMethod solver for a constrained minimization problem using defaults.

The user may want to experiment different γ's to get better results. It should be big enough to reflect the penalty, but it cannot be too big to overflow the computations (to produce NaNs).

Parameters:
gamma - γ as in R. Fletcher

PenaltyMethod

public PenaltyMethod()
Construct a PenaltyMethod solver for a constrained minimization problem using defaults.

Method Detail

solve

public void solve(ConstrainedProblem problem,
                  double tol)
Specified by:
solve in interface ConstrainedMinimizer

search

public Vector search(int maxIterations,
                     Vector... initials)
Description copied from interface: Minimizer
Search for a minimizer that minimizes the objective function from the given starting points.

Specified by:
search in interface Minimizer
Parameters:
maxIterations - the maximum number of iterations
initials - the initial guesses; they could include information such as boundaries
Returns:
an (approximate) minimizer

minimum

public double minimum()
Description copied from interface: Minimizer
Get the minimum found.

This is especially useful for an objective function that takes a long time to compute.

Specified by:
minimum in interface Minimizer
Returns:
the minimum found

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.