Adding check that edge weight is numeric