distances and similarities as edge weights

Excellent, thank you