Forming groups as nearly equal in sums as possible

  • MHB
  • Thread starter treesloth
  • Start date
  • Tags
    Groups Sums
In summary, the conversation discusses a problem of creating groups with equal sums using a list of numbers, and asks if there is a way to ensure the groups are as close as possible. The conversation also mentions using the R subsetsum function in the adagio library to address this problem.
  • #1
treesloth
2
0
Hello. I'm not sure what type of problem this is that I'm trying to solve. Any pointers would be greatly appreciated.

Suppose you have a list of numbers and you want to form them into, say, 4 groups such that the sum of each group is, as nearly as possible, equal to the sums of each of the other groups; basically, making groups with equal sums without regard to the number of elements in each. Is there a way to do that with certainty that the groups are as close as possible given the elements available? If not, is there a way to iteratively approach an optimal grouping? I'm just using a made-up dataset in R generated via:

Code:
x <- as.integer(runif(100, 250, 500))

Thanks in advance.
 
Physics news on Phys.org
  • #2
After some more research, this is a subset sum problem, or, in some cases, partitioning. It can be addressed using iterations of the R subsetsum function in the adagio library.
 

FAQ: Forming groups as nearly equal in sums as possible

How do you determine the sums of each group?

The sums of each group are determined by adding up the values of the individuals within the group. This can be done manually by counting or using a calculator, or it can be automated through a computer program.

What is the purpose of forming groups with equal sums?

The purpose of forming groups with equal sums is to ensure fairness and balance among the individuals in the group. This can be particularly important in situations where resources or opportunities are being divided among the groups.

What factors are considered when forming groups as nearly equal in sums as possible?

The main factor considered is the individual values or characteristics of each person. This could include factors such as age, gender, skill level, or any other relevant criteria that may impact the grouping.

How do you handle situations where there are not enough individuals to form groups with equal sums?

In cases where there are not enough individuals to form groups with equal sums, adjustments may need to be made. This could include altering the criteria for grouping or allowing for some variation in the sums of the groups.

Is forming groups as nearly equal in sums as possible a fair way to divide resources?

Forming groups as nearly equal in sums as possible does not guarantee complete fairness, as there may still be variations among the individuals within each group. However, it can be considered a fairer method compared to other options, as it strives to achieve a level playing field for all individuals.

Back
Top