passagemath-plantri
raw JSON → 10.8.4 verified Sat May 09 auth: no python
A Python interface to plantri and fullgen for generating planar triangulations, cubic planar graphs, and other planar graph families. Part of the passagemath ecosystem. Current version 10.8.4, requires Python 3.11-3.14. Releases follow passagemath release cycle.
pip install passagemath-plantri Common errors
error RuntimeError: plantri binary not found ↓
cause The plantri/fullgen executable is not installed or not in PATH.
fix
Install plantri system-wide (e.g., 'apt install plantri' or download from official site and add to PATH). Verify by typing 'plantri' in terminal.
error ImportError: No module named 'passagemath.plantri' ↓
cause Missing passagemath-plantri installation or wrong import statement.
fix
Run 'pip install passagemath-plantri' and import as 'from passagemath.plantri import ...'.
error ValueError: n must be at least ... ↓
cause Minimum vertex count constraints vary by graph family (e.g., planar triangulations require n>=4).
fix
Check documentation for minimum n; for planar_triangulations start at n>=4.
Warnings
gotcha The `plantri` and `fullgen` binaries must be installed separately (e.g., via system package manager or by downloading from plantri website) and placed in PATH. Wrapper does NOT bundle them. ↓
fix Install plantri binary (e.g., 'sudo apt install plantri' on Debian/Ubuntu, or download from https://users.cecs.anu.edu.au/~bdm/plantri/)
deprecated Passing integer arguments directly to plantri functions (e.g., planar_triangulations(6)) is deprecated. Use PlantriOptions class instead. ↓
fix Use PlantriOptions(n=6, ...) and pass to functions
breaking Before passagemath 10.0, the library was named 'plantri' on PyPI and imported as 'import plantri'. Now it's 'passagemath-plantri' and imported from passagemath.plantri. ↓
fix Update imports: from passagemath.plantri import ...
gotcha Generated graphs are passagemath Graph objects, not networkx or igraph. Use .graph6_string() or adjacency_matrix() to convert. ↓
fix Use methods like g.graph6_string() or g.to_networkx() if passagemath-networkx installed
Imports
- planar_triangulations wrong
import plantricorrectfrom passagemath.plantri import planar_triangulations - PlantriOptions
from passagemath.plantri import PlantriOptions
Quickstart
from passagemath.plantri import planar_triangulations
for g in planar_triangulations(6):
print(g.graph6_string())