Metadata-Version: 2.4
Name: scanwidth
Version: 0.2.3
Summary: Package for computing the edge- and node-scanwidth of a directed acyclic graph (DAG)
Author: Niels Holtgrefe
License: MIT License
        
        Copyright (c) 2023-2026 Niels Holtgrefe
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: graph,dag,scanwidth,edge-scanwidth,node-scanwidth
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: networkx>=3.0.0
Requires-Dist: numpy>=1.20.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Provides-Extra: scipy
Requires-Dist: scipy>=1.9.0; extra == "scipy"
Provides-Extra: gurobi
Requires-Dist: gurobipy>=10.0.0; extra == "gurobi"
Provides-Extra: ilp
Requires-Dist: scipy>=1.9.0; extra == "ilp"
Requires-Dist: gurobipy>=10.0.0; extra == "ilp"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.15.0; extra == "docs"
Dynamic: license-file

[![PyPI](https://img.shields.io/pypi/v/scanwidth)](https://pypi.org/project/scanwidth/)
[![License](https://img.shields.io/github/license/nholtgrefe/scanwidth)](https://github.com/nholtgrefe/scanwidth/blob/main/LICENSE)
[![Docs](https://img.shields.io/badge/docs-stable-blue)](https://nholtgrefe.github.io/scanwidth/)
[![JCSS DOI](https://img.shields.io/badge/JCSS-10.1016%2Fj.jcss.2026.103802-blue)](https://doi.org/10.1016/j.jcss.2026.103802)

# scanwidth

`scanwidth` is a Python package for computing edge-scanwidth and node-scanwidth
of directed acyclic graphs (DAGs). It provides exact and heuristic algorithms,
plus reduction pipelines that make practical computation on larger instances
more tractable.

## Key Features

- **Tree-extension and Extension classess**: classes that support
(tree-)extensions of DAGs, provide computations for scanwidth-bags and 
converting to canonical tree-extenions
- **Exact and heuristic solvers**: XP, brute-force, partition-based exact
  methods (edge), ILP backend selection (node), and multiple heuristics for edge- and node-scanwidth.
- **Reduction framework**: configurable `ReducerConfig`/`Reducer` pipelines for
  edge and node scanwidth, including optional parallel s-block solving.

## Installation

Install the base package:

```bash
pip install scanwidth
```

Install optional ILP dependencies:

```bash
# SciPy backend for node_scanwidth(..., algorithm="ilp", backend="scipy")
pip install scanwidth[scipy]

# Gurobi backend for node_scanwidth(..., algorithm="ilp", backend="gurobi")
pip install scanwidth[gurobi]

# Both ILP backends
pip install scanwidth[ilp]
```

`gurobipy` requires a working Gurobi installation and a valid Gurobi license
(commercial or academic, depending on your setup).

Version requirements for optional ILP backends:

- `scipy>=1.9.0`
- `gurobipy>=10.0.0`

## Documentation

For installation instructions, quickstart examples, and full API reference, see
the **[scanwidth docs](https://nholtgrefe.github.io/scanwidth/)**.

## Citation

If you use `scanwidth` in your research, please cite the corresponding paper:

> Niels Holtgrefe, Leo van Iersel, and Mark Jones. *Exact and heuristic computation of the scanwidth of directed acyclic graphs*. Journal of Computer and System Sciences, 160:103802, 2026. doi: [10.1016/j.jcss.2026.103802](https://doi.org/10.1016/j.jcss.2026.103802)

To view the experimental materials of the paper, go to the folder `experiments`.
