Test WeightedGraph implementation for directed weighted graphs