This repository contains Julia code for studying convex relaxations of box-constrained quadratic programming (BoxQP) problems. The project is organized as a small research codebase: it defines several optimization models, runs those models on benchmark instances, stores the numerical results, and produces figures from the recorded data.
At a high level, the workflow is:
- load BoxQP benchmark instances,
- solve them with several relaxations / solver configurations,
- save experiment outputs to CSV-style data files,
- generate plots and performance profiles from those outputs.
The code focuses on box-constrained quadratic programs, where the decision variables are constrained to lie in a box (in this repo, typically 0 <= x <= 1) and the objective is quadratic. These problems can be difficult to solve directly, so the repository compares several relaxation strategies, including:
- the original nonlinear quadratic program,
- an RLT relaxation,
- a DNN / SDP-style relaxation,
- a DNN-SOCP relaxation solved with an iterative cutting-plane style procedure,
- a time-limited SDP variant.
The repository is intentionally simple and centered around a few scripts:
-
Main.jl
Main experiment driver. It reads instance files, calls the models defined inRelaxation Models.jl, times the runs, and writes result tables such asEXP_Original_problem.csv,EXP_RLT_problem.csv,EXP_DNP_problem.csv,EXP_SOCP_problem.csv, andEXP_DNPTimLim_problem.csv. -
Relaxation Models.jl
Core model definitions. This file contains the JuMP implementations of:- the original box-constrained quadratic program,
- the RLT relaxation,
- the doubly-nonnegative / semidefinite relaxation,
- the SOCP-based approximation with iterative constraint generation,
- the time-limited semidefinite relaxation.
-
Plots.jl
Plotting / post-processing script. It reads the saved experiment outputs and generates figures such as solver performance profiles and iteration-process plots. -
Results for Solvers.in
Numerical solver timing data used for the performance-profile plots. -
Records for Iterations.csv
Detailed iteration history for the SOCP-based cutting-plane method, used for the plotting script.
The function QP(...) solves the original box-constrained quadratic program directly using Ipopt.
The repo then constructs lifted relaxations using variables such as x and X, and compares multiple formulations:
- RLT relaxation solved with Mosek,
- DNN / SDP relaxation solved with Mosek,
- SOCP approximation solved with CPLEX.
One of the most important parts of the code is the SOCP-based method. After solving an initial relaxation, it checks the eigenvalues of X - xx'. If the matrix is not sufficiently positive semidefinite, the code adds additional second-order cone constraints derived from the eigenvectors associated with negative eigenvalues, then re-solves the model. This repeats until one of the stopping conditions is reached:
- the minimum eigenvalue is above a tolerance,
- the iteration limit is reached,
- the time limit is reached.
The experimental instances are not fully generated inside this repository. The README in the original project references benchmark data from Prof. Burer's BoxQP instance repository:
sburer/BoxQP_instances: https://github.com/sburer/BoxQP_instances
Main.jl expects those instance files to exist in a relative path like:
./Experiments/BoxQP_instances-master/basic/
There are also commented alternatives in the code for:
./Experiments/BoxQP_instances-master/extended/./Experiments/BoxQP_instances-master/extended2/
The scripts use the following Julia packages and solver interfaces:
JuMPIpoptMosekToolsGurobiCPLEXCSVDataFramesDelimitedFilesLinearAlgebraTickTockBenchmarkProfilesPlotsLazyStack
Some of these rely on commercial solvers, so you may need local solver installations and licenses before running the experiments successfully.
Use Main.jl to run the optimization experiments over the benchmark set and write output files.
Use Plots.jl after the result files are available. It reads the stored data and creates plot PDFs for comparison and iteration analysis.
If you are new to the project, the best reading order is:
- This README for the overall picture.
Relaxation Models.jlto understand the actual mathematical models.Main.jlto see how experiments are run in batch.Plots.jlto understand how the saved results are analyzed.
A few things that could make the repo easier to reproduce and extend in the future:
- adding a
Project.toml/ Julia environment file, - documenting the exact format of the benchmark instance files,
- documenting the schema of the generated CSV outputs,
- parameterizing instance paths and output locations,
- refactoring repeated experiment loops in
Main.jlinto reusable helper functions.
In short, this repository is a research-oriented Julia implementation for comparing convex relaxation approaches for BoxQP instances. If you want to understand the project quickly, focus on:
- the model definitions in
Relaxation Models.jl, - the experiment orchestration in
Main.jl, - the result visualization in
Plots.jl.