Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distanceMatrixUpdate

Update distance matrix


Description

Update an existing distance matrix D_mat by adding distances of all previous candidate solutions to one new candidate solution, d_vec= d(x_i,x_new).

Usage

distanceMatrixUpdate(distanceMat, x, distanceFunction, ...)

Arguments

distanceMat

original distance matrix D_mat

x

list of candidate solutions, last in list is the new solution

distanceFunction

Distance function of type f(x,y)=r, where r is a scalar and x and y are candidate solutions whose distance is evaluated.

...

further arguments passed to distanceFunction

Value

matrix of distances between all solutions x

Examples

x <- list(5:1,c(2,4,5,1,3),c(5,4,3,1,2))
dm <- distanceMatrix(x,distancePermutationHamming)
x <- append(x,list(1:5))
dmUp <- distanceMatrixUpdate(dm,x,distancePermutationHamming)

CEGO

Combinatorial Efficient Global Optimization

v2.4.0
GPL (>= 3)
Authors
Martin Zaefferer <mzaefferer@gmail.com>
Initial release
2019-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.