Skip to content

Ergun1234/Morozov_type_Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strip Examples

This repository contains Python code for constructing and studying strip worst-case examples for reduction algorithm used in topological data analysis. These examples are similar to Morozov's worst-case examples but instead of a construction inside a single triangle, they are constructed by adding triangles on a strip of base and fin triangles. The scripts generate these strip examples, compute boundary matrix reductions, and benchmark the runtime of several reduction variants.

Repository Layout

src/
  strip_create.py         Build a worst-case complex, compute matrices, and plot a persistence diagram
  strip_runtime.py        Benchmark reduction algorithms and save runtime plots
  strip_utilities.py      Shared helpers for drawing and matrix reduction
notebooks/
  run_create_batch.py     Generate batches of simplicial complex and persistence diagram images
  run_runtime_batch.py    Generate batches of runtime benchmark plots
  results_*               Generated output folders created by the scripts
requirements.txt
LICENSE
README.md

Requirements

  • Python 3.11 recommended
  • gudhi
  • numpy
  • networkx
  • matplotlib

Install with pip:

pip install -r requirements.txt

Or with conda:

conda create -n strip-examples python=3.11 -y
conda activate strip-examples
conda install -c conda-forge gudhi numpy networkx matplotlib -y

Running the Scripts

Run all commands from the repository root.

Build One Example

python3 src/strip_create.py

This script:

  • constructs a worst-case filtered simplicial complex for a chosen n
  • prints the simplices and persistence pairs
  • writes boundary matrix outputs to notebooks/results_strip_create/
  • shows the simplicial complex and persistence diagram

To change the size of the example, edit n in the __main__ block of src/strip_create.py.

Run One Runtime Benchmark

python3 src/strip_runtime.py

Optional arguments:

python3 src/strip_runtime.py --t 30 --verbose
  • --t: maximum n value used in the benchmark
  • --verbose: print per-n timing information

This script saves runtime plots to notebooks/results_strip_runtime/.

Generate Batch Figures

python3 notebooks/run_create_batch.py
python3 notebooks/run_runtime_batch.py

These scripts use the non-interactive matplotlib backend and save outputs to:

  • notebooks/results_create_batch/
  • notebooks/results_runtime_batch/

Output Files

The repository scripts currently write generated files into notebooks/:

  • notebooks/results_strip_create/
  • notebooks/results_strip_runtime/
  • notebooks/results_create_batch/
  • notebooks/results_runtime_batch/

These directories contain generated artifacts rather than source code.

Notes

  • src/strip_create.py currently uses a hard-coded n value in its main block.
  • src/strip_runtime.py benchmarks three reduction variants: standard, twist, and look-ahead.
  • The plotting scripts require a working matplotlib installation.

Paper Reference

This repository contains experiments for the manuscript:

  • (submitted to arXiv)

Citation

If you use this repository, please cite the associated paper:

@misc{cetinYalcin2026strip,
  title         = {<Worst-Case Examples for the Computation of Persistent Homology>},
  author        = {Uzay Cetin and Ergun Yalcin},
  year          = {2026},
  archivePrefix = {arXiv},
  primaryClass  = {math.AT}
}

Authors

  • Uzay Cetin
  • Ergun Yalcin

License

This project is distributed under the license in LICENSE.

About

This repository contains Python codes for constructions of worst-case examples for reduction algorithm for calculating persistent homology. These worst-case examples are constructed in a paper by Cetin and Yalcin and they provide alternative constructions to examples originally given by Morozov.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages