igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] segmenting graphs


From: Tom Wright
Subject: Re: [igraph] segmenting graphs
Date: Mon, 05 May 2014 16:42:43 -0400

Whoops sorry,
t<-graph.empty()
t<-t+vertices(c('r',LETTERS[1:9]))
t['r',LETTERS[1:9],attr='weight']<-c(1,-2,2,-2,2,-6,5,10,-10)
t['A','B']<-1
t['r','A']<-FALSE


I'm trying to implement the Lerchs Grossman algorithm, one step includes
finding the subgraph V{B,A}, detaching it from 'r' and adding it as a
child of 'C'. The new edge C -> B needs to be assigned the summed weight
of the detached subgraph V{B,A}.

Apologies if my terminology is poor, I'm still trying to get this clear
in my head as well as in code.





On Mon, 2014-05-05 at 16:26 -0400, Gábor Csárdi wrote:
> On Mon, May 5, 2014 at 4:18 PM, Tom Wright <address@hidden> wrote:
>         Hi,
>         I'm trying to use iGraph in the R environment and I'm getting
>         confused.
>         It seems to me that what I want to do should be simple but...
>         
>         t<-graph.empty()
>         t<-t+vertices(c('r',LETTERS[1:9]))
>         t['r',D.vertices[,1],attr='weight']<-1
> 
> 
> Error in as.igraph.vs(x, j) : object 'D.vertices' not found
>  
>         t['A','B']<-1
>         t['r','A']<-FALSE
>         
>         I want to get the subgraph with vertex 'A' as the root, i.e.
>         vertices
>         {'A','B'}
> 
> 
> What does this really mean? The whole tree rooted at 'A'? 
> 
> 
> graph.neighborhood(t, 'A', order=vcount(t))[[1]]
> 
> 
> Or something else?
> 
> 
> Gabor
> 
> 
> [...]
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help





reply via email to

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