move conversion to int before test for weight equality to not create unneeded oneway edges