Registry / data / passagemath-rankwidth

passagemath-rankwidth

JSON →
library10.8.4pypypiunverified

passagemath-rankwidth provides functions for computing rankwidth and rank decompositions of graphs using the rw library. Part of the passagemath ecosystem. Current version: 10.8.4, released as part of passagemath 10.8. Release cadence follows passagemath releases (roughly 2-3 per year).

pip install passagemath-rankwidth
INSTALL
IMPORT
SIG · PASSAGEMATH-RANKWI
P
passagemath-rankwidth
datapythonv10.8.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rankwidth
✓ from sage.graphs.rankwidth import rankwidth
✗ from passagemath.graphs.rankwidth import rankwidth

Compute the rankwidth of the Petersen graph using the rw algorithm.

from passagemath.graphs.rankwidth import rankwidth g = graphs.PetersenGraph() rw, decomp = rankwidth(g, algorithm='rw') print(rw)
Debug
Known issues
breakingThe import path has changed from sage.graphs.rankwidth to passagemath.graphs.rankwidth. Old imports will fail.
fix
Use 'from passagemath.graphs.rankwidth import rankwidth' instead.
affects: >=10.8
gotchaThe rw algorithm (the default) uses the external 'rw' library, which must be installed as a system dependency. pip install does not install it automatically.
fix
Install the rw library (e.g., on Debian/Ubuntu: apt-get install rw) or set algorithm='cunningham' for a pure Python implementation.
affects: all
deprecatedThe 'algorithm' parameter 'exact' is deprecated in favor of 'cunningham' for the exact decomposition method.
fix
Use algorithm='cunningham' instead of algorithm='exact'.
affects: >=10.8
gotchaThe function returns a tuple (rankwidth, decomposition). The decomposition is a linear ordering representation, not a tree. Do not expect a tree structure.
fix
Access the rankwidth as the first element, and the decomposition as the second.
affects: all
Upgrade
Version history
10.8.4latest on PyPI · released Apr 20, 2026
Audit
Dependencies
passagemath-sagerequiredCore passagemath environment; required for graph objects and rankwidth functionality
passagemath-combinatoptionalAdditional combinatorial structures used in rank decomposition
Agent activity
7 hits · last 30 days
node
6
Anthropic
1
Resources