Teitz-Bart algorithm applied to a 'raw' distance matrix

Share:

Description

Teitz-Bart algorithm applied to a 'raw' distance matrix

Usage

1
tb.raw(d, guess, verbose = FALSE)

Arguments

d

- A distance matrix (not necessarily Euclidean)

guess

- a guess at the set of p points constituting the p-median

verbose

- if TRUE print out each swap in the algorithm (default is FALSE)

Value

Set of point indices for p-median (may be local optimum)

Examples

1
2
3
4
x1 <- rnorm(100)
y1 <- rnorm(100)
d <- as.matrix(dist(cbind(x1,y1)))
tb.raw(d,c(1,2))