- #1
sodemus
- 29
- 0
Hi,
I have a fairly simple problem which but I'm not sure if it should rather be in a computer science forum for algorithms or something.
Given n vectors, how do you choose the sign of each vector as to maximize the modulus of the sum of the vectors?
Sure you could go through all 2^n combinations, but that's not necessarily the most efficient way (really, you only need to go through 2^(n-1) since the second half is just negative the first half, but still). I can't figure out what all the dependencies are.
I have a fairly simple problem which but I'm not sure if it should rather be in a computer science forum for algorithms or something.
Given n vectors, how do you choose the sign of each vector as to maximize the modulus of the sum of the vectors?
Sure you could go through all 2^n combinations, but that's not necessarily the most efficient way (really, you only need to go through 2^(n-1) since the second half is just negative the first half, but still). I can't figure out what all the dependencies are.
Last edited: