Add weight of edge method