Pancake sorting

This webpage contains data and source codes of programs mentioned in the paper "On average and highest number of flips in pancake sorting". A preprint of the paper can be found at arxiv.

See wikipedia for definitions and related works.

All the programs are under GPL. See comments in each of the source files for more information on their usage and on how they work. Most of the compiled files will also provide usage instructions when run without paramaters. Some notes about compilation.

Unburnt pancakes

Numbers of stacks of n unburnt pancakes requiring m flips to sort:

n\m 13 14 15 16 17 18 19 20 21 22
14 30,330,792,508 20,584,311,501 2,824,234,896 24,974
15 ? ? 310,592,646,490 45,016,055,055 339,220
16 ???? 756,129,138,051 4,646,117
17 ?????? 65,758,725*
18 ??????? ≥12,357,059**
19 ????????? ≥410***

The .txt files contain stacks one on each line, each line lists the pancakes from top to bottom. Empty field in the table means that no such stack exists.

* You will need 7zip to unpack the archive. One of the unpacked files will be Readme.txt with the instructions on how to obtain a file in a human-readable format. The resulting file will have ~2,6 GB.

** The file contains just every 100th of the stacks generated from U(17,19) by program onestep.

*** Stacks generated from the incomplete U(18,20) and also e.g. by trying all stacks with chunks of size (8,6,5).

Burnt pancakes

Numbers of stacks of n burnt pancakes requiring m flips to sort:

n\m 17 18 19 20 21 22 23 24 25
11 5,928,175 10,480 36
12 ??344,884265 1
13 ????15,6754
14 ??????122
15 ???????? 2

The .txt files contain stacks one on each line, each line lists the pancakes from top to bottom, '-' after a pancake means that the pancake is burnt side up. Empty field in the table means that no such stack exists.


Last update Nov 30, 2013

Fixed onestep-b.c and onestack-b.c, which expected burnt9.bin file, while only burnt9.binf is available here (.bin was an earlier format).

update Nov 25, 2011

Added bfs-unb.c, Readme.txt and fixed bur-binfout.c which could crash sometimes (closing file that was not open).