Sample Max Flow Algorithm