Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDP relaxation with constraint decomposition #333

Merged
merged 33 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cff5cf0
working SDP decomposition
kersulis Jul 17, 2018
27f1f1d
better file name
kersulis Jul 17, 2018
c3a438d
doc cleanup
kersulis Jul 18, 2018
b87d598
no need to overwrite existing type definition
kersulis Jul 18, 2018
fb86fa8
add tests (apply existing SDP tests to SDPDecompForm)
kersulis Jul 18, 2018
79f141f
move SDP decomp code into wrm.jl
kersulis Jul 18, 2018
628346c
'clique grouping' is more appropriate than 'partition'
kersulis Jul 18, 2018
51dd91b
working clique merge
kersulis Jul 23, 2018
c20032a
explicit generation of voltage vars and linking constraints
kersulis Jul 25, 2018
ccc80f9
minor changes
kersulis Jul 25, 2018
4b1f474
tests
kersulis Jul 25, 2018
2e09181
I think this was a typo
kersulis Jul 25, 2018
c69762a
Okay to add to .gitignore?
kersulis Jul 25, 2018
8672e21
proper test for passing external decomp
kersulis Jul 25, 2018
9c6ee63
Stop merging after specified number of merges
kersulis Jul 30, 2018
52220d5
Move voltage product bound calc out of loop
kersulis Jul 31, 2018
45867ac
SDPDecompSOCForm: replace 2-clique SD constraints with SOC
kersulis Jul 31, 2018
ea215c1
move constraint decomp into struct to keep pm.ext clean
kersulis Aug 5, 2018
9fedcfd
No more infeasible cases! Fixes kersulis#1
kersulis Aug 10, 2018
cdd0ce4
Keep only the best decomp implementation, fixes kersulis#2
kersulis Aug 10, 2018
fb96b96
bools and ints, not ints and floats
kersulis Aug 10, 2018
3b37704
Merge branch 'master' into sdp_decomposition
kersulis Aug 10, 2018
1c3fdea
Broaden signatures for variable_voltage and constraint_voltage
kersulis Aug 14, 2018
4925338
Store graph ordering (suff. to reconstruct minimal chordal ext, cliques)
kersulis Aug 15, 2018
e2b7ed5
Merge branch 'master' into sdp_decomposition
ccoffrin Aug 16, 2018
3578565
fixing missing SDPDecompForm
ccoffrin Aug 16, 2018
a82b40e
Do not store full adjacency matrix
kersulis Aug 20, 2018
063c589
There's an issue with the SOC constraints for 2-cliques. Commenting out
kersulis Aug 22, 2018
aed39e6
Fixed the SOC constraints for 2-vertex cliques.
kersulis Aug 22, 2018
3339801
Missing minus sign (though it didn't seem to make a difference)
kersulis Aug 22, 2018
d276cd7
Merge branch 'master' into sdp_decomposition
ccoffrin Sep 4, 2018
0f1066e
avoid unicode
kersulis Sep 4, 2018
098a568
comment out case6 in sdp decomp tests
ccoffrin Sep 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/form/wrm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ const SDPDecompPowerModel = GenericPowerModel{SDPDecompForm}
struct SDconstraintDecomposition
"Each sub-vector consists of bus IDs corresponding to a clique grouping"
decomp::Vector{Vector{Int64}}
"Adjacency matrix of chordal graph extension"
cadj::SparseMatrixCSC{Int64, Int64}
"`lookup_index[bus_id] --> idx` for mapping between 1:n and bus indices"
lookup_index::Dict
"A chordal extension and maximal cliques are uniquely determined by a graph ordering"
Expand Down Expand Up @@ -148,7 +146,7 @@ function variable_voltage(pm::GenericPowerModel{SDPDecompForm}; nw::Int=pm.cnw,
groups = maximal_cliques(cadj)
lookup_bus_index = map(reverse, lookup_index)
groups = [[lookup_bus_index[gi] for gi in g] for g in groups]
pm.ext[:SDconstraintDecomposition] = SDconstraintDecomposition(groups, cadj, lookup_index, ordering)
pm.ext[:SDconstraintDecomposition] = SDconstraintDecomposition(groups, lookup_index, ordering)
end

voltage_product_groups =
Expand Down Expand Up @@ -256,9 +254,11 @@ function constraint_voltage(pm::GenericPowerModel{SDPDecompForm}, nw::Int, cnd::
wr_jj = WR[2, 2]
wr_ij = WR[1, 2]
wi_ij = WI[1, 2]
wi_ji = WI[2, 1]

# standard SOC form (Mosek doesn't like rotated form)
@constraint(pm.model, (wr_ii + wr_jj)/2 >= norm([(wr_ii - wr_jj)/2; wr_ij; wi_ij]))
@constraint(pm.model, (wr_ii + wr_jj) >= norm([(wr_ii - wr_jj); 2*wr_ij; 2*wi_ij]))
@constraint(pm.model, wi_ij == -wi_ji)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, in my past experience adding this symmetry constraint was causing some numerical issues in the solvers.

else
@SDconstraint(pm.model, [WR WI; -WI WR] >= 0)
end
Expand Down
4 changes: 2 additions & 2 deletions test/opf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,13 @@ end
data = PMs.parse_file("../test/data/matpower/case14.m")
pm = GenericPowerModel(data, SDPDecompForm)

cadj, lookup_index = PMs.chordal_extension(pm)
cadj, lookup_index, σ = PMs.chordal_extension(pm)
cliques = PMs.maximal_cliques(cadj)
lookup_bus_index = map(reverse, lookup_index)
groups = [[lookup_bus_index[gi] for gi in g] for g in cliques]
@test PMs.problem_size(groups) == 344

pm.ext[:SDconstraintDecomposition] = PMs.SDconstraintDecomposition(groups, cadj, lookup_index)
pm.ext[:SDconstraintDecomposition] = PMs.SDconstraintDecomposition(groups, lookup_index, σ)

PMs.post_opf(pm)
result = solve_generic_model(pm, scs_solver; solution_builder=PMs.get_solution)
Expand Down