tests/testthat/test-largest.cliques.R

test_that("largest_cliques works", {
  g <- sample_gnp(50, 20 / 50)
  lc <- largest_cliques(g)

  ## TODO: this only checks that these are cliques
  expect_that(
    unique(sapply(lc, function(x) {
      edge_density(induced_subgraph(g, x))
    })),
    equals(1)
  )
})

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.