Skip to content

jalving/Dsp.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 

Repository files navigation

Dsp.jl

Dsp.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 JuMP and solve the block-structured problem using the parallle solver DSP.

Intallation

Pkg.clone("https://github.com/kibaekkim/Dsp.jl")

Example

DSP can read and solve model from JuMP:

using JuMP, Dsp, MPI

# Comment out this line if you want to run in serial
MPI.Init()

xi = [[7,7] [11,11] [13,13]]

# create JuMP.Model with number of blocks
m = Model(3)

@variable(m, 0 <= x[i=1:2] <= 5, Int)
@objective(m, Min, -1.5 * x[1] - 4 * x[2])
for s = 1:3
    # create a JuMP.Model block linked to m with id s and probability 1/3
    blk = Model(m, s, 1/3)
    @variable(blk, y[j=1:4], Bin)
    @objective(blk, Min, -16 * y[1] + 19 * y[2] + 23 * y[3] + 28 * y[4])
    @constraint(blk, 2 * y[1] + 3 * y[2] + 4 * y[3] + 5 * y[4] <= xi[1,s] - x[1])
    @constraint(blk, 6 * y[1] + y[2] + 3 * y[3] + 2 * y[4] <= xi[2,s] - x[2])
end

solve_types = [:Dual, :Benders, :Extensive]
solve(m, solve_type = solve_types[1], param = "myparam.txt")

getobjectivevalue(m)

# Comment out this line if you want to run in serial
MPI.Finalize()

or, it can also read and solve model from SMPS files:

using Dsp

# Assumming we have mysmps.cor, mysmps.tim, and mysmps.sto
readSmps("mysmps")

solve_types = [:Dual, :Benders, :Extensive]
optimize(solve_type = solve_types[1], param = "myparam.txt")

println(getprimobjval())
println(getdualobjval())

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%