Avatar for the Jij-Inc user
Jij-Inc
ommx
BlogDocsChangelog

Performance History

Latest Results

openjij: Fix inverted sign in obj function in maximization problems (#600) - When sampling maximization problems with the openjij adapter, the objective function values were being returned negative when they should be positive, and vice versa. - This was due to converting them to minimization problems when generating qubo/hubo, but never converting back before evaluating the results.
main
4 hours ago
ruff format
python-tsp-qubo-bench
2 days ago
Support quadratic objective and constraints in MPS format (#597) This PR implements support for parsing and writing quadratic terms in MPS format using the QUADOBJ and QCMATRIX sections as supported by solvers like Gurobi. ## Problem The original MPS format only supported linear objectives and constraints. However, many modern solvers like Gurobi extend the format with QUADOBJ and QCMATRIX sections to represent quadratic terms. OMMX can represent quadratic functions internally but couldn't parse or write these extended MPS sections. ## Solution ### Parsing Support - Added `QuadObj` and `QcMatrix` cursor states to the MPS parser state machine - Extended the `Mps` struct with `quad_obj` and `quad_constraints` fields to store quadratic terms - Implemented `read_quadobj_field()` for parsing QUADOBJ sections - Implemented `read_qcmatrix_field()` for parsing QCMATRIX sections with proper constraint name handling - Updated header parsing to handle `QCMATRIX constraint_name` format ### Writing Support - Modified `write_col_entry()` to extract linear coefficients from both linear and quadratic functions - Updated `write_rhs()` to handle constant terms from quadratic functions - Added `write_quadobj()` to output QUADOBJ sections for quadratic objective terms - Added `write_qcmatrix()` to output QCMATRIX sections for quadratic constraint terms - Removed degree restrictions that previously blocked quadratic functions ### Conversion Logic - Enhanced `convert_objective()` to build `Quadratic` functions from parsed quadratic terms - Updated `convert_constraints()` to handle quadratic constraint terms with proper negation for >= constraints - Modified `convert_inequality()` to construct quadratic functions when quadratic terms are present ## Example Usage ```rust // Parse MPS with quadratic terms let mps_content = r#" NAME QUADRATIC_DEMO ROWS N OBJ L CON1 COLUMNS X1 OBJ 1 X2 OBJ 2 RHS RHS1 CON1 10 QUADOBJ X1 X1 0.5 X1 X2 1.0 QCMATRIX CON1 X1 X2 0.25 ENDATA "#; let instance = ommx::mps::parse(mps_content.as_bytes())?; assert_eq!(instance.objective().degree(), 2); // Quadratic objective ``` ## Testing Added comprehensive tests covering: - `test_parse_quadobj` - Parsing QUADOBJ sections - `test_parse_qcmatrix` - Parsing QCMATRIX sections - `test_parse_combined_quadratic` - Both sections together - `test_quadratic_mps_roundtrip` - Full roundtrip (parse → write → parse) - Updated existing error tests to verify cubic functions (degree 3) still fail appropriately All 30 MPS tests pass, maintaining full backward compatibility with existing linear MPS files. Fixes #596. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `taskfile.dev` > - Triggering command: `curl -sL REDACTED` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/Jij-Inc/ommx/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT CODING AGENT TIPS --> --- šŸ’” You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: termoshtt <1238153+termoshtt@users.noreply.github.com> Co-authored-by: Toshiki Teramura <toshiki.teramura@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
main
2 days ago

Active Branches

No pull requests foundAs pull requests are created, their performance will appear here.
Ā© 2025 CodSpeed Technology
Home Terms Privacy Docs