Q:

Numerical optimization and minimization

Lets say I have a reference node R and several test nodes T1, T2.... Tn.
Any particular node has a set of properties Rp1, Rp2, ... Rpn and T1p1, T1p2, T1p3, ... T1pn, and T2p1, T2p2, T2p3, ... T2pn, and so on. So, any node can have n properties, each of a particular type.
I have my own method of defining the distance between any two properties of the same kind between any two nodes. Furthermore, I would weigh the distances between properties and then sum them up. Thus, the distance between R and T1 would be:

dRT1 = w1*dRT1p1 + w2*dRT1p2 + w3*dRT1p3 + w4*dRT1p4 + ... wn*dRT1pn.

Now, given the reference node R, and the test nodes T1, T2 .... Tn, and given that I know the distance is the least between R and a particular node Tm (1<m<n), and if the weights are actually variables and the distances are actually constants, how do I calculate the weights such that dRTm is the minimal among all the distances between R and every other test nodes.
We have the distances dRT1, dRT2, dRT3, dRT4, ... dRTn and we know that dRTm is minimum. What algorithm should we use to determine the weights?

A:

This looks like http://en.wikipedia.org/wiki/Linear_regression, where after the article says "Thus the model takes the form" y is dRt1, the x variables are e.g. dRT1p1, and the beta variables they are trying to work out - their parameter vector - is your w1, w2...

