Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GraphsMatching = "0.2"
Hungarian = "0.7.0"
LinearAlgebra = "1"
MathOptInterface = "1"
julia = "1"
julia = "1.10"

[extras]
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Expand Down
9 changes: 3 additions & 6 deletions src/spanning_tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ function FrankWolfe.compute_extreme_point(
N = length(direction)
iter = collect(Graphs.edges(lmo.graph))
distmx = spzeros(N, N)
min_weight = minimum(direction)
# we add a positive offset for negative weights
# not changing optimal solutions since all trees have the same # of edges
offset = min_weight > 0 ? zero(min_weight) : 1 - min_weight
for idx in 1:N
distmx[src(iter[idx]), dst(iter[idx])] = direction[idx] + offset
distmx[dst(iter[idx]), src(iter[idx])] = direction[idx] + offset
distmx[src(iter[idx]), dst(iter[idx])] = direction[idx]
distmx[dst(iter[idx]), src(iter[idx])] = direction[idx]
end
span = Graphs.kruskal_mst(lmo.graph, distmx)
v = spzeros(N)
for edge in span
for i in 1:N
if (src(edge) == src(iter[i]) && dst(edge) == dst(iter[i]))
v[i] = 1
break
end
end
end
Expand Down