Skip to content

Count linear extensions via OrderPolytope volume approximation with optimized HMC oracles#478

Open
ChinmayRout9040895625 wants to merge 2 commits intoGeomScale:developfrom
ChinmayRout9040895625:feature-linear-extensions-orderpolytope
Open

Count linear extensions via OrderPolytope volume approximation with optimized HMC oracles#478
ChinmayRout9040895625 wants to merge 2 commits intoGeomScale:developfrom
ChinmayRout9040895625:feature-linear-extensions-orderpolytope

Conversation

@ChinmayRout9040895625
Copy link
Copy Markdown

Implements a new approximation algorithm for counting linear extensions of partial orders
through volume estimation of order polytopes, using the identity #LE(P) = n! × Vol(OrderPolytope(P)).

(1) Changes

Optimized HMC Boundary Oracles (orderpolytope.h)

  • Added trigonometric_positive_intersect for Gaussian HMC — exploits sparse OrderPolytope
    structure for O(d + num_relations) instead of O(d × m)
  • Added quadratic_positive_intersect (2 overloads) for Exponential HMC
  • Added helper methods: get_positive_quadratic_root, pick_first_intersection_time_with_boundary
  • Fixed MSVC compatibility: added NOMINMAX and _USE_MATH_DEFINES guards

(2) New Files

  • gaussian_hmc_mass_matrix_walk.hpp — HMC walk with general mass matrix via Cholesky decomposition
  • count_linear_extensions.hpp — Clean API for LE counting (3 overloads)
  • examples/count-linear-extensions/ — CLI tool comparing OrderPolytope vs HPolytope, with CMake and sample poset data files
  • test/order_polytope_le_test.cpp — 4 test cases (20 assertions) for oracle validation
  • test/benchmarks_le.cpp — Performance benchmarks across poset sizes and algorithms

- Add S4 class for Spectrahedron representation
- Implement volume computation methods (CB, SOB) with 4 random walk types
- Implement uniform sampling from spectrahedra with RDHR, CDHR, HMC, BILLIARD walks
- Add Rcpp wrappers for volume and sampling computations
- Add helper functions for SDPA file loading and spectrahedron creation
- Add comprehensive test suites for volume and sampling
- Add Roxygen2 documentation for Spectrahedron class and methods

This implements the core functionality for GSOC 2026 proposal: Spectrahedra R interface for volesti package.
Copy link
Copy Markdown
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR.

Could you give more information? What is the volume algorithm you are using and what is the performance gain and with which inputs?

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