Skip to main content

Package for computing scanwidth of directed acyclic graphs (DAGs)

Project description

scanwidth

Package for computing scanwidth of directed acyclic graphs (DAGs).

Installation

pip install scanwidth

Quick Start

from scanwidth import DAG, Extension, TreeExtension

# Load a DAG from a file
dag = DAG("path/to/graph.el")

# Compute scanwidth using various algorithms
sw, extension = dag.optimal_scanwidth()        # Exact algorithm
sw, extension = dag.greedy_heuristic()        # Greedy heuristic
sw, extension = dag.cut_splitting_heuristic()  # Cut-splitting heuristic
sw, extension = dag.simulated_annealing()      # Simulated annealing

# Save the extension
extension.save_file("output.txt")

Algorithms

The package provides several algorithms for computing scanwidth:

  • optimal_scanwidth() - Exact algorithm using dynamic programming
  • greedy_heuristic() - Fast greedy heuristic
  • cut_splitting_heuristic() - Cut-splitting heuristic
  • simulated_annealing() - Simulated annealing metaheuristic

All methods return a tuple (scanwidth_value, extension_object). For specific parameter settings and detailed documentation, refer to the source code.

Citation

If you use this package in your research, please cite:

Paper: Exact and Heuristic Computation of the Scanwidth of Directed Acyclic Graphs by Niels Holtgrefe, Leo van Iersel, and Mark Jones (2024)
Available at: arXiv:2403.12734

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scanwidth-0.1.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scanwidth-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file scanwidth-0.1.0.tar.gz.

File metadata

  • Download URL: scanwidth-0.1.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for scanwidth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abff2559909d6023422f7f9fc3bef4eb4dd3c7546d897392b6fe1852bdc9ad7f
MD5 0c6e203520bd40b1aca7f660da9f2bda
BLAKE2b-256 55c9c6030ee6abcbcd4442ab5d53a8e40ec0132c0a68717cfbfce2e37750a71b

See more details on using hashes here.

File details

Details for the file scanwidth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scanwidth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for scanwidth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f034b4357a9ca7b0bffabb8c8c82e15a05f8315a465c71bb5a7c7087ca82b83a
MD5 fa34589b3b310584617aefa79a5d97ff
BLAKE2b-256 96de0f63b553aa861685dfdd778b363e3930608eeb68bf1c442c1922e4dd942e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page