Add weight to the graph edges created