tests/testthat/test-independent.vertex.sets.R

test_that("ivs works", {
  g <- sample_gnp(50, 0.8)
  ivs <- ivs(g, min = ivs_size(g))
  ec <- sapply(seq_along(ivs), function(x) {
    ecount(induced_subgraph(g, ivs[[x]]))
  })
  expect_that(unique(ec), equals(0))
})

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.