I have a distance (similarity) matrix D, for example,
D <- matrix(c(0.00, 1.00, 1.00, 0.10, 0.05, 1.00, 0.00, 1.00, 1.00, 1.00, 1.00, 1.00, 0.00, 0.90, 0.95, 0.10, 1.00, 0.90, 0.00, 0.15, 0.05, 1.00, 0.95, 0.15, 0.00),5,5)
and a vector of weights w = (w1, ..., wn) such that sum(w) == 1. The values in the vector w are real and between 0 and 1, inclusively. I need to find a vector w such that the sum w*D*t(w) is maximized. Where t(w) is the transpose of w and the symbol "*" denotes matrix multiplication.
Amazingly enough, I can't find a solver that can do this in R.
Thank you