Learn R Programming

missalpha (version 0.2.0)

qp_solver_GA: Solve Quadratic Programming Problem using GA

Description

This function solves a quadratic programming problem using the Genetic Algorithm (GA) from the GA package.

Usage

qp_solver_GA(
  n,
  A,
  b,
  c,
  x_max = 1,
  print_message = FALSE,
  maxiter = 1000,
  popSize = 50,
  pmutation = 0.2,
  elitism = 5,
  monitor = FALSE,
  seed = 123,
  ...
)

Value

A list containing:

f_cd

The optimal objective function value.

x_value

The optimal values of the decision variables.

Arguments

n

An integer representing the number of decision variables.

A

A matrix representing the quadratic coefficients.

b

A numeric vector representing the linear coefficients.

c

A numeric scalar representing the constant term in the objective function.

x_max

An integer representing the upper bound for the decision variables. Default is 1.

print_message

A logical value indicating whether to print optimization details. Default is FALSE.

maxiter

An integer specifying the maximum number of iterations. Default is 1000.

popSize

An integer specifying the population size for the GA. Default is 50.

pmutation

A numeric value for mutation probability. Default is 0.2.

elitism

An integer specifying the number of elite individuals to carry over to the next generation. Default is 5.

monitor

A logical value indicating whether to display progress. Default is FALSE.

seed

A numeric value used for the random number generator. Default is 123.

...

Additional control parameters for ga.

See Also

qp_solver, qp_solver_DEoptim, qp_solver_nloptr