Skip to content

Conversation

@Lhongpei
Copy link

🚀 Summary of Changes

This pull request introduces support for Quadratic Constraints (QC) in the .QPS/.mps file format, extending the package's capability from Quadratic Programming (QP) to Quadratically Constrained Quadratic Programming (QCQP).

This enhancement allows users to define constraints of the form $L_i \le a_i^\top x + x^\top Q_i x \le U_i$.

✨ Key Features and Updates

  • QCQP Support: The core problem representation has been updated to include quadratic constraints.
  • New Data Structure: QPSData now includes the qcdata field (Dict{Int, Tuple{Vector{Int}, Vector{Int}, Vector{Float64}}}) to store the constraint-specific quadratic terms ($Q_i$).
  • QCMATRIX Section Parsing: Implements logic to correctly identify and parse data within the new QCMATRIX section header in the .QPS/.mps file.
  • Documentation Update: The README.md has been revised to reflect the new, more general problem format (including $Q_0$ for the objective and $Q_i$ for constraints).

📖 Updated Problem Format (README.md)

The problem format now officially supported is:

$$\text{optimize} \quad c_0 + c^\top x + \frac{1}{2} x^\top Q_0 x$$ $$\text{subject to} \quad L_i \le a_i^\top x + x^\top Q_i x \le U_i \quad \text{and} \quad \ell \le x \le u$$

🛠️ Implementation Details

  • src/readqps.jl:
    • Added const QCMATRIX = 11 to section headers.
    • Updated read_card! to recognize and handle the QCMATRIX section, which requires a row name (card.f2).
    • Implemented read_qcmatrix_line! to process the variable indices and values for the quadratic constraint matrix $Q_i$ based on the current constraint index (current_qc_row_idx).
    • Modified readqps to track current_qc_row_idx and handle the initialization and processing of the QCMATRIX section.

This change significantly broadens the class of optimization problems that can be read by QPSReader.jl.

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.

1 participant