Metadata-Version: 2.4
Name: pd-code-delete-nugatory
Version: 0.2.1
Summary: delete all nugatory crossing from a pd_code (link or knot).
License: MIT
License-File: LICENSE
Author: GGN_2015
Author-email: neko@jlulug.org
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pd-code-de-r1 (>=0.1.1)
Requires-Dist: pd-code-pre-nxt (>=0.1.0)
Description-Content-Type: text/markdown

# pd-code-delete-nugatory

Detect and remove nugatory crossings from PD codes.

## Installation

```bash
pip install pd-code-delete-nugatory
```

## Usage example

```python
from pd_code_delete_nugatory import erase_all_nugatory, get_index_of_nugatory

pd = [[1, 1, 2, 2]]
print(get_index_of_nugatory(pd))
print(erase_all_nugatory(pd))
```

## Algorithm

For each candidate crossing, the algorithm removes that crossing from a weak strand graph and compares graph connectivity. A crossing whose removal separates regions is nugatory. Erasing it reconnects the paired arcs, removes any induced Reidemeister-I crossing, and renumbers the remaining component cycles. The process repeats until no candidate remains.

## Input conventions

A PD code is represented as a list of four-entry crossings. Arc labels normally occur exactly twice. Public functions validate inputs and return new values rather than mutating caller-owned data unless their API explicitly says otherwise.

## External software

No external software is required.

## Development

Run examples and package checks before release. Python packages require Python 3.10 or newer. Build PyPI artifacts with:

```bash
poetry check
poetry build
```

## License

MIT. See `LICENSE`.

