MathOptInterface.jl
MathOptInterface.jl copied to clipboard
Add support for starting values in bridges
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 |
Another missing one is square to triangular PSD matrices: https://github.com/jump-dev/MathOptInterface.jl/issues/1730
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 |
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"
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"
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.
@blegat are you ready to close this?
There are still a few missing
Sure. But are they useful? We have an error message telling people to open an issue, and no one has :smile:
I think we're good, these are not the only attributes not implemented by bridges