MathOptInterface.jl icon indicating copy to clipboard operation
MathOptInterface.jl copied to clipboard

Add support for starting values in bridges

Open blegat opened this issue 6 years ago • 7 comments

Updated list

Constraint Bridge ConstraintPrimal ConstraintDual
GreaterToIntervalBridge x x
LessToIntervalBridge x x
GreaterToLessBridge x x
LessToGreaterBridge x x
NonnegToNonposBridge x x
NonposToNonnegBridge x x
VectorizeBridge x x
ScalarizeBridge x x
ScalarSlackBridge x x
VectorSlackBridge x x
ScalarFunctionizeBridge x x
VectorFunctionizeBridge x x
SplitComplexEqualToBridge x x
SplitComplexZerosBridge x x
SplitIntervalBridge x x
SOCtoRSOCBridge x x
RSOCtoSOCBridge x x
SOCtoNonConvexQuadBridge NA NA
RSOCtoNonConvexQuadBridge NA NA
QuadtoSOCBridge NA NA
SOCtoPSDBridge
RSOCtoPSDBridge
NormInfinityBridge x x
NormOneBridge x x
GeoMeantoRelEntrBridge x x
GeoMeanBridge
RelativeEntropyBridge x x
NormSpectralBridge
NormNuclearBridge x x
SquareBridge
RootDetBridge
LogDetBridge x x
IndicatorActiveOnFalseBridge NA NA
IndicatorSOS1Bridge NA NA
SemiToBinaryBridge NA NA
ZeroOneBridge NA NA
AllDifferentToCountDistinctBridge NA NA
BinPackingToMILPBridge NA NA
CircuitToMILPBridge NA NA
CountAtLeastToCountBelongsBridge NA NA
CountBelongsToMILPBridge NA NA
CountDistinctToMILPBridge NA NA
CountGreaterThanToMILPBridge NA NA
TableToMILPBridge NA NA
Variable Bridge VariablePrimal ConstraintPrimal ConstraintDual
FreeBridge x
NonposToNonnegBridge x
RSOCtoPSDBridge
RSOCtoSOCBridge
SOCtoRSOCBridge
VectorizeBridge x
ZerosBridge

blegat avatar Mar 04 '19 11:03 blegat

Another missing one is square to triangular PSD matrices: https://github.com/jump-dev/MathOptInterface.jl/issues/1730

odow avatar Feb 04 '22 20:02 odow

Updated list

Bridge Constraint Primal Constraint Dual
GreaterToIntervalBridge x x
LessToIntervalBridge x x
GreaterToLessBridge x x
LessToGreaterBridge x x
NonnegToNonposBridge x x
NonposToNonnegBridge x x
VectorizeBridge x x
ScalarizeBridge x x
ScalarSlackBridge x x
VectorSlackBridge x x
ScalarFunctionizeBridge x x
VectorFunctionizeBridge x x
SplitComplexEqualToBridge x x
SplitComplexZerosBridge x x
SplitIntervalBridge x x
SOCtoRSOCBridge
RSOCtoSOCBridge
SOCtoNonConvexQuadBridge
RSOCtoNonConvexQuadBridge
QuadtoSOCBridge
SOCtoPSDBridge
RSOCtoPSDBridge
NormInfinityBridge x x
NormOneBridge x x
GeoMeantoRelEntrBridge x x
GeoMeanBridge
RelativeEntropyBridge x x
NormSpectralBridge
NormNuclearBridge x x
SquareBridge
RootDetBridge
LogDetBridge x x
IndicatorActiveOnFalseBridge NA NA
IndicatorSOS1Bridge NA NA
SemiToBinaryBridge NA NA
ZeroOneBridge NA NA
AllDifferentToCountDistinctBridge NA NA
BinPackingToMILPBridge NA NA
CircuitToMILPBridge NA NA
CountAtLeastToCountBelongsBridge NA NA
CountBelongsToMILPBridge NA NA
CountDistinctToMILPBridge NA NA
CountGreaterThanToMILPBridge NA NA
TableToMILPBridge NA NA
Bridge VariablePrimal ConstraintPrimal ConstraintDual
FreeBridge x
NonposToNonnegBridge x
RSOCtoPSDBridge
RSOCtoSOCBridge
SOCtoRSOCBridge
VectorizeBridge x
ZerosBridge

