added option to constrain edge weights to numeric values