Skip to content

Comments

[DO NOT MERGE] Clique Table and Preprocessing#627

Open
akifcorduk wants to merge 84 commits intoNVIDIA:mainfrom
akifcorduk:cliques
Open

[DO NOT MERGE] Clique Table and Preprocessing#627
akifcorduk wants to merge 84 commits intoNVIDIA:mainfrom
akifcorduk:cliques

Conversation

@akifcorduk
Copy link
Contributor

@akifcorduk akifcorduk commented Nov 25, 2025

This PR implements the first part of the paper from the paper: Preprocessing and Cutting Planes with Conflict Graphs.
This part contains only the preprocessing parts and clique cuts will follow in a separate PR:

  • Clique detection by converting constraints into sorted knapsack constraints. This allows fast clique detection.
  • Additional cliques in the same constraint by utilizing sorting structures.
  • Clique extension/merging across the conflict graph.
  • Clique covering and problem modification.

The data structures and query functions are implemented and will be used as a basis for clique cuts and usage in heuristics.

Benchmark results: there is little to no change in benchmarks. This PR is a basis for the clique cuts PR.

Summary by CodeRabbit

  • New Features

    • Automatic clique detection and injection into MIP presolve to improve preprocessing.
    • Host-to-solver constraint sync allowing external problem updates to be applied before solving.
  • Improvements

    • Presolve now respects a time cap to bound preprocessing work.
    • Improved constraint handling and propagation during solution setup.
    • Local search initialization refined for more reliable first-run behavior.

@akifcorduk akifcorduk added this to the 26.02 milestone Nov 25, 2025
@akifcorduk akifcorduk added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Nov 25, 2025
@copy-pr-bot
Copy link

copy-pr-bot bot commented Nov 25, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a clique-based presolve subsystem and integrates it into the MIP pipeline, extends CSR sparse-matrix API, exposes a new problem setter for host-derived constraints, adjusts build files, and updates presolve/solver/local-search flows and comments.

Changes

Cohort / File(s) Summary
Build Configuration
cpp/CMakeLists.txt, cpp/src/mip/CMakeLists.txt
Updated solve_MIP include directories (PRIVATE src, PUBLIC BUILD_INTERFACE include) and added clique_table.cu to non-LP build list.
Clique Infrastructure
cpp/src/mip/presolve/conflict_graph/clique_table.cuh, cpp/src/mip/presolve/conflict_graph/clique_table.cu
New templated clique table/types and extensive algorithms for extracting, extending, pruning, and inserting cliques from knapsack-like constraints; explicit instantiations for float/double.
Sparse Matrix API
cpp/src/dual_simplex/sparse_matrix.hpp, cpp/src/dual_simplex/sparse_matrix.cpp
Added csr_matrix_t::get_constraint_range() and insert_row() overloads; added CSC→CSR scatter helper; fixed comment typo and updated copyright year.
Presolve / Diversity Integration
cpp/src/mip/diversity/diversity_manager.cu
Hooked initial-clique finding into run_presolve: construct host_problem, compute initial cliques, update host constraints via set_constraints_from_host_user_problem, reorder/gate bounds updates and trivial presolve.
Probing Cache / Comments
cpp/src/mip/presolve/probing_cache.cu, cpp/src/mip/presolve/probing_cache.cuh
Added unordered_set include; added explanatory comments about probing cache behavior (no API/behavioral changes).
Problem Representation
cpp/src/mip/problem/problem.cuh, cpp/src/mip/problem/problem.cu
Added problem_t::set_constraints_from_host_user_problem(...) to populate device CSR, rhs, bounds, range handling, names, and variable types from a host user_problem; resize_constraints now preserves/initializes prev_dual elements. (Note: duplicate definition observed in cu file.)
Solver Integration
cpp/src/mip/solver.cu
Introduced presolve time cap (min(10% remaining, 60s)) and call to context.problem_ptr->set_constraints_from_host_user_problem(branch_and_bound_problem) before branch-and-bound setup.
Local Search Initialization
cpp/src/mip/local_search/local_search.cu
On first run, initialize in_fj.cstr_weights to constraint count and fill with 1.0.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The PR title '[DO NOT MERGE] Clique Table and Preprocessing' uses the '[DO NOT MERGE]' prefix, which is a strong indicator of work-in-progress status and is not appropriate for a production-ready changeset. Remove '[DO NOT MERGE]' prefix and revise the title to clearly describe the main change, such as 'Add clique table and preprocessing for conflict graph' or similar, once the PR is ready for merge.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@rg20
Copy link
Contributor

rg20 commented Jan 22, 2026

@akifcorduk is this still relevant?

@rgsl888prabhu rgsl888prabhu changed the base branch from main to release/26.02 January 22, 2026 16:48
@akifcorduk akifcorduk marked this pull request as ready for review January 29, 2026 11:59
@akifcorduk akifcorduk requested review from a team as code owners January 29, 2026 11:59
@akifcorduk akifcorduk changed the title Clique Table and Preprocessing [DO NOT MERGE] Clique Table and Preprocessing Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants