QPSReader

A reader for MPS and QPS files

https://github.com/juliasmoothoptimizers/qpsreader.jl

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

mps qps qps-format sif

Keywords from Contributors

nlpmodels nonlinear-programming ipopt factorization nonlinear-optimization preconditioner matrices linear-operators linear-maps optimization-tools
Last synced: 6 months ago · JSON representation ·

Repository

A reader for MPS and QPS files

Basic Info
  • Host: GitHub
  • Owner: JuliaSmoothOptimizers
  • License: other
  • Language: Julia
  • Default Branch: main
  • Size: 638 KB
Statistics
  • Stars: 19
  • Watchers: 4
  • Forks: 11
  • Open Issues: 5
  • Releases: 4
Topics
mps qps qps-format sif
Created over 7 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation Zenodo

README.md

QPSReader

A package to read linear optimization problems in MPS format and quadratic optimization problems in QPS format.

DOI CI Build Status codecov.io Documentation/stable Documentation/dev

How to Cite

If you use QPSReader.jl in your work, please cite using the format given in CITATION.bib.

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 quadratic term, * A is the m×n constraint matrix, L, U are constraint lower and upper bounds, respectively * , u are variable lower and upper bounds, respectively

Mixed-integer problems are supported, but semi-continuous and semi-integer variables are not.

Quick start

Installation

julia julia> ] pkg> add QPSReader

Reading a file

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.

Both fixed and free format are supported (see below for format conventions). To read a problem from a file: julia julia> qps = readqps("Q25FV47.QPS") # Free MPS is used by default julia> qps = readqps("Q25FV47.QPS", mpsformat=:fixed) # uses fixed MPS format julia> qps = readqps("Q25FV47.QPS", mpsformat=:free) # uses free MPS format

readqps also accepts an IO object as the first argument.

By default, a number of messages may be logged while reading. Log output can be suppressed as follows: ```julia using QPSReader using Logging

qps = with_logger(Logging.NullLogger()) do readqps("Q25FV47.QPS") end ```

Problem representation

The QPSData data type is defined as follows:

```julia 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

# Quadratic objective, in COO format
qrows::Vector{Int}
qcols::Vector{Int}
qvals::Vector{Float64}

# Constraint matrix, in COO format
arows::Vector{Int}
acols::Vector{Int}
avals::Vector{Float64}

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::Union{Nothing, String}     # problem name
objname::Union{Nothing, String}  # objective function name
rhsname::Union{Nothing, String}  # Name of RHS field
bndname::Union{Nothing, String}  # Name of BOUNDS field
rngname::Union{Nothing, String}  # Name of RANGES field
varnames::Vector{String}         # variable names, aka column names
connames::Vector{String}         # constraint names, aka row names

# name => index mapping for variables
# Variables are indexed from 1 and onwards
varindices::Dict{String, Int}

# name => index mapping for constraints
# Constraints are indexed from 1 and onwards
# Recorded objective function has index 0
# Rim objective rows have index -1
conindices::Dict{String, Int}

# Variable types
#  `VTYPE_Continuous`      <--> continuous
#  `VTYPE_Integer`         <--> integer
#  `VTYPE_Binary`          <--> binary
#  `VTYPE_SemiContinuous`  <--> semi-continuous (not supported)
#  `VTYPE_SemiInteger`     <--> semi-integer (not supported)
vartypes::Vector{VariableType}

# Indicates the sense of each row:
# `RTYPE_Objective`    <--> objective row (`'N'`)
# `RTYPE_EqualTo`      <--> equality constraint (`'E'`)
# `RTYPE_LessThan`     <--> less-than constraint (`'L'`)
# `RTYPE_GreaterThan`  <--> greater-than constraint (`'G'`)
contypes::Vector{RowType}

end ``` Rows and variables are indexed in the order in which they are read. The matrix Q is zero when reading an MPS file.

Conventions

The file formats supported by QPSReader are described here: * MPS file format * QPS extension

The following conventions are enforced:

Rim data

  • Multiple objective rows

    • The first N-type row encountered in the ROWS section is recorded as the objective function, and its name is stored in objname.
    • If an additional N-type row is present, a warning-level log is displayed. Subsequent N-type rows are ignored.
    • Each time a rim objective row is encountered in the COLUMNS or RHS section, the corresponding coefficients are skipped, and an error-level log is displayed.
  • Multiple RHS / Range / Bound fields

    • The second field of the first card in the RHS section determines the name of the right-hand side, which is stored in rhsname. Same goes for the RANGES and BOUNDS sections, with the corresponding names being stored in rngname and bndname, respectively.
    • Any card whose second field does not match the expected name is then ignored. A warning-level log is displayed at the first such occurence.
    • In addition, any line or individual coefficient that is ignored triggers an error-level log.

Variable bounds

  • Default bounds for variables are [0, Inf), to exception of integer variables (see below).
  • If multiple bounds are specified for a given variable, only the most recent bound is recorded.

Integer variables

