The goal of this document is to compare the performances of some of the existing packages for generating combinations, permutations and partitions.

gtools::permutations, gtools::combinations and utils::combn are renamed because they are being overwritten by arrangements::permutations, arrangements::combinations and combinat::combn respectively.

Permutations

Permutations of 6 items

## Unit: relative
##          expr     min      lq    mean  median      uq     max neval   cld
##        gtools  706.04  396.51  366.73  356.50  330.90  266.27   100   c  
##     multicool  350.00  194.94  181.31  182.55  170.10  110.75   100  b   
##    partitions    3.14    2.97    2.81    2.81    2.71    2.21   100 a    
##      permuate 1233.98  701.87  628.39  651.67  579.41  348.00   100    d 
##  permutations 3519.82 1996.05 1736.34 1826.61 1554.54 1660.85   100     e
##     RcppAlgos    1.85    2.01    2.87    1.97    1.74   43.66   100 a    
##  arrangements    1.00    1.00    1.00    1.00    1.00    1.00   100 a

5-Permutations of 7 items

## Unit: relative
##          expr   min     lq   mean median     uq    max neval cld
##        gtools 296.8 272.04 211.19 212.98 184.52 156.91   100   b
##     RcppAlgos   1.2   1.26   1.43   1.51   1.34   1.92   100  a 
##  arrangements   1.0   1.00   1.00   1.00   1.00   1.00   100  a

Permutations of multiset

## Unit: relative
##          expr     min      lq    mean  median      uq     max neval cld
##     multicool 2589.59 2289.55 1829.01 2173.85 1938.23 1025.68   100   b
##     RcppAlgos    1.45    1.37    1.69    1.53    1.58    7.29   100  a 
##  arrangements    1.00    1.00    1.00    1.00    1.00    1.00   100  a

K-Permutations of multiset

## Unit: relative
##          expr    min      lq mean  median      uq    max neval cld
##     multicool 4484.5 3922.87 2689 2999.64 2820.24 302.23   100   b
##     RcppAlgos    1.7    1.55    2    1.59    1.57   2.34   100  a 
##  arrangements    1.0    1.00    1    1.00    1.00   1.00   100  a

Combinations

7-Combinations of 15 items

## Unit: relative
##          expr    min    lq   mean median     uq    max neval  cld
##        gtools 361.12 316.8 242.93 301.13 206.30 135.19   100    d
##      combinat  90.23  79.7  61.40  71.99  50.40  44.54   100  b  
##         utils 113.88  99.7  77.90  91.13  66.62  51.29   100   c 
##     RcppAlgos   1.04   1.2   1.36   1.21   1.27   7.46   100 a   
##  arrangements   1.00   1.0   1.00   1.00   1.00   1.00   100 a

Combinations with replacement of 9 items

## Unit: relative
##          expr   min    lq   mean median     uq    max neval cld
##        gtools 333.7 316.8 276.48 251.64 255.05 443.69   100   b
##     RcppAlgos   1.2   1.3   1.62   1.47   1.46   9.19   100  a 
##  arrangements   1.0   1.0   1.00   1.00   1.00   1.00   100  a

Combinations of multiset

## Unit: relative
##          expr  min   lq mean median   uq  max neval cld
##     RcppAlgos 1.39 1.38 2.52    1.4 1.45 28.1   100   a
##  arrangements 1.00 1.00 1.00    1.0 1.00  1.0   100   a

Partitions

Partitions of 30

## Unit: relative
##          expr  min   lq mean median   uq max neval cld
##    partitions 3.41 5.62 3.72   2.86 2.86  10   100   b
##  arrangements 1.00 1.00 1.00   1.00 1.00   1   100  a

Partitions of 50 into 10 parts

## Unit: relative
##          expr  min   lq mean median   uq  max neval cld
##    partitions 3.52 3.46  3.2   3.86 4.05 2.08   100   b
##  arrangements 1.00 1.00  1.0   1.00 1.00 1.00   100  a