Combination of various items

1

I have a set of items and each item has the following elements:

E = (índice, espessura, largura, demanda)
i = índice; e = espessura; l = largura; d = demanda;

I have two more variables:

int min, max;

Let's call the possible combinations of C , which C is the set of i of E , such that soma(l(C)) is less than max and greater than min . i can repeat in the set.

For example, I have the following items:

E = {{1, 2, 50, 100}, {2, 2, 30, 100}, {3, 2, 40, 100};
min = 100; max = 200;

Then

C = {
    {1,1}, // Sum(l(C)) = 100
    {1,1,1}, // Sum(l(C)) = 150
    {1,1,2,3}, // Sum(l(C)) = 170
    {1,1,3,1}, // Sum(l(C)) = 190
    // e mais algumas várias outras possibilidades
}

However, C is not a set of ordered pairs, then {1,2} = {2,1} .

How do I calculate all these possibilities without similar repetitions like this?

    
asked by anonymous 01.06.2017 / 22:57

0 answers