igraph-help
[Top][All Lists]
Advanced

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

[igraph] Overlapping Networks by the Edges


From: Lorenzo Isella
Subject: [igraph] Overlapping Networks by the Edges
Date: Tue, 12 Jan 2010 16:04:22 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Dear All,
Maybe a simple thing, but I am experiencing problems.
The snippet below, together with the text file text_graph.dat (graph adjacency list where the nodes are labeled by long integers) generates two connected networks g and g2. g2 is in a sense a subgraph of g1 since both its nodes and edges are. I would like to plot g and highlight with a different color the nodes and edges in common with g2. Does anyone know how to achieve that? In particular, selecting the common edges between the two graphs is driving me mad.
Any help is appreciated.
Cheers

Lorenzo


library(igraph)

fn <- paste("test_graph.dat")

network <- read.table(fn,header=FALSE)

g <- graph.data.frame(network,dir=FALSE)

g <- simplify(g)

#select largest cluster

node_sel <- which(clusters(g)$membership==0)

g <- subgraph(g,V(g)[node_sel-1])


V(g)$id <- seq(vcount(g))-1

remove_nodes <- seq(0,vcount(g)-1, by=4)

g2 <- delete.vertices(g,V(g)[remove_nodes])

node_sel <- which(clusters(g2)$membership==0)

g2 <- subgraph(g2,V(g2)[node_sel-1])



l <- layout.fruchterman.reingold(g)
l <- layout.norm(l, -1,1, -1,1)


pdf("test_graph.pdf")

plot(g, layout=l,
    vertex.label.dist=0.5
    ,   vertex.color="#ff000033"
    ,
    vertex.frame.color="#ff000033",
    edge.color="#55555533"
    ,vertex.label=NA,
    vertex.size=4)


dev.off()









test graph.dat file


