igraph-help
[Top][All Lists]
Advanced

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

[igraph] how to combine subgraphs with attributes


From: MATSUDA, Noriyuki
Subject: [igraph] how to combine subgraphs with attributes
Date: Tue, 3 Jul 2007 12:01:14 +0900

Hello:
Can anyone help me combine subgraphs with specific attributes. The following
is a pilot script:
-----------------------------------------------------------------------------------
# BSJ07: Varying edge attribues by sigma
#

e1<- c(0,1,1,2,2,3,3,4,4,10)) # sv1
e2<- c(0,4,4,5,5,7,7,2)     # sv2
e3<- c(3,8,8,4,4,0)         # sv3
g1<-as.undirected(graph(e1))
g2<-as.undirected(graph(e2))
g3<-as.undirected(graph(e3))
E(g1)$color <-"red"
E(g2)$color <-"blue"
E(g3)$color <-"grey"
E(g1)$sv<-1
E(g2)$sv<-2
E(g3)$sv<-3

# g<- ??(g1,g2,g2)
-----------------------------------------------------------------------------------

  An alternative is to create g out of e1,e2,e3 by
     g<- as.undirected(graph( c(e1,e2,e3) )
But, I need help in specifying its edge attributes depending on whether they
originated from e1, e2 or e3.

Thanks in advance
--

MATSUDA, Noriyuki, Ph.D.  Univ. of Tsukuba




reply via email to

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