File: time_sgm.R

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (11 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11

time_group("Seeded graph matching")

time_that("SGM is fast(er)", replications=10,
          init = { library(igraph); set.seed(42); vc <- 200; nos=10 },
          reinit = { g1 <- erdos.renyi.game(vc, .01);
                     perm <- c(1:nos, sample(vc-nos)+nos)
                     g2 <- sample_correlated_gnp(g1, corr=.7, p=g1$p, permutation=perm)
                   },
          { match_vertices(g1[], g2[], m=nos, start=matrix(1/(vc-nos), vc-nos, vc-nos),
                iteration = 20) })