algorithm - Minimising distance: distance formula -


I am writing a program in C. I have to find a solution by reducing expression

  D1 + D2 + ...... + DN  

where DI's distance between 2 points Distance is done by the formula. Expression of the above X & amp; Is in; Y variable

Now I will differentiate this expression and find the solution. My suspicion is:

Because in the above expression, all the days of the class will be found in the form of the roots which can be difficult to solve. So instead we can solve this expression:

  D1 ^ 2 + D2 ^ 2 + ...... + Dn ^ 2  
< P> What will be the answer created by the above mentioned expression, because it can be produced by solving the original origin?

I have checked for simple test cases like n = 2, it generates correct answers, is it true in general?

If not, how can this problem be solved?

For 2d distance, it is not normally that the minimum one ^ 2 + b ^ 2 is in the same position where the minimum A + b . Certainly this could be true for some very specific limited problems, of course. If you are trying to detect a counterimpression, then note that the crossroads eliminate the long distance; If you prepare an example with at least one long distance minimum, then you have a good chance that the sum of squares is a different minimum.

What is the problem you are trying to solve? It is quite possible that your problem definitely does not matter; Or that the sum of squares is a cheapest problem and is an easy first approximation for the final solution.

This can be obvious, but if different distance is unrelated , then for each individual distance the class is less when the distance is there and thus the sum of the unrelated distance is minimal, Where is the sum of squares.

Edit Post Update: Again, trying to find a nucleus with the range that is on a particular line. Then in the general framework: You have only one freedom, and you can make plain discrimination. However, there will be different degrees with different sqrt in the result; To solve is not possible in algebraic form (AFAIK) in general case. I am not 100% positive, but I think that you are in luck that there is no local minimum except your global level of distance; In that case Newton's method will be reliable and fast.

Therefore, if you can verify the perception that there is only one local minimum, then you are free, and even if you can, then you have very strong results very strong And when it when goes wrong, by comparing the minimum calculation of its Newton-method with some reality check points (such as on the orthogonal projection line of each point).


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -