diff --git a/Project.toml b/Project.toml index 2815cf7..bd748a7 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/spanning_tree.jl b/src/spanning_tree.jl index e5423d3..49dc269 100644 --- a/src/spanning_tree.jl +++ b/src/spanning_tree.jl @@ -18,13 +18,9 @@ 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) @@ -32,6 +28,7 @@ function FrankWolfe.compute_extreme_point( for i in 1:N if (src(edge) == src(iter[i]) && dst(edge) == dst(iter[i])) v[i] = 1 + break end end end