Implement the WeightedGraph protocol for adjacency list based graphs