I have a flow network with gains. In practical terms, a gain is the opposite of a cost. So, I interested in finding the maximal gain of a network flow, what could be interpreted as finding a maximum flow at the maximum cost (or gain).

I'm planning to solve this problem by negating the arc costs and then to compute the maximum flow at the minimum cost.

So, my question concerns to prove or refute if this technique is valid; that is if the negated result of minimum cost after solving the max-flow/min-cost on the transformed network corresponds to the minimum cost. I would use a cancel cycle algorithm.

Thanks in advance for any help