<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, key):
 """Add a new vertex to the graph. """

        if key in self._vertices:
            raise ValueError('vertex exists')
        self._vertices.add(key)
        self._forwards[key] = set()
        self._backwards[key] = set()