On Fri, Dec 4, 2009 at 8:41 AM, Guilhem Faure <
guilhe...@gmail.com> wrote:
> If M.subgraph_is_isomorphic() is True it is possible to get the subgraph
> easely ?
> G1 = nx.Graph()
> G1.add_edge(1,2)
> G1.add_edge(2,3)
>
> G2 = nx.Graph()
> G2.add_edge(1,2)
>
> I want to have -> the common graph(s) is (1,2)
> Is it possible easely without a comparison of each edge ?
>
Well, don't you already have the subgraph?
In [8]: G2.edges()
Out[8]: [(1, 2)]
But if you want the subgraph from G1 you can
In [9]: H=G1.subgraph([1,2])
In [10]: H.edges()
Out[10]: [(1, 2)]
Aric