How to divide a set into two subsets such that difference between the sum of numbers in two sets is minimal?

前端 未结 18 697
攒了一身酷
攒了一身酷 2020-11-27 10:55

Given a set of numbers, divide the numbers into two subsets such that difference between the sum of numbers in two subsets is minimal.

T

18条回答
  •  遥遥无期
    2020-11-27 11:29

    A possible solution here- https://stackoverflow.com/a/31228461/4955513 This Java program seems to solve this problem, provided one condition is fulfilled- that there is one and only one solution to the problem.

提交回复
热议问题