add weighted edges and data