distsummin: Returns the solution of the minimization problem

distsumminR Documentation

Returns the solution of the minimization problem

Description

Solve the min-sum location problem for a given loca.p class object.

Usage

distsummin(
  o,
  x = 0,
  y = 0,
  lp = numeric(0),
  max.iter = 1e+05,
  eps = 0.001,
  verbose = FALSE,
  algorithm = "Weiszfeld",
  ...
)

Arguments

o

An object of loca.p class.

x

The x coordinate of the starting point. It's default value is 0.

y

The y coordinate of the starting point. It's default value is 0.

lp

If given, the l_p norm will be used instead of the Euclidean norm.

max.iter

Maximum number of iterations allowed. It's default value is 100000.

eps

The module of the gradient in the stop rule. It's default value is 1e-3.

verbose

If TRUE the function produces detailed output. It's default value is FALSE.

algorithm

The method to be use. For this version of the package, the valid values are: "gradient" for a gradient based method, "search" for local search method (this option is deprecated), "ucminf" for optimization with ucminf from ucminf package, and "Weiszfeld" for the Weiszfeld method or any of the valid method for optim function, now "Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN". "Weiszfeld" is the default value.

...

Other options for optimization algorithms.

Details

The algorithms Weiszfeld and gradient include and optimality test for demand points. The Weiszfeld version of the algorithm also implements slow convergence test and accelerator procedure.

If p < 1 thus l_p is not a norm, so, only p \ge 1 are valid values.

Since l_2 norm is the Euclidean norm, when p=2 distsumlpmin are equal to distsummin. But the computations involved are greater for the first form.

max.iter for SANN algorithm is the number of evaluation of objective function, so this methos usually requires large values of max.iter to reach optimal value

The function zsummin is deprecated and will be removed from new versions of the package.

Value

distsummin returns an array with the coordinates of the solution point.

See Also

See also orloca-package, loca.p and distsum.

Examples

# A new unweighted loca.p object
loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))
# Compute the minimum
sol<-distsummin(loca)

# Show the result
sol

# Evaluation of the objective function at solution point
distsum(loca, sol[1], sol[2])


orloca documentation built on May 31, 2023, 8:59 p.m.