Compute the graph of strongly connected components.

        Each strongly connected component is itself represented as a list of
        pairs, giving information not only about the vertices belonging to
        this strongly connected component, but also the edges leading from
        this strongly connected component to other components.

        Each pair is of the form ('EDGE', v) or ('VERTEX', v) for some vertex
        v.  In the first case, that indicates that there's an edge from this
        strongly connected component to the given vertex v (which will belong
        to another component); in the second, it indicates that v is a member
        of this strongly connected component.

        Each component will begin with a vertex (the *root* vertex of the
        strongly connected component); the following edges are edges from that
        vertex.

        Algorithm is based on that described in "Path-based depth-first search
        for strong and biconnected components" by Harold N. Gabow,
        Inf.Process.Lett. 74 (2000) 107--114.

def _component_graph(self):
        """
        Compute the graph of strongly connected components.

        Each strongly connected component is itself represented as a list of
        pairs, giving information not only about the vertices belonging to
        this strongly connected component, but also the edges leading from
        this strongly connected component to other components.

        Each pair is of the form ('EDGE', v) or ('VERTEX', v) for some vertex
        v.  In the first case, that indicates that there's an edge from this
        strongly connected component to the given vertex v (which will belong
        to another component); in the second, it indicates that v is a member
        of this strongly connected component.

        Each component will begin with a vertex (the *root* vertex of the
        strongly connected component); the following edges are edges from that
        vertex.

        Algorithm is based on that described in "Path-based depth-first search
        for strong and biconnected components" by Harold N. Gabow,
        Inf.Process.Lett. 74 (2000) 107--114.

        """
        sccs = []
        stack = []
        boundaries = []
        identified = self.vertex_set()
        index = self.vertex_dict()
        to_do = []

        def visit_vertex(v):
            index[v] = len(stack)
            stack.append(('VERTEX', v))
            boundaries.append(index[v])
            to_do.append((leave_vertex, v))
            to_do.extend((visit_edge, w) for w in self.children(v))

        def visit_edge(v):
            if v in identified:
                stack.append(('EDGE', v))
            elif v in index:
                while index[v] < boundaries[-1]:
                    boundaries.pop()
            else:
                to_do.append((visit_vertex, v))

        def leave_vertex(v):
            if boundaries[-1] == index[v]:
                root = boundaries.pop()
                scc = stack[root:]
                del stack[root:]
                for item_type, w in scc:
                    if item_type == 'VERTEX':
                        identified.add(w)
                        del index[w]
                sccs.append(scc)
                stack.append(('EDGE', v))

        # Visit every vertex of the graph.
        for v in self.vertices:
            if v not in identified:
                to_do.append((visit_vertex, v))
                while to_do:
                    operation, v = to_do.pop()
                    operation(v)
                stack.pop()

        return sccs