Skip to content

Refactor to installable MVC/MIS package with unified solver API - #2

Merged
fgfuchs merged 9 commits into
mainfrom
copilot/quantum-greddy-mvc-review
Aug 29, 2026
Merged

Refactor to installable MVC/MIS package with unified solver API#2
fgfuchs merged 9 commits into
mainfrom
copilot/quantum-greddy-mvc-review

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR converts the repository from script/notebook-first research code into a pip-installable Python package with a stable runtime API. It adds a single class-based interface to solve both Minimum Vertex Cover (MVC) and Maximum Independent Set (MIS), plus focused documentation for usage and method context from the referenced paper.

  • Package standardization

    • Introduces src/ layout and pyproject.toml for packaging and dependency management.
    • Defines runtime, optional (quantum, cplex, all), and dev extras.
    • Exposes a CLI entrypoint: qgmvc-solve.
  • Unified user API (MVC + MIS)

    • Adds QuantumGreedySolver and SolveResult as the public API.
    • Supports one-call solving for problem="mvc" and problem="mis" with consistent input/output contracts.
    • Normalizes graph/weight validation and error handling (node-key matching, non-negative weights, undirected graphs).
  • Problem adapters and reusable internals

    • Extracts classical and quantum logic into internal modules with stable interfaces.
    • Implements MIS as a first-class solve path via complement-of-cover mapping with explicit metadata.
    • Decouples runtime package usage from experiment plotting/SLURM/notebook flows.
  • Algorithm robustness and API hardening

    • Improves quantum cover decoding behavior for undecided beta states and adds feasibility repair to guarantee edge coverage.
    • Aligns Pauli indexing to Qiskit qubit ordering.
    • Clarifies unweighted vs weighted greedy-degree behavior.
  • Documentation and migration clarity

    • Replaces missing root docs with install/quickstart/API/problem overview.
    • Documents what the package solves, high-level method rationale, and paper link.
    • Adds migration guidance from legacy MVC/QGMVC.py / MVC/QGMVC_parallel.py workflows to class-based usage.
import networkx as nx
from quantum_greedy_mvc import QuantumGreedySolver

G = nx.cycle_graph(6)
solver = QuantumGreedySolver(method="greedy_degree")

mvc = solver.solve_mvc(G)   # minimum vertex cover
mis = solver.solve_mis(G)   # maximum independent set

print(mvc.solution, mvc.objective)
print(mis.solution, mis.objective)

Copilot AI and others added 2 commits August 28, 2026 07:30
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Copilot AI and others added 2 commits August 28, 2026 09:02
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Copilot AI and others added 2 commits August 29, 2026 08:07
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
Co-authored-by: fgfuchs <2428162+fgfuchs@users.noreply.github.com>
@fgfuchs
fgfuchs marked this pull request as ready for review August 29, 2026 08:25
@fgfuchs
fgfuchs merged commit 318cc1e into main Aug 29, 2026
1 check failed
@fgfuchs
fgfuchs deleted the copilot/quantum-greddy-mvc-review branch August 29, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants