Linked Questions

6
votes
5answers
437 views

A replacement for NextPermutation in Combinatorica [duplicate]

Does anyone know of a replacement for NextPermutation in Combinatorica? The problem with loading Combinatorica is that it interferes with new functionality which I ...
3
votes
2answers
2k views

Need to create a function to generate all permutations of Range[$n$] [duplicate]

Basically I need a function that takes a list and gives all the possible permutations of it. The reason I can't use Permutations is that I have to apply another ...
2
votes
2answers
236 views

The i-th element of a permutation [duplicate]

I am trying to run something of the form ...
0
votes
2answers
227 views

Want to compute the permutations of {1, 2, ..., 11} with only 3 GB of memory [duplicate]

There is another way to calculate Permutations [{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}] without triggering an error, I have 3 GB of RAM with WIN 7 Edit: This ...
0
votes
2answers
72 views

Permutations of $ \{1, 2, \dots, n\} $ [duplicate]

When I try Permutations[Range[1, 12]]; // AbsoluteTiming I get {53.6949, Null} and with ...
33
votes
9answers
2k views

Faster derangements?

I wonder what is the fastest method to generate derangements? Both the Combinatorica function and Martin Ender's answer to Permutations of lists of fixed even numbers are based on filtering the ...
35
votes
4answers
5k views

Looking for "Longest Common Substring" solution

I'm looking for robust code to solve the "Longest Common Substring" problem: Find the longest string (or strings) that is a substring (or are substrings) of two or more strings. I can just code it ...
2
votes
0answers
776 views

How do I iterate through all permutations of a list? [closed]

I need to generate all permutation of a list of integers, but doing so (the list has around 60 elements, is not practical. Is there a way to iterate through all permutations of a list, without first ...
1
vote
2answers
145 views

Permutations without using the built in function in Wolfram

I suspect this is a really silly question but for the life of me, I am unable to figure out how to define a function that creates all the permutations of a given list. I know I can use the Permutation ...
2
votes
2answers
324 views

Generating a permutation of elements in chunks

Is there a way for me to generate a list of permutations in "chunks" such that I needn't store everything on RAM all at once? Consider that (WARNING: DO NOT RUN! --- Will generate a list with 13! = ...
2
votes
1answer
356 views

Generate a list of values with equal number of each value

I want to create a list of 32 values such that from {a,b} I can generate ...
2
votes
1answer
157 views

Calculating partial binary `Permutations`

I would like MMA to only calculate some of the permutations of a set. I am currently doing something along the lines of ...
1
vote
0answers
38 views

Custom Table, for iterating over permutations

It is common that I iterate over all permutations of 1,2...,n, either by making a table or performing a sum. Instead of creating the set of all permutations, it would be better to iterate over them. ...