Skip to content
Merged
Changes from 1 commit
Commits
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
4 changes: 2 additions & 2 deletions ext/SIAJuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ScaleInvariantAnalysis.symcover_lmin(A)
model = JuMP.Model(HiGHS.Optimizer)
JuMP.set_silent(model)
@variable(model, α[1:n])
@objective(model, Min, sum(α[i] + α[j] - logA[i, j] for i in 1:n, j in 1:n if A[i, j] != 0))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You're right this is a good simplification (although it's the constraints that make it slow), but we need to handle the case where A has zeros. I think precomputing sum(iszero, A; dims=1 or 2) might enable this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we're need both. It would be somewhat surprising to me if going from an O(mn) to O(m+n) size objective didn't speed things up a bit.

@objective(model, Min, sum(α))
for i in 1:n
for j in i:n
if A[i, j] != 0
Expand Down Expand Up @@ -74,7 +74,7 @@ function ScaleInvariantAnalysis.cover_lmin(A)
JuMP.set_silent(model)
@variable(model, α[1:m])
@variable(model, β[1:n])
@objective(model, Min, sum(α[i] + β[j] - logA[i, j] for i in 1:m, j in 1:n if A[i, j] != 0))
@objective(model, Min, sum(α) + sum(β))
for i in 1:m
for j in 1:n
if A[i, j] != 0
Expand Down
Loading