Hi there! I’m trying to write a flow conservation constrains. Yet it says key not found

# this is the constraint I'd like to write (and α(i,j) is a binary variable and A1 is a subset of nodes)
∑ᵢ α[i,j] = ∑ₖ α[j,k] ∀ j ∈ A1 # flow conservation on all nodes belong to A1

Hi @Takashy! In order to make it easier to help you, please read the advice below. In particular, a reproducible chunk of code would help clarify your problem and look for solutions!

Hi @gdalle Thanks for your advice. I’ve made some change. Basically, there are some arcs in a newtrok and I need to ensure that for a subset of nodes (A1); flow conservation constraints hold.
They require that, for each node in A1, the sum of the flow into the node must be equal to the sum of the flow out of the node.