Skip to content

Commit

Permalink
More optimizatoin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Sadykov authored and Ruslan Sadykov committed Oct 4, 2021
1 parent fc2e34d commit aefae7e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Algorithm/branching/varbranching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,17 @@ function run!(
return BranchingRuleOutput(local_id, BranchingGroup[])
end

selected_vars = Pair{VarId, Float64}[]
groups = BranchingGroup[]
for (var_id, val) in input.solution
getperenkind(master, var_id) == Continuous && continue
if !isinteger(val, input.int_tol) && getbranchingpriority(master, var_id) == max_priority
push!(selected_vars, Pair{VarId, Float64}(var_id, val))
#description string is just the variable name
candidate = VarBranchingCandidate(getname(master, var_id), var_id)
local_id += 1
push!(groups, BranchingGroup(candidate, local_id, val))
end
end

groups = BranchingGroup[]
for (var_id, val) in selected_vars
#description string is just the variable name
candidate = VarBranchingCandidate(getname(master, var_id), var_id)
local_id += 1
push!(groups, BranchingGroup(candidate, local_id, val))
end

if input.criterion == FirstFoundCriterion
sort!(groups, by = x -> x.local_id)
elseif input.criterion == MostFractionalCriterion
Expand Down

0 comments on commit aefae7e

Please sign in to comment.