phypanda is the Python library for PaNDA—an algorithm library for phylogenetic diversity (PD) optimization on directed phylogenetic networks. It builds on phylozoo for network representations and scanwidth for node- and edge-scanwidth–based dynamic programming.
- All-paths (MAPPD), Max-tree and Min-tree PD: compute the diversity score of a fixed taxon set for several PD measures, or maximize PD using exact FPT algorithms parameterized by node scanwidth or edge scanwidth.
- Budgeted maximization: assign integer costs to taxa and maximize PD under budget constraints.
- JIT-compilation: speed up algorithms by optional
numbaJIT compilation. - High-level API —
compute_diversity,marginal_diversities,greedy_max_diversity, andsolve_max_diversitywork with any measure and dispatch to the appropriate solver.
pip install phypandaRuntime dependencies (phylozoo, networkx, scanwidth, numba) are installed automatically. For development or documentation extras:
pip install phypanda[dev] # testing
pip install phypanda[docs] # Sphinx documentationFor the full manual, API reference, and installation guide, visit the phypanda docs.
If you use phypanda, please cite:
Niels Holtgrefe, Leo van Iersel, Ruben Meuwese, Yukihiro Murakami, and Jannik Schestag. PaNDA: Efficient Optimization of Phylogenetic Diversity in Networks. bioRxiv, 2025. doi: 10.1101/2025.11.14.688467
If your work builds specifically on the budgeted node-scanwidth algorithms, please also cite:
Niels Holtgrefe and Jannik Schestag. Tractable Optimization of Budgeted Phylogenetic Diversity on Networks Utilizing Node-Scanwidth. arXiv:2605.23319, 2026.
For the graphical-user interface developed for the first paper, please go to gui/.
For the experimental materials corresponding to the above two papers, please go to experiments/.
