{"id":27228,"library":"passagemath-rankwidth","title":"passagemath-rankwidth","description":"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).","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath-rankwidth","tags":["graph theory","rankwidth","rank decomposition","passagemath","rw"],"install":[{"cmd":"pip install passagemath-rankwidth","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core passagemath environment; required for graph objects and rankwidth functionality","package":"passagemath-sage","optional":false},{"reason":"Additional combinatorial structures used in rank decomposition","package":"passagemath-combinat","optional":true}],"imports":[{"wrong":"from passagemath.graphs.rankwidth import rankwidth","symbol":"rankwidth","correct":"from sage.graphs.rankwidth import rankwidth"}],"quickstart":{"code":"from passagemath.graphs.rankwidth import rankwidth\ng = graphs.PetersenGraph()\nrw, decomp = rankwidth(g, algorithm='rw')\nprint(rw)","lang":"python","description":"Compute the rankwidth of the Petersen graph using the rw algorithm."},"warnings":[{"fix":"Use 'from passagemath.graphs.rankwidth import rankwidth' instead.","message":"The import path has changed from sage.graphs.rankwidth to passagemath.graphs.rankwidth. Old imports will fail.","severity":"breaking","affected_versions":">=10.8"},{"fix":"Install the rw library (e.g., on Debian/Ubuntu: apt-get install rw) or set algorithm='cunningham' for a pure Python implementation.","message":"The rw algorithm (the default) uses the external 'rw' library, which must be installed as a system dependency. pip install does not install it automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Use algorithm='cunningham' instead of algorithm='exact'.","message":"The 'algorithm' parameter 'exact' is deprecated in favor of 'cunningham' for the exact decomposition method.","severity":"deprecated","affected_versions":">=10.8"},{"fix":"Access the rankwidth as the first element, and the decomposition as the second.","message":"The function returns a tuple (rankwidth, decomposition). The decomposition is a linear ordering representation, not a tree. Do not expect a tree structure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-3':42 '10.8':34 '10.8.4':28 '2':41 'cadenc':36 'comput':10 'current':26 'decomposit':14,49 'ecosystem':25 'follow':37 'function':8 'graph':16,45 'librari':20 'part':21,31 'passagemath':2,5,24,33,38,50 'passagemath-rankwidth':1,4 'per':43 'provid':7 'rank':13,48 'rankwidth':3,6,11,47 'releas':29,35,39 'rough':40 'rw':19,51 'theori':46 'use':17 'version':27 'year':44","created_at":"2026-05-01T17:45:09.982371+00:00","updated_at":"2026-05-01T17:45:09.982371+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nModuleNotFoundError: No module named 'sage.graphs.rankwidth'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/passagemath/passagemath","docs":"https://passagemath.org/docs/latest","changelog":"https://github.com/passagemath/passagemath/releases","pypi":"https://pypi.org/project/passagemath-rankwidth/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}