def connect_to(self, vertex, weight=1):
        """
        Connect this vertex to another one.

        Args:
            vertex (Vertex): vertex to connect to.
            weight (int): weight of the edge.

        Returns:
            Edge: the newly created edge.
        """
        for edge in self.edges_out:
            if vertex == edge.vertex_in:
                return edge
        return Edge(self, vertex, weight)
Connect this vertex to another one.

        Args:
            vertex (Vertex): vertex to connect to.
            weight (int): weight of the edge.

        Returns:
            Edge: the newly created edge.