There are two ways of declaring integer variables:

  • Through markers in the COLUMNS section.
  • By specifying BV, LI or UI bounds in the BOUNDS section
  • The convention for integer variable bounds in as follows: | Marker? | BOUNDS fields | Type | Bounds reported | |:--:|:--:|:--:|:--:| | Yes | - | Integer | [0, 1] | Yes | BV | Binary | [0, 1] | Yes | (LI, l) | Integer | [l, Inf] | Yes | (UI, u) with u≥0 | Integer | [0, u] | Yes | (UI, u) with u<0 | Integer | [-Inf, u] | Yes | (LI, l) + (UI, u) | Integer | [l, u] | No | BV | Binary | [0, 1] | No | (LI, l) | Integer | [l, Inf] | No | (UI, u) with u≥0 | Integer | [0, u] | No | (UI, u) with u<0 | Integer | [-Inf, u] | No | (LI, l) + (UI, u) | Integer | [l, u]

    The LI/UI can be replaced by LO/UP in the table above, with no impact on bounds. Only the integrality of variables are affected. For continuous variables, follow the second half of the table, and replace LI/UI by LO/UP.

Errors

  • A row (resp. column) name that was not declared in the ROWS (resp. COLUMNS) section, appears elsewhere in the file. The only case where an error is not thrown is if said un-declared row or column appears in a rim line that is skipped.
  • An N-type row appears in the RANGES section

Problem Collections

Both the Netlib LP and Maros-Meszaros QP collections are provided as Julia artifacts (requires Julia 1.3). This package exports the fetch_netlib and fetch_mm functions that return the path to the Netlib and Maros-Meszaros collections, repectively ```julia using QPSReader

netlibpath = fetchnetlib() mmpath = fetchmm() ```

Owner

  • Name: JuliaSmoothOptimizers
  • Login: JuliaSmoothOptimizers
  • Kind: organization
  • Location: DOI: 10.5281/zenodo.2655082

Infrastructure and Solvers for Continuous Optimization in Julia

Citation (CITATION.bib)

@Misc{tanneau-orban-qpsreader-2020,
  author = {M. Tanneau and D. Orban and {contributors}},
  title = {{QPSReader.jl}: A Reader for Linear and Quadratic Optimization Problems in {MPS}, {QPS}, and {SIF} Formats},
  month = {December},
  howpublished = {\url{https://github.com/JuliaSmoothOptimizers/QPSReader.jl}},
  year = {2020},
  DOI = {10.5281/zenodo.3996203}
}

GitHub Events

Total
  • Issues event: 1
  • Watch event: 2
  • Delete event: 4
  • Push event: 17
  • Pull request event: 7
  • Create event: 5
Last Year
  • Issues event: 1
  • Watch event: 2
  • Delete event: 4
  • Push event: 17
  • Pull request event: 7
  • Create event: 5

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 68
  • Total Committers: 12
  • Avg Commits per committer: 5.667
  • Development Distribution Score (DDS): 0.632
Top Committers
Name Email Commits
mtanneau m****u@g****m 25
Dominique Orban d****n@g****m 18
JSOBot 6****t@u****m 7
mtanneau 9****u@u****m 4
Abel Soares Siqueira a****a@g****m 4
Monssaf Toukal t****f@g****m 3
Miles Lubin m****n@g****m 2
Egmara e****s@g****m 1
dpo d****o@u****m 1
Julia TagBot 5****t@u****m 1
Geoffroy Leconte g****0@g****m 1
geoffroyleconte 4****e@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 12
  • Total pull requests: 43
  • Average time to close issues: 3 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 6
  • Total pull request authors: 12
  • Average comments per issue: 2.17
  • Average comments per pull request: 2.19
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 1
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 15 days
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • mtanneau (4)
  • dpo (3)
  • mlubin (2)
  • matbesancon (1)
  • JuliaTagBot (1)
Pull Request Authors
  • mtanneau (12)
  • dpo (12)
  • tmigot (4)
  • abelsiqueira (4)
  • JSOBot (3)
  • github-actions[bot] (3)
  • mlubin (2)
  • geoffroyleconte (2)
  • RenanOD (1)
  • amontoison (1)
  • Egmara (1)
  • JuliaTagBot (1)
Top Labels
Issue Labels
good first issue (1) bug (1)
Pull Request Labels
CI (4) formatting (3) automated pr (3) no changelog (3) do not merge (1) enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 181 total
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 4
juliahub.com: QPSReader

A reader for MPS and QPS files

  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 181 Total
Rankings
Dependent repos count: 9.9%
Forks count: 12.5%
Average: 18.0%
Dependent packages count: 23.0%
Stargazers count: 26.7%
Last synced: 7 months ago

Dependencies

.github/workflows/Breakage.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/setup-julia v2 composite
  • thollander/actions-comment-pull-request v2 composite
.github/workflows/Documentation.yml actions
  • actions/checkout v2 composite
  • julia-actions/setup-julia latest composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/format_pr.yml actions
  • actions/checkout v2 composite
  • peter-evans/create-pull-request v3 composite