__contains__ method added. It checks if a given node or edge is in the graph.