-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdependencies.R
More file actions
41 lines (35 loc) · 900 Bytes
/
Copy pathdependencies.R
File metadata and controls
41 lines (35 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
library(igraph)
set.seed(1234)
NUM.MINIS <- 7
module.sizes <- sample(c(4,5,3:7),NUM.MINIS,replace=TRUE)
make.mini.graphs <- lapply(1:length(module.sizes), function(n) {
g <- make_full_graph(module.sizes[n])
V(g)$name <- paste0(LETTERS[n],1:module.sizes[n])
return(g)
})
low <- graph.union(make.mini.graphs)
low <- add_edges(low,c(
"A1","B1",
"B1","C1",
"B1","D1",
"C1","A1",
"D1","F1",
"E1","A1",
"E1","D1",
"E1","F1",
"F1","B1",
"F1","G1"
))
V(low)$name <- ""
png("lowDependencies.png")
plot(low, layout=layout_with_fr(low),
vertex.size=10,
vertex.color="green", edge.color="black", edge.width=2)
dev.off()
high <- erdos.renyi.game(sum(module.sizes),p=.4)
V(high)$name <- ""
png("highDependencies.png")
plot(high, layout=layout_with_fr(high),
vertex.size=10,
vertex.color="green", edge.color="black", edge.width=2)
dev.off()