igraph-help
[Top][All Lists]
Advanced

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

[igraph] Weighted bipartite graphs?


From: Uri Shwed
Subject: [igraph] Weighted bipartite graphs?
Date: Mon, 23 Nov 2009 15:27:05 -0500

Dear Gabor et.al.,
What would you guys say is the best way to get a bipartite data set with meta-data into a weighted projection?
For example:

data<-data.frame(people=c(1:5,5:8,1),events=c (1,1,1,1,1,2,2,2,2,2),year=c (2004,2004,2004,2004,2004,2005,2005,2005,2005,2005))

desired outcome:
The first graph projection below (achieved through graph.incidence and bipartite.projection), with Edge attribute of weight (giving all edges weight of 1 and the edge between 1 and 5 a weight of 2, because they attended 2 events together), and an edge attribute of year.
Any ideas?

$proj1
Vertices: 8
Edges: 19
Directed: FALSE
Edges:

[0]  0 -- 1
[1]  0 -- 2
[2]  0 -- 3
[3]  0 -- 4
[4]  0 -- 5
[5]  0 -- 6
[6]  0 -- 7
[7]  1 -- 2
[8]  1 -- 3
[9]  1 -- 4
[10] 2 -- 3
[11] 2 -- 4
[12] 3 -- 4
[13] 4 -- 5
[14] 4 -- 6
[15] 4 -- 7
[16] 5 -- 6
[17] 5 -- 7
[18] 6 -- 7

$proj2
Vertices: 2
Edges: 1
Directed: FALSE
Edges:
    e
e [0] 0 -- 1


Thanks,
Uri




reply via email to

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