max flow and closet pairs