@@ -48,12 +48,12 @@ $TYPEDSIGNATURES
4848Create a Solution from a BitVector value.
4949"""
5050function Solution (value:: BitVector , instance:: Instance )
51- graph = instance. graph
51+ (; graph) = instance
5252 nb_tasks = nv (graph)
5353 is_selected = falses (nb_tasks, nb_tasks)
5454 for (i, edge) in enumerate (edges (graph))
5555 if value[i]
56- is_selected[edge . src, edge . dst] = true
56+ is_selected[src (edge), dst (edge) ] = true
5757 end
5858 end
5959
@@ -112,7 +112,7 @@ function solution_from_JuMP_array(x::AbstractArray, graph::AbstractGraph)
112112 sol = falses (ne (graph)) # init
113113
114114 for (a, edge) in enumerate (edges (graph))
115- if x[edge . src, edge . dst] == 1
115+ if x[src (edge), dst (edge)] >= 0.5
116116 sol[a] = true
117117 end
118118 end
@@ -131,8 +131,7 @@ function path_solution_from_JuMP_array(x::AbstractArray, graph::AbstractGraph)
131131 while current_task < nb_tasks
132132 sol[v_index, current_task - 1 ] = true
133133 next_tasks = [
134- i for i in outneighbors (graph, current_task) if
135- isapprox (x[current_task, i], 1 ; atol= 0.1 )
134+ i for i in outneighbors (graph, current_task) if x[current_task, i] >= 0.5
136135 ]
137136 # TODO : there is a more efficient way to search for next task (but more dangerous)
138137 if length (next_tasks) == 1
0 commit comments