Metadata-Version: 2.4
Name: mapFolding
Version: 0.19.0
Summary: Map folding, meanders, stamp folding, semi-meanders. Experiment with algorithm transformations, and analyze computational states.
Author-email: Hunter Hogan <HunterHogan@pm.me>
Maintainer-email: Hunter Hogan <HunterHogan@pm.me>
License-Expression: CC-BY-NC-4.0
Project-URL: Context7, https://context7.com/hunterhogan/mapfolding
Project-URL: Donate, https://www.patreon.com/integrated
Project-URL: Download, https://pypi.org/project/mapFolding
Project-URL: Homepage, https://github.com/hunterhogan/mapFolding
Project-URL: Issues, https://github.com/hunterhogan/mapFolding/issues
Project-URL: Repository, https://github.com/hunterhogan/mapFolding.git
Keywords: A001415,A001417,OEIS,combinatorial geometry,combinatorics,computational combinatorics,computational geometry,map folding,meanders,stamp folding
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: astToolkit>=0.11.0
Requires-Dist: gmpy2
Requires-Dist: hunterMakesPy>=0.7.1
Requires-Dist: more_itertools
Requires-Dist: numpy
Requires-Dist: platformdirs
Requires-Dist: tqdm
Requires-Dist: urllib3
Requires-Dist: Z0Z_tools>=2.2.0
Provides-Extra: development
Requires-Dist: gmpy2-stubs; extra == "development"
Requires-Dist: ipykernel; extra == "development"
Requires-Dist: ipywidgets; extra == "development"
Requires-Dist: memray; sys_platform == "linux" and extra == "development"
Requires-Dist: py-spy; extra == "development"
Requires-Dist: pyarrow-stubs; extra == "development"
Requires-Dist: pytest-cov; extra == "development"
Provides-Extra: numba
Requires-Dist: numba; extra == "numba"
Requires-Dist: numba_progress; extra == "numba"
Provides-Extra: ortools
Requires-Dist: ortools; extra == "ortools"
Provides-Extra: pandas
Requires-Dist: pandas; extra == "pandas"
Requires-Dist: pyarrow; extra == "pandas"
Provides-Extra: sympy
Requires-Dist: sympy; extra == "sympy"
Provides-Extra: testing
Requires-Dist: numba; extra == "testing"
Requires-Dist: ortools; extra == "testing"
Requires-Dist: pandas; extra == "testing"
Requires-Dist: pyarrow; extra == "testing"
Requires-Dist: pytest-env; extra == "testing"
Requires-Dist: pytest-xdist; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: sympy; extra == "testing"
Dynamic: license-file

# mapFolding

[![pip install mapFolding](https://img.shields.io/badge/pip%20install-mapFolding-gray.svg?colorB=3b434b)](https://pypi.org/project/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](https://github.com/hunterhogan/astToolkit). But those got so sophisticated, that I create more than half of that package through another layer of meta-programming: [astToolFactory](https://github.com/hunterhogan/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](https://oeis.org/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

- [BibTeX citation.](citations/Lunnon1968.bib)
- DOI: [10.1090/S0025-5718-1968-0221957-8](https://doi.org/10.1090/S0025-5718-1968-0221957-8)
- PDF: [American Mathematical Society](https://pubs.ams.org/journals/mcom/1968-22-101/S0025-5718-1968-0221957-8/S0025-5718-1968-0221957-8.pdf)

### Folding a strip of stamps

- [BibTeX citation.](citations/Koehler1968.bib)
- DOI: [10.1016/S0021-9800(68)80048-1](https://doi.org/10.1016/S0021-9800(68)80048-1)

### Multi-dimensional map-folding

- [BibTeX citation.](citations/Lunnon.bib)
- DOI: [10.1093/comjnl/14.1.75](https://doi.org/10.1093/comjnl/14.1.75)
- PDF: [academic.oup.com](https://academic.oup.com/comjnl/article-pdf/14/1/75/1020149/140075.pdf)

### A transfer matrix approach to the enumeration of plane meanders

- [BibTeX citation.](citations/Jensen.bib) [TeX Source with precise formulas for AI agents.](https://arxiv.org/src/cond-mat/0008178)
- DOI: [10.1088/0305-4470/33/34/301](https://doi.org/10.1088/0305-4470/33/34/301)
- Free pre-print: [arXiv:cond-mat/0008178](https://arxiv.org/abs/cond-mat/0008178)

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

- [BibTeX citation.](citations/ClisbyJensen2012.bib) [TeX Source with precise formulas for AI agents.](https://arxiv.org/src/1111.5877)
- DOI: [10.1088/1751-8113/45/11/115202](https://doi.org/10.1088/1751-8113/45/11/115202)
- Free pre-print: [arXiv:1111.5877](https://arxiv.org/abs/1111.5877)

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

- [BibTeX citation.](citations/Sawada2012.bib)
- DOI: [10.37236/2404](https://doi.org/10.37236/2404)
- PDF: [The Electronic Journal of Combinatorics](https://www.combinatorics.org/ojs/index.php/eljc/article/view/v19i2p43/pdf)

### Foldings and meanders

- [BibTeX citation.](citations/Legendre2014.bib) [TeX Source with precise formulas for AI agents.](https://arxiv.org/src/1302.2025)
- PDF: [The Australasian Journal of Combinatorics](https://ajc.maths.uq.edu.au/pdf/58/ajc_v58_p275.pdf)
- Free pre-print: [arXiv:1302.2025](https://arxiv.org/abs/1302.2025)

### Valid Orderings of Layers When Simple-Folding a Map

- [BibTeX citation.](citations/Jia2020.bib)
- DOI: [10.2197/ipsjjip.28.816](https://doi.org/10.2197/ipsjjip.28.816)
- PDF: [Journal of Information Processing](https://www.jstage.jst.go.jp/article/ipsjjip/28/0/28_816/_pdf/-char/en)

## My recovery

[![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)

[![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/mapFolding/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
