These are the goals that I'd like to achieve:
-
Conversion between tree to other well-known (generalized) Catalan structures in linear time.
-
Support for common operations such as triangulation flip for each type of Catalan structures.
-
A visualizer tool that produces publication level of svg.
-
Enumeration of well-known Catalan structures (including
$k$ -ary trees and$r$ -dyck paths). -
Enumeration of
pattarn avoiding
Catalan structures.
See Milestones for sub items break down.
Here shows the visualization for catalan(4)
in each Catalan structure. There are 14 of them for each.
For catalan(5)
, please click here (42 of them for each Catalan structure).
You will likely encounter this error below when attempting to do triangulation flip:
nextEventMatchingMask should only be called from the Main Thread!
It is because that the visualizer is not started on the main thread and apparently Apple does not allow that - read more about it here.
- A verifiably random generator for full
k
-ary tree
- Visualizer for full
k
-ary trees - Gallery for
$C_4$ and$C_5$
- Convert between
r
-dyck path mirrored pre-order bit string and tree inO(n)
- Convert between
r
-dyck path pre-order bit string and tree inO(nlog(n/r))
- Visualizer for
r
-dyck path - Verify a given path is a valid
r
-dyck path or not - Flip mountain
- Gallery for
$C_4$ and$C_5$
- Convert between polygon triangulation and binary tree in
O(n)
- Visualizer for polygon triangulation
- Triangulation flip in
O(1)
withO(n)
pre-processing and visualize the result - Verify a given polygon triangulation is a valid polygon triangulation or not
- Gallery for
$C_4$ and$C_5$
- Convert between non-intersecting chord graph and binary tree in
O(n)
- Visualizer for non-intersecting chord graph
- Exchange a chord and visualize the result
- Verify a given chord graph is a valid non-intersecting chord graph or not
- Gallery for
$C_4$ and$C_5$
- Convert between non-crossing arcs and binary tree in
O(n)
- Visualizer for non-crossing arcs
- Exchange an arc and visualize the result
- Verify a given arcs is a valid non-crossing arcs or not
- Gallery for
$C_4$ and$C_5$
- Visualizer for coin stack
- Gallery for
$C_4$ and$C_5$
- Package Mutze codes into a C++ library.
- Use the above to enumerate pattern avoiding binary trees.
- Generalize the above to all Catalan structures.
- Plot the patterns and ask users to comfirm the patterns.
- Plot pattern avoiding Calatan structures.
- Save all of the above as svg files onto the disk.
- Able to enumerate generalized Catalan structures lexicographically via an interator.
- Output full
k
-ary tree as a file and read from it to recreate it - A website that hosts all visualization for well-known Catalan structures for
n >= 3 to n < ?
.
- Documentation
- Code base rewrite to follow OOP
- Code base rewrite to follow modern C++
- Refactor Project structure to follow
include/
,obj/
,src/
,lib/
format. - Refactor Makefile to follow modern standard.
- Compile related work
The Makefile
uses -std=c++23
, so make sure your g++
compiler version supports it.
Additionally, make sure that GNU GMP library is installed (bignum lib).
Install GNU GMP and g++-14 from Homebrew.
- Run
./install.sh
This will create a python virtual environment, install all dependencies, and then run Makefile.
It also attempts to silence the warning described below.
The provided script has been tested on:
- Arch Linux (Distrobox within Fedora Silverblue)
- Macbook M1 first gen
Netgraph lib currently has this warning as discussed by the library creator here; to suppress this harming warning, put
np.seterr(divide='ignore', invalid='ignore')
where the warning occurrs.
credit to this post.
- The Average Height of Binary Trees and Other Simple Trees
- ON THE HEIGHT OF TREES
- Variance of Height of Tree
- How to analyze this expected number of a random tree?
- Counting and Randomly Generating k-Ary Trees
- Counting k-ary labelled trees
- Prüfer Codes of Labeled Trees
- Prüfer Code
- Prüfer Code
- Lexicographic Enumeration of k-ary Trees
- Efficient loopless generation of Gray codes for k-ary trees
- Generating Binary Trees by Rotations
- The Greedy Gray Code Algorithm
- COMBINATORIAL GENERATION VIA PERMUTATION LANGUAGES. VI. BINARY TREES
- The Combinatorial Object Server
- Efficient algorithms for generating pattern-avoiding combinatorial objects
- Raised k-Dyck Paths
- On a generalisation of k-Dyck paths
- COMBINATORICS OF r-DYCK PATHS, r-PARKING FUNCTIONS, AND THE r-TAMARI LATTICES
- Common edges in rooted trees and polygonal triangulations
- Rotation Distance, Triangulations, and Hyperbolic Geometry
- Convex polygon triangulation based on planted trivalent binary tree and ballot problem
- Graph of triangulations of a convex polygon and tree of triangulations
- Properties of Random Triangulations and Trees
- Richard P. Stanley - Catalan Numbers-Cambridge University Press (2015)
- Information on Enumerative Combinatorics
- Bijection Between Catalan Objects
- Catalan Numbers
- CATALAN NUMBERS
- Catalan Numbers, Their Generalization, and Their Uses
- On the Mixing Time of the Triangulation Walk and other Catalan Structures
- Improved Mixing for the Convex Polygon Triangulation Flip Walk
- Polynomial mixing time of edge flips on quadrangulations