{"id":24207,"library":"passagemath-mcqd","title":"passagemath-mcqd","description":"The passagemath-mcqd library provides a Python interface to the MCQD algorithm for finding maximum cliques in undirected graphs. It is part of the passagemath ecosystem and currently at version 10.8.4, supporting Python 3.11 through 3.14. Release cadence is tied to the parent passagemath project.","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath","tags":["maximum clique","mcqd","graph theory","sage"],"install":[{"cmd":"pip install passagemath-mcqd","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Core library for graph classes and algorithms","package":"passagemath","optional":false}],"imports":[{"note":"The correct import is through the SageMath graph module.","wrong":"from passagemath.mcqd import mcqd","symbol":"mcqd","correct":"from sage.graphs.cliquer import mcqd"}],"quickstart":{"code":"import os\nfrom sage.graphs.cliquer import mcqd\nimport sage.graphs.graph as graph\n\nG = graph.Graph([(0,1),(1,2),(2,0),(0,3)])\nclique = mcqd(G)\nprint('Maximum clique:', clique)","lang":"python","description":"Find a maximum clique in a small graph."},"warnings":[{"fix":"Convert your graph using Graph(nx_graph) from sage.graphs.graph.","message":"The mcqd function expects a Sage Graph object, not a NetworkX graph or other structure.","severity":"gotcha","affected_versions":"all"},{"fix":"Use G.vertices() to map indices back to labels: [G.vertices()[i] for i in mcqd(G)].","message":"The function returns a list of vertex indices, not vertex labels. The indices correspond to the internal order of vertices in the graph.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from sage.graphs.cliquer import mcqd'.","message":"The function is imported from sage.graphs.cliquer, not from any passagemath-specific module. The passagemath-mcqd package installs the necessary binaries but the import path remains the Sage one.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from sage.graphs.cliquer import mcqd'","cause":"Incorrect import path. The mcqd function is not directly in passagemath.mcqd; it is accessed via Sage's graph module.","error":"ImportError: cannot import name 'mcqd' from 'passagemath.mcqd'"},{"fix":"Call mcqd(G) where G is a sage.graphs.graph.Graph.","cause":"The function requires a Sage Graph object as argument. No default graph.","error":"TypeError: mcqd() takes exactly one argument (0 given)"},{"fix":"mcqd returns a list of indices. Use G.vertices() to map to labels.","cause":"Assuming mcqd returns a graph object instead of a list of vertex indices.","error":"AttributeError: 'list' object has no attribute 'vertices'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}