Weighted graphs and path length