I use Gurobi and Python to make a optimization, but I have an error that Invalid argument to linExpr multiplication.
Here are constraints that I have.
m.addConstr(quicksum (y for j in nodes if (j=='Detroit'or j== 'Denver'))<= (demand for i in range(len(demand)) if (0<=i<=1)), "c0")
m.addConstr(-(quicksum(y for j in nodes if(j=='Boston' or j=='New York' or j=='Seattle'))) == (demand for j in range(len(demand)) if( j>3 and j<=6)), "c2")
m.addConstr(quicksum(y for i in nodes for j in nodes if( j!='Boston' and j!='New York' and j!='Seattle'))<=((1-a for i in range(len(a)) if i<=3)*(k for j in range(len(k)) if j<=3 )*( x for m in nods if(m!='Boston' and m!='New York' and m!='Seattle')) ), "c3" )
m.addConstr((y for i, j in nodes) >=0, "c5")