<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_nodes(self, nodes, nesting=1):
 """ Adds edges showing dependencies between source files listed in the nodes. """

        hopNodes = set()  # nodes in this hop
        hopEdges = []     # edges in this hop
        # get nodes and edges for this hop
        for i, n in zip(range(len(nodes)), nodes):
            r, g, b = rainbowcolour(i, len(nodes))
            colour = '#%02X%02X%02X' % (r, g, b)
            for ne in n.efferent:
                if ne not in self.added:
                    hopNodes.add(ne)
                hopEdges.append((ne, n, 'solid', colour))
        # add nodes and edges to the graph if maximum number of nodes is not
        # exceeded
        self.add_to_graph(hopNodes, hopEdges, nesting)