added graph cut and unit-test

SG_REF is inside get_factors(), only SG_UNREF needs to be add. It seems SG_REF cannot be added twice.