File: test_graph.kautz.R

package info (click to toggle)
r-cran-igraph 1.0.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,232 kB
  • sloc: ansic: 173,538; cpp: 19,365; fortran: 4,550; yacc: 1,164; tcl: 931; lex: 484; makefile: 149; sh: 9
file content (21 lines) | stat: -rw-r--r-- 796 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

context("make_kautz_graph")

test_that("make_kautz_graph works", {
  library(igraph)
  g <- make_kautz_graph(2,3)
  expect_that(g$name, equals("Kautz graph 2-3"))
  expect_that(g$m, equals(2))
  expect_that(g$n, equals(3))

  el <- as_edgelist(g)
  el <- el[order(el[,1], el[,2]),]
  expect_that(el, equals(
    structure(c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 
                9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
                16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
                23, 23, 24, 24, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
                19, 20, 21, 22, 23, 24, 1, 2, 3, 4, 5, 6, 7, 8, 17,
                18, 19, 20, 21, 22, 23, 24, 1, 2, 3, 4, 5, 6, 7, 8, 9,
                10, 11, 12, 13, 14, 15, 16), .Dim = c(48L, 2L)) ))
})