Filling bins with an equal size

后端 未结 3 1522
予麋鹿
予麋鹿 2021-01-25 18:48

I have 100 groups and each group has some elements inside. For the cross validation, I want to make five bins which their size is as equal as possible.

Is there any algo

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-25 19:04

    This seems related to the set partitioning problem, which is NP-hard but fortunately admits lots of good approximation algorithms and pseudopolynomial-time dynamic programming algorithms. You may want to look into those as a starting point, since there's already quite a lot of work that's been done in this area.

    Hope this helps!

提交回复
热议问题