add constraints on net ouflow
fix net outflow in the resolve problem