Fix non-weighted graph test