Max Cut Problem Cost Function