You cannot create a JuMP variable with duplicate indices. See, e.g.,
model = Model()
@variable(model, x[[:a, :a, :b]])
x[:a] # Which `:a` is this referring to?
As I said in the other post, you probably intend
model = Model()
@variable(model, v[1:size(branch, 1)])
v[3] # Corresponds to (4, 5, 0.2)
p.s. Please don’t open multiple posts with the same question: Help me with indexing - #4 by varun_yaramasu. It can lead to the answers being split over multiple posts.