check that edge weigth is min