A package to read linear optimization problems in fixed MPS format and quadratic optimization problems in QPS format.
The problems represented by the QPS format have the form
optimize c₀ + cᵀ x + ½ xᵀ Q x subject to L ≤ Ax ≤ U and ℓ ≤ x ≤ u,
where "optimize" means either "minimize" or "maximize", c₀ ∈ ℝ is a constant term, c ∈ ℝⁿ is the linear term, Q = Qᵀ is the n×n positive semi-definite quadratic term, L is the vector of lower constraint bounds, A is the constraint matrix, U is the vector of upper constraint bounds, ℓ is the vector of lower bounds, and u is the vector of upper bounds.
Only continuous problems are supported at this time. Problems with binary, integer or semi-continuous variables are not supported.
This package exports the QPSData
data type and the readqps()
function.
Because MPS is a subset of QPS, the readqps()
function accepts both formats.
Because the SIF is a superset of QPS, QPS problems implemented as SIF files (such as those from the Maros-Meszaros collection) are also supported.
julia> qp = readqps("Q25FV47.QPS")
The QPSData
data type is defined as follows:
mutable struct QPSData
nvar::Int # number of variables
ncon::Int # number of constraints
objsense::Symbol # :min, :max or :notset
c0::Float64 # constant term in objective
c::Vector{Float64} # linear term in objective
Q::SparseMatrixCSC{Float64,Int} # quadratic term in objective
A::SparseMatrixCSC{Float64,Int} # constraint matrix
lcon::Vector{Float64} # constraints lower bounds
ucon::Vector{Float64} # constraints upper bounds
lvar::Vector{Float64} # variables lower bounds
uvar::Vector{Float64} # variables upper bounds
name::String # problem name
objname::String # objective function name
varnames::Vector{String} # variable names, aka column names
connames::Vector{String} # constraint names, aka row names
end
The matrix Q is zero when reading an MPS file.
- The Netlib LPs: original Netlib site | in SIF format | as tar files (incl. preprocessed versions)
- the Kennington LPs: original Netlib site
- infeasible Netlib LPs: original Netlib site
- the Maros-Meszaros QPs: in QPS format | in SIF format
- the MPS file format is described at http://lpsolve.sourceforge.net/5.5/mps-format.htm
- the QPS extension is described in https://doi.org/10.1080/10556789908805768