igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Cannot convert directed graph into undirected graph using p


From: Tamás Nepusz
Subject: Re: [igraph] Cannot convert directed graph into undirected graph using python
Date: Sat, 22 Feb 2014 09:01:56 +0100

If you really need a function that creates an undirected *copy* of the graph, 
you can use as_undirected() instead of to_undirected():  

g2 = g.as_undirected()  

--  
T.


On Saturday, 22 February 2014 at 07:20, Salvatore Palomino wrote:

> Because the purpose of the function is to convert g into and undirected 
> graph. Also, when I use other functions that perform operations on graphs, 
> they always return the graph. Thus, its logical that it would return g and 
> not None.  
>  
>  
>  
> On Fri, Feb 21, 2014 at 5:15 PM, Gábor Csárdi <address@hidden 
> (mailto:address@hidden)> wrote:
> > On Fri, Feb 21, 2014 at 8:10 PM, Salvatore Palomino <address@hidden 
> > (mailto:address@hidden)> wrote:
> > > i think it should return g as an undirected graph. Instead it returns 
> > > "None"  
> >  
> >  
> > Why should it return the graph?
> >  
> > Gabor
> >  
> > >  
> > >  
> > > On Fri, Feb 21, 2014 at 4:07 PM, Gábor Csárdi <address@hidden 
> > > (mailto:address@hidden)> wrote:
> > > > On Fri, Feb 21, 2014 at 6:55 PM, Salvatore Palomino <address@hidden 
> > > > (mailto:address@hidden)> wrote:
> > > > > Hello!
> > > > >  
> > > > > I am trying to convert my directed graph g into an undirected graph 
> > > > > using to_undirected().  
> > > > >  
> > > > > << g = 
> > > > > GraphBase.Read_Pajek("C:/Users/Palomino/Downloads/109Senate-Rows.net 
> > > > > (http://109Senate-Rows.net)")  
> > > > > << g = g.to_undirected(False)
> > > > > << print g  
> > > > > None
> > > > >  
> > > > > I don't know why it returns None. Can you help me out?
> > > >  
> > > > What should it return? The result of the conversion is in g, it does it 
> > > > in place.  
> > > >  
> > > > G.
> > > >  
> > > >  
> > > > >  
> > > > > Thanks!!!  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > > _______________________________________________
> > > > > igraph-help mailing list
> > > > > address@hidden (mailto:address@hidden)
> > > > > https://lists.nongnu.org/mailman/listinfo/igraph-help
> > > >  
> > > >  
> > > >  
> > > > _______________________________________________
> > > > igraph-help mailing list
> > > > address@hidden (mailto:address@hidden)
> > > > https://lists.nongnu.org/mailman/listinfo/igraph-help
> > >  
> > >  
> > >  
> > > _______________________________________________
> > > igraph-help mailing list
> > > address@hidden (mailto:address@hidden)
> > > https://lists.nongnu.org/mailman/listinfo/igraph-help
> >  
> >  
> >  
> > _______________________________________________
> > igraph-help mailing list
> > address@hidden (mailto:address@hidden)
> > https://lists.nongnu.org/mailman/listinfo/igraph-help
>  
>  
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

[Prev in Thread] Current Thread [Next in Thread]