# distsummin: Returns the solution of the minimization problem In orloca: Operations Research LOCational Analysis Models

## Description

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

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```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 ≥ 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 `orloca-package`, `loca.p` and `distsum`.
 ``` 1 2 3 4 5 6 7 8 9 10``` ```# 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, sol) ```