Modigying kargers min cut python file