in reply to Re: all permutations of given lenght
in thread all permutations of given lenght

Indeed! I am trying to generate an exhaustive list of SMILES codes, including their repetitions. I have tried
use strict; use warnings; use Algorithm::Combinatorics qw(permutations); my $strings = [qw(A B C)]; my $iter = permutations($strings, 3); while (my $c = $iter->next) { print "@$c\n"; }

The problem is that it does not generate things like AAA, BBB, CCC [A, B, C would be the corresponding SMILEs).

Replies are listed 'Best First'.
Re^3: all permutations of given lenght
by Anonymous Monk on Aug 11, 2020 at 10:50 UTC
    I am trying to generate an exhaustive list of SMILES codes, including their repetitions.
    permutations are reorderings, i.e. samples without replacement. You seem to want all possible samples with replacement, i.e. variations_with_repetition.