Skip to content

Inconsistent error message for chebyshevcenter with different solvers #352

@schillic

Description

@schillic

The following code throws an informative error message:

function foo(N, solver)
    A, b = Matrix{N}(undef, 0, 1), N[]
    backend = Polyhedra.IntervalLibrary{N}()
    Q = Polyhedra.polyhedron(Polyhedra.hrep(A, b), backend)
    Polyhedra.chebyshevcenter(Q, solver)
end

julia> solver = LazySets.default_lp_solver_polyhedra(eltype(P); presolve=true);
julia> foo(Float64, solver)

ERROR: The polyhedron contains euclidean ball of arbitrary large radius.

For an exact solver, the analogous code throws a different error message:

julia> solver = JuMP.optimizer_with_attributes(() -> GLPK.Optimizer(; method=GLPK.EXACT));
julia> foo(Rational{Int}, solver)

glp_exact: problem has no rows/columns
ERROR: Solver returned `INVALID_MODEL` when computing the H-Chebyshev center. Solver specific status: The problem instance has no rows/columns.

The reason for this difference is that the first example results in the solver status MOI.DUAL_INFEASIBLE, while the second example results in the solver status INVALID_MODEL.

if term [MOI.OPTIMAL, MOI.LOCALLY_SOLVED]
if term == MOI.INFEASIBLE
error("An empty polyhedron has no H-Chebyshev center.")
elseif term == MOI.DUAL_INFEASIBLE
error("The polyhedron contains euclidean ball of arbitrary large radius.")
else
_unknown_status(model, term, "computing the H-Chebyshev center.")
end

This is really a minor issue, but I thought I should still report it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions