def component_graph(self):
        cgraph = nx.DiGraph()
        for node, data in self.nodes_iter(data=True):
            if data.get('comp'):
                cgraph.add_node(node, **data)

        for node, data in self.nodes_iter(data=True):
            if not data.get('comp'):
                succ = self.successors(node)
                for p in self.predecessors(node):
                    for s in succ:
                        if s in cgraph[p]: # edge exists
                            cgraph[p][s]['varconns'].append(node)
                        else:
                            cgraph.add_edge(p, s, varconns=[node])

        return cgraph
Return a component graph based on
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/depgraph.py/CollapsedGraph.component_graph