DSPopt.jl is an interface to a parallel decomposition mixed-integer programming solver DSP.
This package allows users to define block structures in optimization model written in StructJuMP
and solve the block-structured problem using the parallle solver
This package can model and solve (by interfacing
DSP) the following optimization problems:
- Two-stage stochastic (mixed-integer) quadratic constrained programming (TSSP)
- The Wasserstein-based distributionally robust variant of TSSP
- Block-structured (mixed-integer) linear programming
NOTE: You need to install solver DSP first. This package provides an interface only.
] add DSPopt
This is one simple example of
Please find more examples in
./examples particularly for
using MPI using StructJuMP using DSPopt # Comment out this line if you want to run in serial MPI.Init() # Initialize DSPopt.jl with the communicator. DSPopt.parallelize(MPI.COMM_WORLD) xi = [[7,7] [11,11] [13,13]] # create StructuredModel with number of scenarios m = StructuredModel(num_scenarios = 3) @variable(m, 0 <= x[i=1:2] <= 5, Int) @objective(m, Min, -1.5 * x - 4 * x) for s = 1:3 # create a StructuredModel linked to m with id s and probability 1/3 blk = StructuredModel(parent = m, id = s, prob = 1/3) @variable(blk, y[j=1:4], Bin) @objective(blk, Min, -16 * y + 19 * y + 23 * y + 28 * y) @constraint(blk, 2 * y + 3 * y + 4 * y + 5 * y <= xi[1,s] - x) @constraint(blk, 6 * y + y + 3 * y + 2 * y <= xi[2,s] - x) # Quadratic constraints supported from DSP version 2.0.0 or higher @constraint(blk, const_quad, w^2 <= 1600) if s == 1 @constraint(blk, const_quad2, 2 * w^2 + 2 * w^2 <= 400) elseif s == 2 @constraint(blk, const_quad2, 5 * w - w^2 -2 * w^2 >= -100) end end # The Wasserstein ambiguity set of order-2 can be imposed with the size limit of 1.0. DSPopt.set(WassersteinSet, 2, 1.0) status = optimize!(m, is_stochastic = true, # Needs to indicate that the model is a stochastic program. solve_type = DSPopt.DW, # see instances(DSPopt.Methods) for other methods ) # Comment out this line if you want to run in serial MPI.Finalize()
This material is based upon work supported by the U.S. Department of Energy, Office of Science, under contract number DE-AC02-06CH11357.