103677976 88604822
103022621 73859095
104464395 106168327
104464395 74317991
105512960 96337947
74317991 83820567
83886090 83886090
100728832 100728832
100991165 100991165
101056512 101056512
76218370 76218370
76284059 76284059
102367233 102367233
77267114 77267114
94175346 94175346
85655565 85655565
77856779 77856779
94961690 94961690
103677976 103677976
103809033 103809033
102629383 102629383
96337947 96337947
104136857 104136857
88604822 88604822
105512960 105512960
98238480 98238480
73138196 73138196
73334784 73334784
83361816 83361816
100335777 100335777
83820567 83820567
100859938 92864532
100859938 73269428
77463710 73597115
102695093 80347167
94503069 73859095
86966458 92274688
92864532 103022621
104464395 74317991
106168327 74317991
73597115 74776738
83886090 83886090
100728832 100728832
100859938 100859938
100991165 100991165
101056512 101056512
76218370 76218370
76284059 76284059
102367233 102367233
77267114 77267114
94175346 94175346
102629383 102629383
102695093 102695093
85655565 85655565
103022621 103022621
86966458 86966458
92274688 92274688
92864532 92864532
105512960 105512960
96337947 96337947
104136857 104136857
88604822 88604822
80347167 80347167
106168327 106168327
77856779 77856779
98238480 98238480
73138196 73138196
73269428 73269428
73334784 73334784
94961690 94961690
83361816 83361816
83558542 83558542
83820567 83820567
100335777 103677976
94503069 73859095
103350291 103809033
77463710 74776738
104464395 74317991
73597115 74776738
83886090 83886090
100728832 100728832
100859938 100859938
100991165 100991165
101056512 101056512
92864532 92864532
76218370 76218370
76284059 76284059
83558542 83558542
102367233 102367233
85655565 85655565
94175346 94175346
102695093 102695093
94961690 94961690
103677976 103677976
86966458 86966458
92274688 92274688
102629383 102629383
83165184 83165184
88604822 88604822
106168327 106168327
98238480 98238480
73334784 73334784
73597115 73597115
103350291 103350291
83361816 83361816
83820567 83820567
77463710 74776738
94503069 73859095
77267114 103809033
103022621 73269428
104464395 74317991
105512960 96337947
80347167 100335777
77856779 100335777
83886090 83886090
100728832 100728832
100859938 100859938
100991165 100991165
76218370 76218370
76284059 76284059
83558542 83558542
94175346 94175346
102629383 102629383
102695093 102695093
77856779 77856779
103350291 103350291
86966458 86966458
92274688 92274688
92864532 92864532
83165184 83165184
80347167 80347167
106168327 106168327
103022621 103022621
98238480 98238480
73269428 73269428
73334784 73334784
74776738 74776738
94961690 94961690
83361816 83361816
100335777 100335777
101056512 102367233
77267114 103809033
94503069 73859095
103677976 88604822
77463710 73597115
104464395 74317991
105512960 96337947
74317991 83820567
83886090 83886090
100859938 100859938
100991165 100991165
92864532 92864532
76218370 76218370
76284059 76284059
102367233 102367233
85655565 85655565
94175346 94175346
102695093 102695093
94503069 94503069
77267114 77267114
94961690 94961690
103677976 103677976
86966458 86966458
92274688 92274688
102629383 102629383
80347167 80347167
96337947 96337947
83165184 83165184
88604822 88604822
105512960 105512960
103022621 103022621
73138196 73138196
73269428 73269428
73334784 73334784
73859095 73859095
100728832 98238480
100728832 101056512
101056512 98238480
83558542 103809033
77463710 74776738
77856779 83361816
103809033 103350291
106168327 74317991
73597115 74776738
74317991 83820567
83886090 83886090
100859938 100859938
100991165 100991165
76218370 76218370
76284059 76284059
102367233 102367233
77267114 77267114
94175346 94175346
102695093 102695093
94503069 94503069
85655565 85655565
103677976 103677976
86966458 86966458
102629383 102629383
92864532 92864532
105512960 105512960
96337947 96337947
88604822 88604822
103022621 103022621
98238480 98238480
73138196 73138196
73269428 73269428
73859095 73859095
94961690 94961690
100335777 100335777
100728832 101056512
83558542 103809033
77463710 73597115
77463710 74776738
77856779 83361816
92274688 80347167
104464395 74317991
74776738 73597115
106168327 74317991
73334784 83165184
74317991 83820567
92274688 92274688
100859938 100859938
100991165 100991165
101056512 101056512
76218370 76218370
76284059 76284059
83558542 83558542
85655565 85655565
94175346 94175346
102629383 102629383
102695093 102695093
94503069 94503069
77267114 77267114
94961690 94961690
83886090 83886090
86966458 86966458
103809033 103809033
104136857 104136857
92864532 92864532
104464395 104464395
105512960 105512960
96337947 96337947
80347167 80347167
73138196 73138196
73597115 73597115
73859095 73859095
77463710 77463710
74776738 74776738
103350291 103350291
100335777 100335777
100728832 102367233
100728832 98238480
100728832 77856779
103677976 88604822
102367233 98238480
102367233 77856779
77856779 83361816
83165184 73334784
103022621 73269428
74317991 83820567
92274688 92274688
100991165 100991165
92864532 92864532
76218370 76218370
76284059 76284059
77267114 77267114
77463710 77463710
102695093 102695093
103677976 103677976
86966458 86966458
102629383 102629383
96337947 96337947
88604822 88604822
105512960 105512960
73138196 73138196
83886090 83886090
94961690 94961690
83361816 83361816
100335777 100335777
100728832 98238480
100728832 101056512
100859938 80347167
101056512 98238480
83558542 103809033
102367233 98238480
94175346 77856779
94503069 73859095
85655565 103350291
103022621 73269428
104464395 74317991
80347167 74776738
83165184 73334784
73597115 74776738
74317991 83820567
92274688 92274688
100728832 100728832
100991165 100991165
101056512 101056512
92864532 92864532
76218370 76218370
102367233 102367233
77267114 77267114
77463710 77463710
102695093 102695093
94503069 94503069
94961690 94961690
86966458 86966458
102629383 102629383
105512960 105512960
96337947 96337947
80347167 80347167
98238480 98238480
73138196 73138196
73859095 73859095
83886090 83886090
83165184 83165184
83361816 83361816
100335777 100335777
100859938 103022621
100859938 73269428
76284059 94175346
83558542 103809033
94175346 77856779
85655565 103350291
103677976 88604822
104464395 106168327
104464395 74317991
74776738 73597115
106168327 74317991
106168327 83820567
103022621 73597115
73334784 73597115
74317991 83820567
83886090 83886090
100859938 100859938
100991165 100991165
76218370 76218370
76284059 76284059


Attachment: test_graph.dat
Description: Netscape Proxy Auto Config


reply via email to

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