WeightedEdge class