Skip to main content

Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations, and analyze computational states.

Project description

mapFolding

pip install mapFolding

Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations and code optimization.

I don't know how to write a README.md. Furthermore, the package used to be focused on multidimensional map folding and tools for transforming the algorithm to experiment with optimizations or to explore the algorithm.

First, the tools for transforming algorithms became far more sophisticated and powerful than this package. So I moved them to astToolkit. But those got so sophisticated, that I create more than half of that package through another layer of meta-programming: astToolFactory.

Second, when I finally understood the connections between map folding and meanders, I added meanders to this package, and applied my transformation tools to that algorithm.

I used a weaker form of this package to compute new terms for OEIS A001415, "Number of ways of folding a 2 X n strip of stamps." There are cool and powerful tools in here, but as of 2025 September 17, I am dissatisfied with the organization and documentation. It's annoying.

Finding stuff

  1. At the moment, almost every algorithm version eventually runs through "mapFolding/basecamp.py", so it's sort of an overview and you can work backwards to find more details.
  2. The directory "mapFolding/algorithms" only has "handmade" algorithms. Therefore, most logic for most computations is based on something in that directory.
  3. The directory "mapFolding/syntheticModules" has code that is generated by the transformation tools.
  4. Transformation functions are in "mapFolding/someAssemblyRequired."
  5. The directory "mapFolding/reference" has "reference" materials.
  6. "mapFolding/tests" has the tests, and I have tried to make it easy for you to add your versions of the algorithms to the tests. Is it actually easy? I'll say it this way: if you were to create your own subclass of ast.AST it would be impossible for you to add your subclass to all of the ast module tests with just a few lines of code. In contrast, it is possible to fully test your algorithm with my tests by adding between 3 and 25 lines of code. So, yeah, it's easy.

Math and programming

I'm not a mathematician. I don't have training in or professional experience as a programmer. I'm not stupid: I'm ignorant.

Reference materials

A map-folding problem

Folding a strip of stamps

Multi-dimensional map-folding

A transfer matrix approach to the enumeration of plane meanders

A new transfer-matrix algorithm for exact enumerations: self-avoiding polygons on the square lattice

Stamp Foldings, Semi-Meanders, and Open Meanders: Fast Generation Algorithms

Foldings and meanders

Valid Orderings of Layers When Simple-Folding a Map

My recovery

Static Badge YouTube Channel Subscribers

CC-BY-NC-4.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapfolding-0.19.0.tar.gz (788.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mapfolding-0.19.0-py3-none-any.whl (972.3 kB view details)

Uploaded Python 3

File details

Details for the file mapfolding-0.19.0.tar.gz.

File metadata

  • Download URL: mapfolding-0.19.0.tar.gz
  • Upload date:
  • Size: 788.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mapfolding-0.19.0.tar.gz
Algorithm Hash digest
SHA256 a31116f724ed99e845a54a7207a320b7f2b9ce904b5619be16504be8437bef3b
MD5 38f55227a5fc626bf55d07fe6087e091
BLAKE2b-256 b4d00eef24545ea53e0364d470dabee894d99aa72e171e7a8eaf220c2f4f8a67

See more details on using hashes here.

File details

Details for the file mapfolding-0.19.0-py3-none-any.whl.

File metadata

  • Download URL: mapfolding-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 972.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mapfolding-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19273a58a44630e52c852e3d3f75b6b46153e7e9a61de74c5f26fefa6e8a753a
MD5 4fe78811e849004613b5da069b2d7b8c
BLAKE2b-256 1d95ef950fb67f8ced63a0c009a77de4ff2b8f8e3e473bb3161ce1d8b68d1a61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page