Suppose I had $N$ rocks with known weights $w_n$. How could I set all rocks on either side of a weight balance to reach an optimal level of balance? Put formally, is there a way I can either solve or approximately solve the following integer program without using an exhaustive search?
\begin{align} \min_x \left| \sum_n w_n x_n\right| \\ x_n \in \{-1, +1\} \end{align}
This is a version of the subset sum problem which is well known to be NP-Hard. Branch and bound methods will work well for small instances, but if the number of $w_{n}$ is large this problem rapidly becomes practically intractable.