Various code to explore the bounds of the flip distance between non-crossing trees in convex position.
We specifically aim to find a pair of trees with a new best-know confliction value
- Python 3.7 or higher
- Virtual environment (recommended)
git clone https://github.com/cjlangan/noncrossing_trees
cd noncrossing_trees/ && make- This will automatically create a virtual environment, install requirements, and run the program.
Navigate to the noncrossing_trees directory and use the provided Makefile:
cd noncrossing_trees
# Run the main application
make run
# Run the demo
make demo
# Show available commands
make help
# Debug project setup
make debugOnce ran, you will be prompted to choose which demo to run. Checkout the examples/ directory to modify specific parameters in the demo files.
| Command | Description |
|---|---|
make run |
Run noncrossing_trees.main as module (recommended) |
make run-direct |
Run main.py directly with PYTHONPATH |
make run-local |
Run from noncrossing_trees directory |
make demo |
Run the demonstration script |
make install-dev |
Install package in development mode |
make install-deps |
Install dependencies from requirements.txt |
make check-venv |
Verify virtual environment exists, else creates one |
make activate |
Show command to activate virtual environment |
make clean |
Clean Python cache files |
make debug |
Show project info and structure |
make help |
Show all available commands |
If you prefer to not use the Makefile, you can install and run without it:
cd noncrossing_trees/
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd .. && python -m noncrossing_trees.mainThe project uses Python's module system with proper package structure. Imports follow this pattern:
# From within noncrossing_trees package
from .analysis import GammaAnalyzer
from .core import TreeUtils- Create new modules in the
noncrossing_trees/directory - Add
__init__.pyfiles for new subdirectories - Use relative imports within the package
- Create a demo file in the
examples/directory that uses your feature. Make sure that it has a name ending in "_demo.py" - Edit
__init__.pyin theexamples/directory to add your demo - Update the main.py to use your demo file
If you encounter import errors like ImportError: attempted relative import with no known parent package:
- Use the Makefile:
make runhandles Python path correctly - Check virtual environment:
make check-venv - Use module execution:
python -m noncrossing_trees.maininstead ofpython main.py - Verify project structure:
make debug
# Recreate virtual environment
rm -rf venv
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtIf you encounter:
FileNotFoundError: [Errno 2] No such file or directory: '.../matplotlib/mpl-data/images/matplotlib.png'Try reinstalling matplotlib:
pip uninstall matplotlib
pip install matplotlibFor proper IDE support with imports, consider:
- Configure Python path in your IDE to include project root
- Install in development mode:
make install-dev - Use absolute imports if relative imports cause LSP warnings
- Follow the existing code structure and import patterns
- Add new functionality to appropriate modules
- Update this README for significant changes
- Test using the provided Makefile commands
- Submit a detailed PR
TODO: [Add license information here when public]
| Name | |
|---|---|
| Connor Langan | langanc@myumanitoba.ca |
| Atishaya | maharjaa@myumanitoba.ca |