tests/testthat/test-graph.compose.R

test_that("compose works", {
  g1 <- sample_gnp(50, 3 / 50, directed = TRUE)
  gi <- make_graph(rep(1:vcount(g1), each = 2), directed = TRUE)

  g2 <- compose(g1, gi)
  g3 <- compose(gi, g1)

  expect_true(graph.isomorphic(g1, g2))
  expect_true(graph.isomorphic(g1, g3))
})

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.