def relevant_subgraph(self, srcs, dests, keep=()):
        to_add = [s for s in srcs if s not in self]
        to_add.extend([d for d in dests if d not in self])

        for node in to_add:
            base = base_var(self, node)
            if base == node:
                self.add_node(node, **self.node[base])
            else:
                self.add_node(node, basevar=base, **self.node[base])
            # connect it to its component
            if '.' in node: # it's a component var. connect to its component
                if node in srcs:
                    self.add_edge(node, node.split('.',1)[0])
                else:
                    self.add_edge(node.split('.',1)[0], node)
            elif base in self:
                if node in srcs:
                    for s in self.successors(base):
                        if base_var(self, s) == base:
                            continue
                        dest = s+node[len(base):]
                        if dest not in self:
                            self.add_node(dest, basevar=s, **self.node[s])
                            self.add_edge(dest, s)
                        self.add_edge(node, dest, conn=True)
                        self.add_edge(base, node)
                else:
                    for p in self.predecessors(base):
                        if base_var(self, p) == base:
                            continue
                        src = p+node[len(base):]
                        if src not in self:
                            self.add_node(src, basevar=p, **self.node[p])
                            self.add_edge(p, src)
                        self.add_edge(src, node, conn=True)
                        self.add_edge(node, base)

        # create a 'fake' driver loop and grab
        # everything that's strongly connected to
        # that fake driver.
        self.add_node('@driver')
        for src in srcs:
            self.add_edge('@driver', src)
        for dest in dests:
            self.add_edge(dest, '@driver')
        for u,v in self.list_connections():
            self.add_edge('@driver', u)
            self.add_edge(v, '@driver')
        for k in keep:
            self.add_edge('@driver', k)
            self.add_edge(k, '@driver')

        for comps in strongly_connected_components(self):
            if '@driver' in comps:
                comps.remove('@driver')
                break

        # now remove the driver we added to g, which
        # also will remove all of the edges we added
        self.remove_node('@driver')

        comps = set(comps)

        # make sure we include srcs and dests even if they're
        # not connected
        comps.update(srcs)
        comps.update(dests)

        return self.subgraph(comps)
send a PacketOut message.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/depgraph.py/DependencyGraph.relevant_subgraph--crossover with--dataset/ETHPy150Open osrg/ryu/ryu/tests/switch/tester.py/OpenFlowSw.send_packet_out