odow avatar Jul 25 '22 21:07 odow

function get_unsupported_bridges()
    dict = Dict{String,Vector{String}}()
    for attr in ("VariablePrimalStart", "ConstraintPrimalStart", "ConstraintDualStart")
        ret = String[]
        for t in ("Constraint", "Objective", "Variable")
            dir = "src/Bridges/$t/bridges"
            for file in readdir(dir)
                filename = joinpath(dir, file)
                contents = read(filename, String)
                if occursin("SetMapBridge", contents)
                    continue
                end
                if !occursin("::MOI.$attr", contents)
                    push!(ret, filename)
                end
            end
        end
        dict[attr] = ret
    end
    return dict
end
dict = get_unsupported_bridges()

Then with a bit of manual culling, I thing we can get things down to:

julia> dict["ConstraintPrimalStart"]
31-element Vector{String}:
 "src/Bridges/Constraint/bridges/det.jl"
 "src/Bridges/Constraint/bridges/geomean.jl"
 "src/Bridges/Constraint/bridges/norm_to_power.jl"
 "src/Bridges/Constraint/bridges/number_conversion.jl"
 "src/Bridges/Constraint/bridges/soc_to_nonconvex_quad.jl"
 "src/Bridges/Constraint/bridges/square.jl"

julia> dict["ConstraintDualStart"]
33-element Vector{String}:
 "src/Bridges/Constraint/bridges/det.jl"
 "src/Bridges/Constraint/bridges/geomean.jl"
 "src/Bridges/Constraint/bridges/norm_to_power.jl"
 "src/Bridges/Constraint/bridges/number_conversion.jl"
 "src/Bridges/Constraint/bridges/soc_to_nonconvex_quad.jl"
 "src/Bridges/Constraint/bridges/square.jl"

julia> dict["VariablePrimalStart"]
44-element Vector{String}:
 "src/Bridges/Variable/bridges/parameter.jl"
 "src/Bridges/Variable/bridges/rsoc_to_psd.jl"

odow avatar Nov 02 '23 00:11 odow

With the latest PRs (and excluding src/Bridges/Constraint/bridges/soc_to_nonconvex_quad.jl), we're down to

julia> dict["ConstraintPrimalStart"]
31-element Vector{String}:
 "src/Bridges/Constraint/bridges/det.jl"
 "src/Bridges/Constraint/bridges/geomean.jl"
 "src/Bridges/Constraint/bridges/norm_to_power.jl"

julia> dict["ConstraintDualStart"]
33-element Vector{String}:
 "src/Bridges/Constraint/bridges/det.jl"
 "src/Bridges/Constraint/bridges/geomean.jl"
 "src/Bridges/Constraint/bridges/norm_to_power.jl"

odow avatar Nov 02 '23 22:11 odow

But actually, the LogDet bridge does support starting values. And the geo-mean and norm bridge are niche enough that there isn't a big drive. They're also slightly complicated to work out the duals for?

So maybe this issue can be closed. There's still the unresolved https://github.com/jump-dev/MathOptInterface.jl/issues/2117.

And since there's a better error message telling people to open an issue if they hit a case that isn't implemented, we can re-open if there is demand.

odow avatar Nov 02 '23 22:11 odow

@blegat are you ready to close this?

odow avatar Dec 21 '23 20:12 odow

There are still a few missing

blegat avatar Dec 21 '23 20:12 blegat

Sure. But are they useful? We have an error message telling people to open an issue, and no one has :smile:

odow avatar Apr 10 '24 02:04 odow

I think we're good, these are not the only attributes not implemented by bridges

blegat avatar Apr 10 '24 06:04 blegat