0

I'm analysing a e-mail network. I loaded the following information in a directed igraph on R:

Vertex types: person, e-mail

V(g)[ type == "person" ]
V(g)[ type == "email" ]

Edge types: sends, receives

E(g)[ type == "send" ]
E(g)[ type == "receive" ]

So for example:

John --send--> email1 --receive--> Mary
John --send--> email2 --receive--> Mary
Mary --send--> email3 --receive--> John

I would like to generate a summary of the e-mail activity, with edges with an attribute representing the number of emails:

John --2--> Mary
Mary --1--> John

How would I go about to do that?

Thanks,

Mulone

Mulone
  • 3,603
  • 9
  • 47
  • 69
  • That is (part of) the square of the incidence matrix of your graph. – Vincent Zoonekynd Jun 16 '13 at 09:13
  • I got the adjancency matrix, but I don't understand what operations I should carry out on it. I mean, I could do a trivial count, but I was wondering if there was an elegant way of doing it. – Mulone Jun 16 '13 at 11:48
  • It is just a matrix multiplication: the (i,j) coefficient of `A %*% A` is the number of paths of length 2 from i to j -- for your bipartite graph, if i and j are persons, that would be the number of emails. – Vincent Zoonekynd Jun 16 '13 at 11:56

0 Answers0