tests/testthat/test-graph.coreness.R

test_that("coreness works", {
  g <- make_ring(10)
  g <- add_edges(g, c(1, 2, 2, 3, 1, 3))
  gc <- coreness(g)
  expect_that(gc, equals(c(3, 3, 3, 2, 2, 2, 2, 2, 2, 2)))
})

Try the igraph package in your browser

Any scripts or data that you put into this service are public.

igraph documentation built on Aug. 10, 2023, 9:08 a.m.