added WeightedGraph implementation