Returns a simplified dictionary representing the Graph.

    Returns:
      A dictionary that can easily be serialized to JSON.

def to_dict(self):
    """Returns a simplified dictionary representing the Graph.

    Returns:
      A dictionary that can easily be serialized to JSON.
    """
    return {
        "node": [v.to_dict() for v in self.vertices],
        "edge": [e.to_dict() for e in self.edges]
    }