Add network variables, find max I and max J