{"id":28035,"library":"passagemath-tdlib","title":"passagemath-tdlib","description":"A Python wrapper for the tdlib library for tree decomposition computations. Provides high-performance tree decomposition algorithms including heuristics, exact methods, and dynamic programming FPT algorithms. Version 10.8.4, part of the passagemath ecosystem.","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath-tdlib","tags":["tree decomposition","tdlib","graph theory","fpt","passagemath","combinatorics"],"install":[{"cmd":"pip install passagemath-tdlib","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for graph objects and heavy sage integration","package":"passagemath-sage","optional":false},{"reason":"Core passagemath library required","package":"passagemath-standard","optional":false}],"imports":[{"note":"Older sage pattern may not include the tdlib wrapper.","wrong":"from sage.graphs.tree_decomposition import TreeDecomposition","symbol":"TreeDecomposition","correct":"from passagemath.tdlib.tree_decomposition import TreeDecomposition"},{"note":"Direct access to tdlib wrapper function.","symbol":"tdlib_heuristic_decomposition","correct":"from passagemath.tdlib.tdlib import tdlib_heuristic_decomposition"}],"quickstart":{"code":"from passagemath.graphs.graph import Graph\nfrom passagemath.tdlib.tree_decomposition import TreeDecomposition\n\n# Create a simple graph (3-cycle)\nG = Graph([(0,1), (1,2), (2,0)])\n\n# Compute a tree decomposition using a heuristic\ntd = TreeDecomposition(G, algorithm='tdlib_heuristic')\nprint(td)\nprint(td.width())","lang":"python","description":"Basic usage: create a graph and compute a tree decomposition via tdlib heuristic."},"warnings":[{"fix":"Use `pip install passagemath` to get a compatible environment.","message":"The passagemath ecosystem (10.x) is not compatible with SageMath 9.x/10.0. Install the correct passagemath metapackage.","severity":"breaking","affected_versions":">=10.0"},{"fix":"Use Python 3.11–3.14.","message":"Requires Python >=3.11 and <3.15. Older Python versions are not supported.","severity":"breaking","affected_versions":"10.8.4"},{"fix":"Install tdlib via system package manager (e.g., `apt install libtdlib-dev`) or compile from source.","message":"tdlib must be installed separately: it is a C++ library not bundled with the Python package. The Python wrapper will not work without it.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install passagemath-tdlib` or `pip install passagemath[tdlib]` which pulls all dependencies.","cause":"The passagemath base package is not installed.","error":"ModuleNotFoundError: No module named 'passagemath'"},{"fix":"Install tdlib: `apt install libtdlib-dev` (Linux, Debian/Ubuntu) or follow the official tdlib build instructions.","cause":"The external tdlib C++ library is missing.","error":"RuntimeError: tdlib library not found. Ensure tdlib is installed on your system."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}