tests/testthat/test-articulation.points.R

test_that("articulation_points works", {
  g <- make_full_graph(5) + make_full_graph(5)
  clu <- components(g)$membership
  g <- add_edges(g, c(match(1, clu), match(2, clu)))

  ap <- as.vector(articulation_points(g))
  deg <- degree(g)
  expect_equal(sort(which(deg == max(deg))), sort(ap))
})

Try the igraph package in your browser

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

igraph documentation built on Oct. 20, 2024, 1:06 a.m.