corrected condition

min cost graph