I have looked at several other questions on permutations and this variant does not seem to appear. I am looking for a simple way to generate a biased permutation. Here's what I mean.

Suppose I have two lists (though I need to solve for *N* lists):

```
l1 = [a, b, c]
l2 = [d, e, f]

```

Permutations of these lists would look like [(a,d), (a,e), (a,f), (b,d), (b,e), (b,f) ...]. However, in my world the elements of permutations are scored and summed to value the arrangement. Supposing **a**, **d** and **e** are worth 2 points and **b**, **c** and **f** are worth 1 point. The value of some sample permutations are then:

```
(a,d) = 4
(a,e) = 4 
(a,f) = 3
(c,f) = 2

```

I need to generate all permutations but I would like to generate high value permutations before lower value permutations. 

Assuming the elements of each list are sorted in descending value order, is there a nice way to generate the permutations in value-order?

(Obviously I can generate all of the permutations and sort them but I would prefer to write a generator as the number of permutations can be large.)