<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_node(self, node):
 """Add a node and connect it to the center."""

        nodes = self.nodes()

        if len(nodes) > 1:
            first_node = min(nodes, key=attrgetter("creation_time"))
            first_node.connect(direction="both", whom=node)