From f783e9670832fb92f7513b69884436f79e681f5a Mon Sep 17 00:00:00 2001 From: David Schoch Date: Fri, 29 May 2026 22:10:19 +0200 Subject: [PATCH 01/20] Add modern cli-styled print output for graphs, vertex sequences, and edge sequences --- R/iterators.R | 132 +++++++++++++++ R/par.R | 11 +- R/print.R | 218 ++++++++++++++++++++++++ tests/testthat/_snaps/print-modern.md | 235 ++++++++++++++++++++++++++ tests/testthat/test-print-modern.R | 101 +++++++++++ 5 files changed, 696 insertions(+), 1 deletion(-) create mode 100644 tests/testthat/_snaps/print-modern.md create mode 100644 tests/testthat/test-print-modern.R diff --git a/R/iterators.R b/R/iterators.R index e28db7c5475..d8e007edea0 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1422,6 +1422,10 @@ print.igraph.vs <- function( id = igraph_opt("print.id"), ... ) { + if (identical(igraph_opt("print.style"), "modern")) { + return(print_igraph_vs_modern(x, full = full, id = id, ...)) + } + graph <- get_vs_graph(x) if (!is.null(graph)) { vertices <- V(graph) @@ -1539,6 +1543,10 @@ print.igraph.es <- function( id = igraph_opt("print.id"), ... ) { + if (identical(igraph_opt("print.style"), "modern")) { + return(print_igraph_es_modern(x, full = full, id = id, ...)) + } + graph <- get_es_graph(x) ml <- if (identical(full, TRUE)) NULL else igraph_opt("auto.print.lines") .print.edges.compressed( @@ -1552,6 +1560,130 @@ print.igraph.es <- function( invisible(x) } +# Modern (cli-styled) printing for vertex/edge sequences ----------------- + +print_igraph_vs_modern <- function(x, full = igraph_opt("print.full"), + id = igraph_opt("print.id"), ...) { + graph <- get_vs_graph(x) + vertices <- if (!is.null(graph)) V(graph) else NULL + len <- length(x) + total <- if (is.null(vertices)) "?" else as.character(length(vertices)) + gid <- graph_id(x) + + dot <- modern_middot() + flags <- character() + if (!is.null(vertices) && !is.null(names(vertices))) flags <- c(flags, "named") + if (isTRUE(id) && !is.na(gid)) flags <- c(flags, paste("from", substr(gid, 1, 7))) + if (is.null(graph)) flags <- c(flags, "deleted") + flag_str <- if (length(flags)) paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) else "" + + title <- paste0(" ", len, "/", total, flag_str) + cat(cli::rule(left = title), "\n", sep = "") + + if (is_single_index(x) && !is.null(graph) && + length(vertex_attr_names(graph)) > 0) { + va <- vertex_attr(graph) + if (all(sapply(va, is.atomic))) { + print(as.data.frame(va, stringsAsFactors = FALSE)[ + as.vector(x), , drop = FALSE + ]) + } else { + print(lapply(va, "[", as.vector(x))) + } + } else { + if (!is.null(names(vertices))) { + x2 <- names(vertices)[as.vector(x)] + if (!is.null(names(x)) && !identical(names(x), x2)) { + names(x2) <- names(x) + } + } else { + x2 <- as.vector(x) + } + if (length(x2)) { + if (is.logical(full) && full) { + print(x2, quote = FALSE) + } else { + head_print( + x2, + omitted_footer = "+ ... omitted several vertices\n", + quote = FALSE, + max_lines = igraph_opt("auto.print.lines") + ) + } + } + } + + invisible(x) +} + +print_igraph_es_modern <- function(x, full = igraph_opt("print.full"), + id = igraph_opt("print.id"), ...) { + graph <- get_es_graph(x) + len <- length(x) + total <- if (is.null(graph)) "?" else as.character(gsize(graph)) + gid <- graph_id(x) + has_vnames <- !is.null(attr(x, "vnames")) + + dot <- modern_middot() + flags <- character() + if (has_vnames) flags <- c(flags, "vertex names") + if (isTRUE(id) && !is.na(gid)) flags <- c(flags, paste("from", substr(gid, 1, 7))) + if (is.null(graph)) flags <- c(flags, "deleted") + flag_str <- if (length(flags)) paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) else "" + + title <- paste0(" ", len, "/", total, flag_str) + cat(cli::rule(left = title), "\n", sep = "") + + if (len == 0) return(invisible(x)) + + if (is_single_index(x) && !is.null(graph)) { + ea <- edge_attr(graph) + if (all(sapply(ea, is.atomic))) { + etail <- tail_of(graph, x) + ehead <- head_of(graph, x) + df <- data.frame( + stringsAsFactors = FALSE, + tail = as_ids(etail), + head = as_ids(ehead), + tid = as.vector(etail), + hid = as.vector(ehead) + ) + if (length(ea)) { + ea <- do_call(data.frame, .args = ea, stringsAsFactors = FALSE) + df <- cbind(df, ea[as.vector(x), , drop = FALSE]) + } + print(df) + } else { + print(lapply(ea, "[", as.vector(x))) + } + return(invisible(x)) + } + + ml <- if (identical(full, TRUE)) NULL else igraph_opt("auto.print.lines") + + if (!is.null(graph)) { + arrow <- modern_edge_arrow(is_directed(graph)) + el <- ends(graph, x, names = has_vnames || is_named(graph)) + formatted <- paste0(format(el[, 1]), " ", arrow, " ", format(el[, 2])) + if (is.null(ml)) { + print(formatted, quote = FALSE) + } else { + head_print(formatted, + omitted_footer = "+ ... omitted several edges\n", + quote = FALSE, max_lines = ml + ) + } + } else { + body <- if (!is.null(attr(x, "vnames"))) as.vector(attr(x, "vnames")) + else if (!is.null(names(x))) names(x) + else as.vector(x) + if (is.null(ml)) print(body, quote = FALSE) + else head_print(body, omitted_footer = "+ ... omitted several edges\n", + quote = FALSE, max_lines = ml) + } + invisible(x) +} + # these are internal as_igraph_vs <- function(graph, v, na.ok = FALSE) { diff --git a/R/par.R b/R/par.R index 8b32920a48e..6f17e124b85 100644 --- a/R/par.R +++ b/R/par.R @@ -71,7 +71,8 @@ getIgraphOpt <- function(x, default = NULL) { "annotate.plot" = FALSE, "auto.print.lines" = 10, "return.vs.es" = TRUE, - "print.id" = TRUE + "print.id" = TRUE, + "print.style" = "classic" ) igraph.pars.set.verbose <- function(verbose) { @@ -156,6 +157,14 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose) #' \item{print.vertex.attributes}{ #' Logical constant, whether to print vertex attributes when printing graphs. Defaults to `FALSE`. #' } +#' \item{print.style}{ +#' Character string controlling the visual style used by +#' [print.igraph()], [summary.igraph()], [print.igraph.vs()] and +#' [print.igraph.es()]. Possible values are `"classic"` (default, +#' the historical `IGRAPH ... DNW-` header relied on by tutorials and +#' parsers) and `"modern"` (a cli-styled output with section rules, +#' Unicode arrows for edges and typed attribute listings). +#' } #' \item{return.vs.es}{ #' Whether functions that return a set or sequence of vertices/edges #' should return formal vertex/edge sequence objects. diff --git a/R/print.R b/R/print.R index c4aa11b8e8c..9445c47f2e4 100644 --- a/R/print.R +++ b/R/print.R @@ -548,6 +548,11 @@ print_all <- function(object, ...) { #' As of igraph 1.1.1, the `str.igraph` function is defunct, use #' `print_all()`. #' +#' Set `igraph_options(print.style = "modern")` to switch to a cli-styled +#' output with section rules, typed attribute listings and Unicode arrows +#' for edges. The default `"classic"` keeps the historical +#' `IGRAPH ... DNW-` header relied on by parsers and tutorials. +#' #' @aliases print.igraph print_all summary.igraph str.igraph #' @param x The graph to print. #' @param full Logical scalar, whether to print the graph structure itself as @@ -589,6 +594,20 @@ print.igraph <- function( ) { ensure_igraph(x) + if (identical(igraph_opt("print.style"), "modern")) { + return(print_igraph_modern( + x, + full = full, + graph.attributes = graph.attributes, + vertex.attributes = vertex.attributes, + edge.attributes = edge.attributes, + names = names, + max.lines = max.lines, + id = id, + ... + )) + } + head_lines <- .print.header(x, id) if (is.logical(full) && full) { if (graph.attributes) { @@ -625,10 +644,209 @@ print.igraph <- function( #' @family print #' @export summary.igraph <- function(object, ...) { + if (identical(igraph_opt("print.style"), "modern")) { + return(summary_igraph_modern(object)) + } .print.header(object) invisible(object) } +# Modern (cli-styled) printing ------------------------------------------- + +modern_edge_arrow <- function(directed) { + if (cli::is_utf8_output()) { + if (directed) "→" else "─" + } else { + if (directed) "->" else "--" + } +} + +modern_middot <- function() { + if (cli::is_utf8_output()) "·" else "*" +} + +modern_attr_label <- function(code) { + switch(code, + c = "", + n = "", + l = "", + x = "", + paste0("<", code, ">") + ) +} + +modern_attr_codes <- function(x, kind) { + if (kind == "graph") .Call(Rx_igraph_get_attr_mode, x, 2L) + else if (kind == "vertex") .Call(Rx_igraph_get_attr_mode, x, 3L) + else .Call(Rx_igraph_get_attr_mode, x, 4L) +} + +print_igraph_header_modern <- function(x, id) { + name <- if ("name" %in% graph_attr_names(x)) as.character(x$name)[1] else NULL + title <- if (!is.null(name) && !is.na(name) && nzchar(name)) { + paste0(" ", name) + } else { + "" + } + gid <- if (isTRUE(id)) substr(graph_id(x), 1, 7) else NA_character_ + + if (!is.na(gid) && nzchar(gid)) { + cat(cli::rule(left = title, right = gid), "\n", sep = "") + } else { + cat(cli::rule(left = title), "\n", sep = "") + } + + props <- if (is_directed(x)) "directed" else "undirected" + if (is_named(x)) props <- c(props, "named") + if (is_weighted(x)) props <- c(props, "weighted") + if (is_bipartite(x)) props <- c(props, "bipartite") + + dot <- modern_middot() + info <- cli::col_cyan(cli::symbol$info) + + cat(info, " ", paste(props, collapse = paste0(" ", dot, " ")), "\n", sep = "") + cat(info, " ", vcount(x), " vertices ", dot, " ", + ecount(x), " edges\n", sep = "") +} + +print_igraph_attr_summary_modern <- function(x) { + ga <- graph_attr_names(x) + va <- vertex_attr_names(x) + ea <- edge_attr_names(x) + if (length(ga) == 0 && length(va) == 0 && length(ea) == 0) { + return(invisible(NULL)) + } + + cat("\n", cli::rule(left = "Attributes"), "\n", sep = "") + arrow <- if (cli::is_utf8_output()) "→" else "->" + + format_line <- function(label, names, codes) { + parts <- paste0( + cli::col_yellow(names), + " ", + cli::col_silver(vapply(codes, modern_attr_label, character(1))) + ) + paste0(arrow, " ", label, paste(parts, collapse = ", ")) + } + + lines <- character() + if (length(ga)) lines <- c(lines, format_line("graph: ", ga, modern_attr_codes(x, "graph"))) + if (length(va)) lines <- c(lines, format_line("vertex: ", va, modern_attr_codes(x, "vertex"))) + if (length(ea)) lines <- c(lines, format_line("edge: ", ea, modern_attr_codes(x, "edge"))) + cat(lines, sep = "\n") + cat("\n") +} + +print_igraph_graph_attrs_modern <- function(x) { + list <- graph_attr_names(x) + if (length(list) == 0) return(invisible(NULL)) + cat("\n", cli::rule(left = "Graph attributes"), "\n", sep = "") + for (n in list) { + cat(cli::format_inline("{.field {n}}:"), "\n", sep = "") + indent_print(graph_attr(x, n), .indent = " ") + } +} + +print_igraph_vertex_attrs_modern <- function(x) { + if (length(vertex_attr_names(x)) == 0) return(invisible(NULL)) + cat("\n", cli::rule(left = "Vertex attributes"), "\n", sep = "") + # reuse classic tabular renderer + .print.vertex.attributes.old(x, full = TRUE, max.lines = NULL) +} + +print_igraph_edges_modern <- function(x, edges = E(x), names = TRUE, + max.lines = NULL, with_attrs = FALSE) { + is_named_g <- isTRUE(names) && is_named(x) + if (is_named_g && "name" %in% vertex_attr_names(x) && + !is.numeric(vertex_attr(x, "name")) && + !is.character(vertex_attr(x, "name")) && + !is.logical(vertex_attr(x, "name"))) { + cli::cli_warn("Can't print vertex names, complex {.val name} vertex attribute.") + is_named_g <- FALSE + } + + ec <- length(edges) + if (ec == 0) return(invisible(NULL)) + + title_suffix <- if (is_named_g) " (vertex names)" else "" + show_attrs <- with_attrs && length(edge_attr_names(x)) != 0 + title <- if (show_attrs) { + paste0("Edges with attributes", title_suffix) + } else { + paste0("Edges", title_suffix) + } + cat("\n", cli::rule(left = title), "\n", sep = "") + + arrow <- modern_edge_arrow(is_directed(x)) + + if (show_attrs) { + eattrs <- setdiff(edge_attr_names(x), "name") + el <- ends(x, edges, names = is_named_g) + if (is.numeric(el)) { + w <- nchar(max(el)) + } else { + w <- max(nchar(el)) + } + ename <- if ("name" %in% edge_attr_names(x)) { + paste0("'", edge_attr(x, "name"), "'") + } else { + seq_len(nrow(el)) + } + tab <- data.frame(row.names = paste0("[", ename, "]")) + tab[["edge"]] <- paste0(format(el[, 1], width = w), " ", arrow, " ", + format(el[, 2], width = w)) + for (i in eattrs) tab[[i]] <- edge_attr(x, i) + print(tab) + } else { + el <- ends(x, edges, names = is_named_g) + formatted <- paste0(format(el[, 1]), " ", arrow, " ", format(el[, 2])) + if (is.null(max.lines)) { + print(formatted, quote = FALSE) + } else { + head_print(formatted, + omitted_footer = "+ ... omitted several edges\n", + quote = FALSE, + max_lines = max.lines + ) + } + } +} + +print_igraph_modern <- function(x, + full = igraph_opt("print.full"), + graph.attributes = igraph_opt("print.graph.attributes"), + vertex.attributes = igraph_opt("print.vertex.attributes"), + edge.attributes = igraph_opt("print.edge.attributes"), + names = TRUE, + max.lines = igraph_opt("auto.print.lines"), + id = igraph_opt("print.id"), + ...) { + print_igraph_header_modern(x, id) + print_igraph_attr_summary_modern(x) + + if (is.logical(full) && isTRUE(full)) { + if (graph.attributes) print_igraph_graph_attrs_modern(x) + if (vertex.attributes) print_igraph_vertex_attrs_modern(x) + if (ecount(x) > 0) { + if (edge.attributes && length(edge_attr_names(x)) != 0) { + print_igraph_edges_modern(x, names = names, max.lines = NULL, + with_attrs = TRUE) + } else { + print_igraph_edges_modern(x, names = names, max.lines = NULL) + } + } + } else if (identical(full, "auto")) { + print_igraph_edges_modern(x, names = names, max.lines = max.lines) + } + invisible(x) +} + +summary_igraph_modern <- function(object) { + print_igraph_header_modern(object, id = igraph_opt("print.id")) + print_igraph_attr_summary_modern(object) + invisible(object) +} + " #################################################################### ## Various designs for printing graphs diff --git a/tests/testthat/_snaps/print-modern.md b/tests/testthat/_snaps/print-modern.md new file mode 100644 index 00000000000..e3132eaaf55 --- /dev/null +++ b/tests/testthat/_snaps/print-modern.md @@ -0,0 +1,235 @@ +# modern print.igraph: undirected unnamed ring + + Code + print(g) + Output + ── Ring graph ───────────────────────────────────────────────────────── + ℹ undirected + ℹ 5 vertices · 5 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + + + ── Edges ─────────────────────────────────────────────────────────────────────── + [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 1 ─ 5 + +--- + + Code + summary(g) + Output + ── Ring graph ───────────────────────────────────────────────────────── + ℹ undirected + ℹ 5 vertices · 5 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + + +# modern print.igraph: directed named weighted + + Code + print(g) + Output + ── trio ─────────────────────────────────────────────────────────────── + ℹ directed · named · weighted + ℹ 3 vertices · 3 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + → vertex: name + → edge: weight + + + ── Edges (vertex names) ──────────────────────────────────────────────────────── + [1] A → B B → C C → A + +--- + + Code + summary(g) + Output + ── trio ─────────────────────────────────────────────────────────────── + ℹ directed · named · weighted + ℹ 3 vertices · 3 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + → vertex: name + → edge: weight + + +# modern print.igraph: bipartite + + Code + print(g) + Output + ── ──────────────────────────────────────────────────────────────────── + ℹ undirected · bipartite + ℹ 4 vertices · 2 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → vertex: type + + + ── Edges ─────────────────────────────────────────────────────────────────────── + [1] 1 ─ 3 2 ─ 4 + +# modern print.igraph: empty graph has no edges section + + Code + print(make_empty_graph(0)) + Output + ── ──────────────────────────────────────────────────────────────────── + ℹ directed + ℹ 0 vertices · 0 edges + +--- + + Code + print(make_empty_graph(3, directed = FALSE)) + Output + ── ──────────────────────────────────────────────────────────────────── + ℹ undirected + ℹ 3 vertices · 0 edges + +# modern print.igraph: full mode with all attribute sections + + Code + print(g) + Output + ── trio ─────────────────────────────────────────────────────────────── + ℹ directed · named · weighted + ℹ 3 vertices · 3 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + → vertex: name + → edge: weight + + + ── Graph attributes ──────────────────────────────────────────────────────────── + name: + [1] "trio" + mutual: + [1] FALSE + circular: + [1] TRUE + + ── Vertex attributes ─────────────────────────────────────────────────────────── + name + [1] A + [2] B + [3] C + + ── Edges with attributes (vertex names) ──────────────────────────────────────── + edge weight + [1] A → B 1 + [2] B → C 2 + [3] C → A 3 + +# modern print.igraph.vs: single and double bracket + + Code + V(g) + Output + ── 3/3 · named ─────────────────────────────────────────────── + [1] A B C + Code + V(g)[1:2] + Output + ── 2/3 · named ─────────────────────────────────────────────── + [1] A B + Code + V(g)[[1]] + Output + ── 1/3 · named ─────────────────────────────────────────────── + name weight + 1 A 10 + Code + V(g)[[2:3]] + Output + ── 2/3 · named ─────────────────────────────────────────────── + name weight + 2 B 11 + 3 C 12 + +# modern print.igraph.es: single and double bracket + + Code + E(g) + Output + ── 3/3 · vertex names ────────────────────────────────────────── + [1] A → B B → C C → A + Code + E(g)[1:2] + Output + ── 2/3 · vertex names ────────────────────────────────────────── + [1] A → B B → C + Code + E(g)[[1]] + Output + ── 1/3 · vertex names ────────────────────────────────────────── + tail head tid hid weight + 1 A B 1 2 1 + Code + E(g)[[2:3]] + Output + ── 2/3 · vertex names ────────────────────────────────────────── + tail head tid hid weight + 2 B C 2 3 2 + 3 C A 3 1 3 + +# modern print.igraph: ASCII fallback when cli.unicode = FALSE + + Code + print(g) + Output + -- Ring graph --------------------------------------------------------- + i directed * named + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + -> vertex: name + + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> B B -> C C -> A + +--- + + Code + V(g) + Output + -- 3/3 * named ----------------------------------------------- + [1] A B C + +--- + + Code + E(g) + Output + -- 3/3 * vertex names ------------------------------------------ + [1] A -> B B -> C C -> A + +# modern print.igraph: truncation in auto mode + + Code + print(g) + Output + ── Ring graph ───────────────────────────────────────────────────────── + ℹ undirected + ℹ 200 vertices · 200 edges + + ── Attributes ────────────────────────────────────────────────────────────────── + → graph: name , mutual , circular + + + ── Edges ─────────────────────────────────────────────────────────────────────── + [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 7 ─ 8 + [8] 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 13 ─ 14 14 ─ 15 + [15] 15 ─ 16 16 ─ 17 17 ─ 18 18 ─ 19 19 ─ 20 20 ─ 21 21 ─ 22 + + ... omitted several edges + diff --git a/tests/testthat/test-print-modern.R b/tests/testthat/test-print-modern.R new file mode 100644 index 00000000000..c49398a5e4f --- /dev/null +++ b/tests/testthat/test-print-modern.R @@ -0,0 +1,101 @@ +test_that("modern print.igraph: undirected unnamed ring", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(5) + expect_snapshot(print(g)) + expect_snapshot(summary(g)) +}) + +test_that("modern print.igraph: directed named weighted", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(3, directed = TRUE) |> + set_vertex_attr("name", value = c("A", "B", "C")) |> + set_edge_attr("weight", value = 1:3) |> + set_graph_attr("name", value = "trio") + expect_snapshot(print(g)) + expect_snapshot(summary(g)) +}) + +test_that("modern print.igraph: bipartite", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_bipartite_graph( + types = c(FALSE, FALSE, TRUE, TRUE), + edges = c(1, 3, 2, 4) + ) + expect_snapshot(print(g)) +}) + +test_that("modern print.igraph: empty graph has no edges section", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + expect_snapshot(print(make_empty_graph(0))) + expect_snapshot(print(make_empty_graph(3, directed = FALSE))) +}) + +test_that("modern print.igraph: full mode with all attribute sections", { + local_igraph_options( + print.style = "modern", + print.id = FALSE, + print.full = TRUE, + print.graph.attributes = TRUE, + print.vertex.attributes = TRUE, + print.edge.attributes = TRUE + ) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(3, directed = TRUE) |> + set_vertex_attr("name", value = c("A", "B", "C")) |> + set_edge_attr("weight", value = 1:3) |> + set_graph_attr("name", value = "trio") + expect_snapshot(print(g)) +}) + +test_that("modern print.igraph.vs: single and double bracket", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(3) |> + set_vertex_attr("name", value = c("A", "B", "C")) |> + set_vertex_attr("weight", value = 10:12) + expect_snapshot({ + V(g) + V(g)[1:2] + V(g)[[1]] + V(g)[[2:3]] + }) +}) + +test_that("modern print.igraph.es: single and double bracket", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(3, directed = TRUE) |> + set_vertex_attr("name", value = c("A", "B", "C")) |> + set_edge_attr("weight", value = 1:3) + expect_snapshot({ + E(g) + E(g)[1:2] + E(g)[[1]] + E(g)[[2:3]] + }) +}) + +test_that("modern print.igraph: ASCII fallback when cli.unicode = FALSE", { + local_igraph_options(print.style = "modern", print.id = FALSE) + withr::local_options(cli.num_colors = 1, cli.unicode = FALSE, cli.width = 80) + g <- make_ring(3, directed = TRUE) |> + set_vertex_attr("name", value = c("A", "B", "C")) + expect_snapshot(print(g)) + expect_snapshot(V(g)) + expect_snapshot(E(g)) +}) + +test_that("modern print.igraph: truncation in auto mode", { + local_igraph_options( + print.style = "modern", + print.id = FALSE, + auto.print.lines = 3 + ) + withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) + g <- make_ring(200) + expect_snapshot(print(g)) +}) From 0e92d6a4231fd5f2b99fbef6a7abf882b2686673 Mon Sep 17 00:00:00 2001 From: schochastics Date: Fri, 29 May 2026 20:33:05 +0000 Subject: [PATCH 02/20] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/26660392503 --- R/iterators.R | 96 +++++++++++++++++++++++++++--------- R/print.R | 134 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 169 insertions(+), 61 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index d8e007edea0..7fe75c1891b 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1562,8 +1562,12 @@ print.igraph.es <- function( # Modern (cli-styled) printing for vertex/edge sequences ----------------- -print_igraph_vs_modern <- function(x, full = igraph_opt("print.full"), - id = igraph_opt("print.id"), ...) { +print_igraph_vs_modern <- function( + x, + full = igraph_opt("print.full"), + id = igraph_opt("print.id"), + ... +) { graph <- get_vs_graph(x) vertices <- if (!is.null(graph)) V(graph) else NULL len <- length(x) @@ -1572,20 +1576,35 @@ print_igraph_vs_modern <- function(x, full = igraph_opt("print.full"), dot <- modern_middot() flags <- character() - if (!is.null(vertices) && !is.null(names(vertices))) flags <- c(flags, "named") - if (isTRUE(id) && !is.na(gid)) flags <- c(flags, paste("from", substr(gid, 1, 7))) - if (is.null(graph)) flags <- c(flags, "deleted") - flag_str <- if (length(flags)) paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) else "" + if (!is.null(vertices) && !is.null(names(vertices))) { + flags <- c(flags, "named") + } + if (isTRUE(id) && !is.na(gid)) { + flags <- c(flags, paste("from", substr(gid, 1, 7))) + } + if (is.null(graph)) { + flags <- c(flags, "deleted") + } + flag_str <- if (length(flags)) { + paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) + } else { + "" + } title <- paste0(" ", len, "/", total, flag_str) cat(cli::rule(left = title), "\n", sep = "") - if (is_single_index(x) && !is.null(graph) && - length(vertex_attr_names(graph)) > 0) { + if ( + is_single_index(x) && + !is.null(graph) && + length(vertex_attr_names(graph)) > 0 + ) { va <- vertex_attr(graph) if (all(sapply(va, is.atomic))) { print(as.data.frame(va, stringsAsFactors = FALSE)[ - as.vector(x), , drop = FALSE + as.vector(x), + , + drop = FALSE ]) } else { print(lapply(va, "[", as.vector(x))) @@ -1616,8 +1635,12 @@ print_igraph_vs_modern <- function(x, full = igraph_opt("print.full"), invisible(x) } -print_igraph_es_modern <- function(x, full = igraph_opt("print.full"), - id = igraph_opt("print.id"), ...) { +print_igraph_es_modern <- function( + x, + full = igraph_opt("print.full"), + id = igraph_opt("print.id"), + ... +) { graph <- get_es_graph(x) len <- length(x) total <- if (is.null(graph)) "?" else as.character(gsize(graph)) @@ -1626,15 +1649,27 @@ print_igraph_es_modern <- function(x, full = igraph_opt("print.full"), dot <- modern_middot() flags <- character() - if (has_vnames) flags <- c(flags, "vertex names") - if (isTRUE(id) && !is.na(gid)) flags <- c(flags, paste("from", substr(gid, 1, 7))) - if (is.null(graph)) flags <- c(flags, "deleted") - flag_str <- if (length(flags)) paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) else "" + if (has_vnames) { + flags <- c(flags, "vertex names") + } + if (isTRUE(id) && !is.na(gid)) { + flags <- c(flags, paste("from", substr(gid, 1, 7))) + } + if (is.null(graph)) { + flags <- c(flags, "deleted") + } + flag_str <- if (length(flags)) { + paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) + } else { + "" + } title <- paste0(" ", len, "/", total, flag_str) cat(cli::rule(left = title), "\n", sep = "") - if (len == 0) return(invisible(x)) + if (len == 0) { + return(invisible(x)) + } if (is_single_index(x) && !is.null(graph)) { ea <- edge_attr(graph) @@ -1668,18 +1703,31 @@ print_igraph_es_modern <- function(x, full = igraph_opt("print.full"), if (is.null(ml)) { print(formatted, quote = FALSE) } else { - head_print(formatted, + head_print( + formatted, omitted_footer = "+ ... omitted several edges\n", - quote = FALSE, max_lines = ml + quote = FALSE, + max_lines = ml ) } } else { - body <- if (!is.null(attr(x, "vnames"))) as.vector(attr(x, "vnames")) - else if (!is.null(names(x))) names(x) - else as.vector(x) - if (is.null(ml)) print(body, quote = FALSE) - else head_print(body, omitted_footer = "+ ... omitted several edges\n", - quote = FALSE, max_lines = ml) + body <- if (!is.null(attr(x, "vnames"))) { + as.vector(attr(x, "vnames")) + } else if (!is.null(names(x))) { + names(x) + } else { + as.vector(x) + } + if (is.null(ml)) { + print(body, quote = FALSE) + } else { + head_print( + body, + omitted_footer = "+ ... omitted several edges\n", + quote = FALSE, + max_lines = ml + ) + } } invisible(x) } diff --git a/R/print.R b/R/print.R index 9445c47f2e4..606f4f99caa 100644 --- a/R/print.R +++ b/R/print.R @@ -666,7 +666,8 @@ modern_middot <- function() { } modern_attr_label <- function(code) { - switch(code, + switch( + code, c = "", n = "", l = "", @@ -676,9 +677,13 @@ modern_attr_label <- function(code) { } modern_attr_codes <- function(x, kind) { - if (kind == "graph") .Call(Rx_igraph_get_attr_mode, x, 2L) - else if (kind == "vertex") .Call(Rx_igraph_get_attr_mode, x, 3L) - else .Call(Rx_igraph_get_attr_mode, x, 4L) + if (kind == "graph") { + .Call(Rx_igraph_get_attr_mode, x, 2L) + } else if (kind == "vertex") { + .Call(Rx_igraph_get_attr_mode, x, 3L) + } else { + .Call(Rx_igraph_get_attr_mode, x, 4L) + } } print_igraph_header_modern <- function(x, id) { @@ -697,16 +702,31 @@ print_igraph_header_modern <- function(x, id) { } props <- if (is_directed(x)) "directed" else "undirected" - if (is_named(x)) props <- c(props, "named") - if (is_weighted(x)) props <- c(props, "weighted") - if (is_bipartite(x)) props <- c(props, "bipartite") + if (is_named(x)) { + props <- c(props, "named") + } + if (is_weighted(x)) { + props <- c(props, "weighted") + } + if (is_bipartite(x)) { + props <- c(props, "bipartite") + } dot <- modern_middot() info <- cli::col_cyan(cli::symbol$info) cat(info, " ", paste(props, collapse = paste0(" ", dot, " ")), "\n", sep = "") - cat(info, " ", vcount(x), " vertices ", dot, " ", - ecount(x), " edges\n", sep = "") + cat( + info, + " ", + vcount(x), + " vertices ", + dot, + " ", + ecount(x), + " edges\n", + sep = "" + ) } print_igraph_attr_summary_modern <- function(x) { @@ -730,16 +750,24 @@ print_igraph_attr_summary_modern <- function(x) { } lines <- character() - if (length(ga)) lines <- c(lines, format_line("graph: ", ga, modern_attr_codes(x, "graph"))) - if (length(va)) lines <- c(lines, format_line("vertex: ", va, modern_attr_codes(x, "vertex"))) - if (length(ea)) lines <- c(lines, format_line("edge: ", ea, modern_attr_codes(x, "edge"))) + if (length(ga)) { + lines <- c(lines, format_line("graph: ", ga, modern_attr_codes(x, "graph"))) + } + if (length(va)) { + lines <- c(lines, format_line("vertex: ", va, modern_attr_codes(x, "vertex"))) + } + if (length(ea)) { + lines <- c(lines, format_line("edge: ", ea, modern_attr_codes(x, "edge"))) + } cat(lines, sep = "\n") cat("\n") } print_igraph_graph_attrs_modern <- function(x) { list <- graph_attr_names(x) - if (length(list) == 0) return(invisible(NULL)) + if (length(list) == 0) { + return(invisible(NULL)) + } cat("\n", cli::rule(left = "Graph attributes"), "\n", sep = "") for (n in list) { cat(cli::format_inline("{.field {n}}:"), "\n", sep = "") @@ -748,25 +776,39 @@ print_igraph_graph_attrs_modern <- function(x) { } print_igraph_vertex_attrs_modern <- function(x) { - if (length(vertex_attr_names(x)) == 0) return(invisible(NULL)) + if (length(vertex_attr_names(x)) == 0) { + return(invisible(NULL)) + } cat("\n", cli::rule(left = "Vertex attributes"), "\n", sep = "") # reuse classic tabular renderer .print.vertex.attributes.old(x, full = TRUE, max.lines = NULL) } -print_igraph_edges_modern <- function(x, edges = E(x), names = TRUE, - max.lines = NULL, with_attrs = FALSE) { +print_igraph_edges_modern <- function( + x, + edges = E(x), + names = TRUE, + max.lines = NULL, + with_attrs = FALSE +) { is_named_g <- isTRUE(names) && is_named(x) - if (is_named_g && "name" %in% vertex_attr_names(x) && + if ( + is_named_g && + "name" %in% vertex_attr_names(x) && !is.numeric(vertex_attr(x, "name")) && !is.character(vertex_attr(x, "name")) && - !is.logical(vertex_attr(x, "name"))) { - cli::cli_warn("Can't print vertex names, complex {.val name} vertex attribute.") + !is.logical(vertex_attr(x, "name")) + ) { + cli::cli_warn( + "Can't print vertex names, complex {.val name} vertex attribute." + ) is_named_g <- FALSE } ec <- length(edges) - if (ec == 0) return(invisible(NULL)) + if (ec == 0) { + return(invisible(NULL)) + } title_suffix <- if (is_named_g) " (vertex names)" else "" show_attrs <- with_attrs && length(edge_attr_names(x)) != 0 @@ -793,9 +835,16 @@ print_igraph_edges_modern <- function(x, edges = E(x), names = TRUE, seq_len(nrow(el)) } tab <- data.frame(row.names = paste0("[", ename, "]")) - tab[["edge"]] <- paste0(format(el[, 1], width = w), " ", arrow, " ", - format(el[, 2], width = w)) - for (i in eattrs) tab[[i]] <- edge_attr(x, i) + tab[["edge"]] <- paste0( + format(el[, 1], width = w), + " ", + arrow, + " ", + format(el[, 2], width = w) + ) + for (i in eattrs) { + tab[[i]] <- edge_attr(x, i) + } print(tab) } else { el <- ends(x, edges, names = is_named_g) @@ -803,7 +852,8 @@ print_igraph_edges_modern <- function(x, edges = E(x), names = TRUE, if (is.null(max.lines)) { print(formatted, quote = FALSE) } else { - head_print(formatted, + head_print( + formatted, omitted_footer = "+ ... omitted several edges\n", quote = FALSE, max_lines = max.lines @@ -812,25 +862,35 @@ print_igraph_edges_modern <- function(x, edges = E(x), names = TRUE, } } -print_igraph_modern <- function(x, - full = igraph_opt("print.full"), - graph.attributes = igraph_opt("print.graph.attributes"), - vertex.attributes = igraph_opt("print.vertex.attributes"), - edge.attributes = igraph_opt("print.edge.attributes"), - names = TRUE, - max.lines = igraph_opt("auto.print.lines"), - id = igraph_opt("print.id"), - ...) { +print_igraph_modern <- function( + x, + full = igraph_opt("print.full"), + graph.attributes = igraph_opt("print.graph.attributes"), + vertex.attributes = igraph_opt("print.vertex.attributes"), + edge.attributes = igraph_opt("print.edge.attributes"), + names = TRUE, + max.lines = igraph_opt("auto.print.lines"), + id = igraph_opt("print.id"), + ... +) { print_igraph_header_modern(x, id) print_igraph_attr_summary_modern(x) if (is.logical(full) && isTRUE(full)) { - if (graph.attributes) print_igraph_graph_attrs_modern(x) - if (vertex.attributes) print_igraph_vertex_attrs_modern(x) + if (graph.attributes) { + print_igraph_graph_attrs_modern(x) + } + if (vertex.attributes) { + print_igraph_vertex_attrs_modern(x) + } if (ecount(x) > 0) { if (edge.attributes && length(edge_attr_names(x)) != 0) { - print_igraph_edges_modern(x, names = names, max.lines = NULL, - with_attrs = TRUE) + print_igraph_edges_modern( + x, + names = names, + max.lines = NULL, + with_attrs = TRUE + ) } else { print_igraph_edges_modern(x, names = names, max.lines = NULL) } From 001327c28b5cb085416800ad2fef89be93302877 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Sat, 30 May 2026 09:30:32 +0200 Subject: [PATCH 03/20] Replace literal Unicode characters with escape sequences in print.R --- R/print.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/print.R b/R/print.R index 606f4f99caa..05ac60042f8 100644 --- a/R/print.R +++ b/R/print.R @@ -655,14 +655,14 @@ summary.igraph <- function(object, ...) { modern_edge_arrow <- function(directed) { if (cli::is_utf8_output()) { - if (directed) "→" else "─" + if (directed) "\u2192" else "\u2500" } else { if (directed) "->" else "--" } } modern_middot <- function() { - if (cli::is_utf8_output()) "·" else "*" + if (cli::is_utf8_output()) "\u00b7" else "*" } modern_attr_label <- function(code) { @@ -738,7 +738,7 @@ print_igraph_attr_summary_modern <- function(x) { } cat("\n", cli::rule(left = "Attributes"), "\n", sep = "") - arrow <- if (cli::is_utf8_output()) "→" else "->" + arrow <- if (cli::is_utf8_output()) "\u2192" else "->" format_line <- function(label, names, codes) { parts <- paste0( From c0d817627112e4871b1f90497708175c1c6955b8 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Tue, 2 Jun 2026 20:56:51 +0200 Subject: [PATCH 04/20] address review comments --- R/iterators.R | 164 ++++++++------- R/par.R | 5 +- R/print.R | 192 ++++++++++-------- .../_snaps/{print-modern.md => print-cli.md} | 38 ++-- .../{test-print-modern.R => test-print-cli.R} | 36 ++-- 5 files changed, 239 insertions(+), 196 deletions(-) rename tests/testthat/_snaps/{print-modern.md => print-cli.md} (90%) rename tests/testthat/{test-print-modern.R => test-print-cli.R} (68%) diff --git a/R/iterators.R b/R/iterators.R index 7fe75c1891b..975169290e4 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -523,14 +523,14 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { #' #' # ----------------------------------------------------------------- #' # The same with vertex names -#' g <- make_graph(~ A -+ B, B -+ C:D, D -+ B) +#' g <- make_graph(~A -+ B, B -+ C:D, D -+ B) #' V(g)[.nei(c("B", "D"))] #' V(g)[.nei(c("B", "D"), "in")] #' V(g)[.nei(c("B", "D"), "out")] #' #' # ----------------------------------------------------------------- #' # Resolving attributes -#' g <- make_graph(~ A -+ B, B -+ C:D, D -+ B) +#' g <- make_graph(~A -+ B, B -+ C:D, D -+ B) #' V(g)$color <- c("red", "red", "green", "green") #' V(g)[color == "red"] #' @@ -584,7 +584,12 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ## TRUE iff the vertex is a neighbor (any type) ## of at least one vertex in v mode <- igraph_match_arg(mode) - mode <- switch(mode, "out" = 1, "in" = 2, "all" = 3, "total" = 3) + mode <- switch(mode, + "out" = 1, + "in" = 2, + "all" = 3, + "total" = 3 + ) if (is.logical(v)) { v <- which(v) @@ -1422,8 +1427,8 @@ print.igraph.vs <- function( id = igraph_opt("print.id"), ... ) { - if (identical(igraph_opt("print.style"), "modern")) { - return(print_igraph_vs_modern(x, full = full, id = id, ...)) + if (is_cli_style()) { + return(print_igraph_vs_cli(x, full = full, id = id, ...)) } graph <- get_vs_graph(x) @@ -1459,8 +1464,7 @@ print.igraph.vs <- function( va <- vertex_attr(graph) if (all(sapply(va, is.atomic))) { print(as.data.frame(va, stringsAsFactors = FALSE)[ - as.vector(x), - , + as.vector(x), , drop = FALSE ]) } else { @@ -1543,8 +1547,8 @@ print.igraph.es <- function( id = igraph_opt("print.id"), ... ) { - if (identical(igraph_opt("print.style"), "modern")) { - return(print_igraph_es_modern(x, full = full, id = id, ...)) + if (is_cli_style()) { + return(print_igraph_es_cli(x, full = full, id = id, ...)) } graph <- get_es_graph(x) @@ -1560,9 +1564,9 @@ print.igraph.es <- function( invisible(x) } -# Modern (cli-styled) printing for vertex/edge sequences ----------------- +# cli-styled printing for vertex/edge sequences ----------------- -print_igraph_vs_modern <- function( +print_igraph_vs_cli <- function( x, full = igraph_opt("print.full"), id = igraph_opt("print.id"), @@ -1570,46 +1574,45 @@ print_igraph_vs_modern <- function( ) { graph <- get_vs_graph(x) vertices <- if (!is.null(graph)) V(graph) else NULL - len <- length(x) total <- if (is.null(vertices)) "?" else as.character(length(vertices)) - gid <- graph_id(x) - - dot <- modern_middot() - flags <- character() - if (!is.null(vertices) && !is.null(names(vertices))) { - flags <- c(flags, "named") - } - if (isTRUE(id) && !is.na(gid)) { - flags <- c(flags, paste("from", substr(gid, 1, 7))) - } - if (is.null(graph)) { - flags <- c(flags, "deleted") - } - flag_str <- if (length(flags)) { - paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) - } else { - "" - } + graph_id_short <- graph_id(x) + + middot <- middot_cli() + # `id` comes from an option and may be NULL/NA, so guard with isTRUE(). + flags <- c( + if (!is.null(vertices) && !is.null(names(vertices))) "named", + if (isTRUE(id) && !is.na(graph_id_short)) { + paste("from", substr(graph_id_short, 1, 7)) + }, + if (is.null(graph)) "deleted" + ) - title <- paste0(" ", len, "/", total, flag_str) + title <- paste0( + " ", + length(x), + "/", + total, + flag_suffix_cli(flags, middot) + ) cat(cli::rule(left = title), "\n", sep = "") + # Single index into a graph with attributes: show the attribute table. if ( is_single_index(x) && !is.null(graph) && length(vertex_attr_names(graph)) > 0 ) { - va <- vertex_attr(graph) - if (all(sapply(va, is.atomic))) { - print(as.data.frame(va, stringsAsFactors = FALSE)[ - as.vector(x), - , + vertex_attrs <- vertex_attr(graph) + if (all(sapply(vertex_attrs, is.atomic))) { + print(as.data.frame(vertex_attrs, stringsAsFactors = FALSE)[ + as.vector(x), , drop = FALSE ]) } else { - print(lapply(va, "[", as.vector(x))) + print(lapply(vertex_attrs, "[", as.vector(x))) } } else { + # Otherwise just list the vertices (by name when available). if (!is.null(names(vertices))) { x2 <- names(vertices)[as.vector(x)] if (!is.null(names(x)) && !identical(names(x), x2)) { @@ -1635,45 +1638,44 @@ print_igraph_vs_modern <- function( invisible(x) } -print_igraph_es_modern <- function( +print_igraph_es_cli <- function( x, full = igraph_opt("print.full"), id = igraph_opt("print.id"), ... ) { graph <- get_es_graph(x) - len <- length(x) total <- if (is.null(graph)) "?" else as.character(gsize(graph)) - gid <- graph_id(x) + graph_id_short <- graph_id(x) has_vnames <- !is.null(attr(x, "vnames")) - dot <- modern_middot() - flags <- character() - if (has_vnames) { - flags <- c(flags, "vertex names") - } - if (isTRUE(id) && !is.na(gid)) { - flags <- c(flags, paste("from", substr(gid, 1, 7))) - } - if (is.null(graph)) { - flags <- c(flags, "deleted") - } - flag_str <- if (length(flags)) { - paste0(" ", dot, " ", paste(flags, collapse = paste0(" ", dot, " "))) - } else { - "" - } + middot <- middot_cli() + # `id` comes from an option and may be NULL/NA, so guard with isTRUE(). + flags <- c( + if (has_vnames) "vertex names", + if (isTRUE(id) && !is.na(graph_id_short)) { + paste("from", substr(graph_id_short, 1, 7)) + }, + if (is.null(graph)) "deleted" + ) - title <- paste0(" ", len, "/", total, flag_str) + title <- paste0( + " ", + length(x), + "/", + total, + flag_suffix_cli(flags, middot) + ) cat(cli::rule(left = title), "\n", sep = "") - if (len == 0) { + if (length(x) == 0) { return(invisible(x)) } + # Single index into a graph: show endpoints plus the attribute table. if (is_single_index(x) && !is.null(graph)) { - ea <- edge_attr(graph) - if (all(sapply(ea, is.atomic))) { + edge_attrs <- edge_attr(graph) + if (all(sapply(edge_attrs, is.atomic))) { etail <- tail_of(graph, x) ehead <- head_of(graph, x) df <- data.frame( @@ -1683,34 +1685,52 @@ print_igraph_es_modern <- function( tid = as.vector(etail), hid = as.vector(ehead) ) - if (length(ea)) { - ea <- do_call(data.frame, .args = ea, stringsAsFactors = FALSE) - df <- cbind(df, ea[as.vector(x), , drop = FALSE]) + if (length(edge_attrs)) { + edge_attrs <- do_call( + data.frame, + .args = edge_attrs, + stringsAsFactors = FALSE + ) + df <- cbind(df, edge_attrs[as.vector(x), , drop = FALSE]) } print(df) } else { - print(lapply(ea, "[", as.vector(x))) + print(lapply(edge_attrs, "[", as.vector(x))) } return(invisible(x)) } - ml <- if (identical(full, TRUE)) NULL else igraph_opt("auto.print.lines") + max_lines <- if (identical(full, TRUE)) { + NULL + } else { + igraph_opt("auto.print.lines") + } if (!is.null(graph)) { - arrow <- modern_edge_arrow(is_directed(graph)) - el <- ends(graph, x, names = has_vnames || is_named(graph)) - formatted <- paste0(format(el[, 1]), " ", arrow, " ", format(el[, 2])) - if (is.null(ml)) { + # Live graph: render endpoints with arrows. The trailing space puts two + # spaces between edges once print() adds its own single-space separator. + arrow <- edge_arrow_cli(is_directed(graph)) + endpoints <- ends(graph, x, names = has_vnames || is_named(graph)) + formatted <- paste0( + format(endpoints[, 1]), + " ", + arrow, + " ", + format(endpoints[, 2]), + " " + ) + if (is.null(max_lines)) { print(formatted, quote = FALSE) } else { head_print( formatted, omitted_footer = "+ ... omitted several edges\n", quote = FALSE, - max_lines = ml + max_lines = max_lines ) } } else { + # Graph was deleted: fall back to stored vertex names / ids. body <- if (!is.null(attr(x, "vnames"))) { as.vector(attr(x, "vnames")) } else if (!is.null(names(x))) { @@ -1718,14 +1738,14 @@ print_igraph_es_modern <- function( } else { as.vector(x) } - if (is.null(ml)) { + if (is.null(max_lines)) { print(body, quote = FALSE) } else { head_print( body, omitted_footer = "+ ... omitted several edges\n", quote = FALSE, - max_lines = ml + max_lines = max_lines ) } } diff --git a/R/par.R b/R/par.R index 6f17e124b85..6b2bc649fb8 100644 --- a/R/par.R +++ b/R/par.R @@ -162,7 +162,7 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose) #' [print.igraph()], [summary.igraph()], [print.igraph.vs()] and #' [print.igraph.es()]. Possible values are `"classic"` (default, #' the historical `IGRAPH ... DNW-` header relied on by tutorials and -#' parsers) and `"modern"` (a cli-styled output with section rules, +#' parsers) and `"cli"` (a cli-styled output with section rules, #' Unicode arrows for edges and typed attribute listings). #' } #' \item{return.vs.es}{ @@ -233,8 +233,7 @@ igraph_i_options <- function(..., .in = parent.frame()) { temp <- list(...) if (length(temp) == 1 && is.null(names(temp))) { arg <- temp[[1]] - switch( - mode(arg), + switch(mode(arg), list = temp <- arg, character = return(.igraph.pars[arg]), cli::cli_abort("invalid argument: {arg}.") diff --git a/R/print.R b/R/print.R index 05ac60042f8..30b9a362d8f 100644 --- a/R/print.R +++ b/R/print.R @@ -548,7 +548,7 @@ print_all <- function(object, ...) { #' As of igraph 1.1.1, the `str.igraph` function is defunct, use #' `print_all()`. #' -#' Set `igraph_options(print.style = "modern")` to switch to a cli-styled +#' Set `igraph_options(print.style = "cli")` to switch to a cli-styled #' output with section rules, typed attribute listings and Unicode arrows #' for edges. The default `"classic"` keeps the historical #' `IGRAPH ... DNW-` header relied on by parsers and tutorials. @@ -594,8 +594,8 @@ print.igraph <- function( ) { ensure_igraph(x) - if (identical(igraph_opt("print.style"), "modern")) { - return(print_igraph_modern( + if (is_cli_style()) { + return(print_igraph_cli( x, full = full, graph.attributes = graph.attributes, @@ -644,16 +644,27 @@ print.igraph <- function( #' @family print #' @export summary.igraph <- function(object, ...) { - if (identical(igraph_opt("print.style"), "modern")) { - return(summary_igraph_modern(object)) + if (is_cli_style()) { + return(summary_igraph_cli(object)) } .print.header(object) invisible(object) } -# Modern (cli-styled) printing ------------------------------------------- +# cli-styled printing ---------------------------------------------------- -modern_edge_arrow <- function(directed) { +# igraph_opt() may return NULL; NULL == "cli" breaks if(), so use identical() +is_cli_style <- function() { + identical(igraph_opt("print.style"), "cli") +} + +# Leading + interleaved middot separators for a vector of flag labels; +# returns "" when there are no flags (avoids an if/else at the call site). +flag_suffix_cli <- function(flags, middot) { + paste(c("", flags), collapse = paste0(" ", middot, " ")) +} + +edge_arrow_cli <- function(directed) { if (cli::is_utf8_output()) { if (directed) "\u2192" else "\u2500" } else { @@ -661,13 +672,12 @@ modern_edge_arrow <- function(directed) { } } -modern_middot <- function() { +middot_cli <- function() { if (cli::is_utf8_output()) "\u00b7" else "*" } -modern_attr_label <- function(code) { - switch( - code, +attr_label_cli <- function(code) { + switch(code, c = "", n = "", l = "", @@ -676,7 +686,7 @@ modern_attr_label <- function(code) { ) } -modern_attr_codes <- function(x, kind) { +attr_codes_cli <- function(x, kind) { if (kind == "graph") { .Call(Rx_igraph_get_attr_mode, x, 2L) } else if (kind == "vertex") { @@ -686,42 +696,41 @@ modern_attr_codes <- function(x, kind) { } } -print_igraph_header_modern <- function(x, id) { +print_igraph_header_cli <- function(x, id) { name <- if ("name" %in% graph_attr_names(x)) as.character(x$name)[1] else NULL title <- if (!is.null(name) && !is.na(name) && nzchar(name)) { paste0(" ", name) } else { "" } - gid <- if (isTRUE(id)) substr(graph_id(x), 1, 7) else NA_character_ + # `id` comes from an option and may be NULL/NA, so guard with isTRUE(). + graph_id_short <- if (isTRUE(id)) substr(graph_id(x), 1, 7) else NA_character_ - if (!is.na(gid) && nzchar(gid)) { - cat(cli::rule(left = title, right = gid), "\n", sep = "") + # Show the graph id on the right of the rule only when we have one. + if (!is.na(graph_id_short) && nzchar(graph_id_short)) { + cat(cli::rule(left = title, right = graph_id_short), "\n", sep = "") } else { cat(cli::rule(left = title), "\n", sep = "") } - props <- if (is_directed(x)) "directed" else "undirected" - if (is_named(x)) { - props <- c(props, "named") - } - if (is_weighted(x)) { - props <- c(props, "weighted") - } - if (is_bipartite(x)) { - props <- c(props, "bipartite") - } + properties <- c( + if (is_directed(x)) "directed" else "undirected", + if (is_named(x)) "named", + if (is_weighted(x)) "weighted", + if (is_bipartite(x)) "bipartite" + ) - dot <- modern_middot() - info <- cli::col_cyan(cli::symbol$info) + middot <- middot_cli() + sep <- paste0(" ", middot, " ") + info_symbol <- cli::col_cyan(cli::symbol$info) - cat(info, " ", paste(props, collapse = paste0(" ", dot, " ")), "\n", sep = "") + cat(info_symbol, " ", paste(properties, collapse = sep), "\n", sep = "") cat( - info, + info_symbol, " ", vcount(x), " vertices ", - dot, + middot, " ", ecount(x), " edges\n", @@ -729,11 +738,15 @@ print_igraph_header_modern <- function(x, id) { ) } -print_igraph_attr_summary_modern <- function(x) { - ga <- graph_attr_names(x) - va <- vertex_attr_names(x) - ea <- edge_attr_names(x) - if (length(ga) == 0 && length(va) == 0 && length(ea) == 0) { +print_igraph_attr_summary_cli <- function(x) { + graph_attrs <- graph_attr_names(x) + vertex_attrs <- vertex_attr_names(x) + edge_attrs <- edge_attr_names(x) + if ( + length(graph_attrs) == 0 && + length(vertex_attrs) == 0 && + length(edge_attrs) == 0 + ) { return(invisible(NULL)) } @@ -744,38 +757,39 @@ print_igraph_attr_summary_modern <- function(x) { parts <- paste0( cli::col_yellow(names), " ", - cli::col_silver(vapply(codes, modern_attr_label, character(1))) + cli::col_silver(vapply(codes, attr_label_cli, character(1))) ) paste0(arrow, " ", label, paste(parts, collapse = ", ")) } - lines <- character() - if (length(ga)) { - lines <- c(lines, format_line("graph: ", ga, modern_attr_codes(x, "graph"))) - } - if (length(va)) { - lines <- c(lines, format_line("vertex: ", va, modern_attr_codes(x, "vertex"))) - } - if (length(ea)) { - lines <- c(lines, format_line("edge: ", ea, modern_attr_codes(x, "edge"))) - } + lines <- c( + if (length(graph_attrs)) { + format_line("graph: ", graph_attrs, attr_codes_cli(x, "graph")) + }, + if (length(vertex_attrs)) { + format_line("vertex: ", vertex_attrs, attr_codes_cli(x, "vertex")) + }, + if (length(edge_attrs)) { + format_line("edge: ", edge_attrs, attr_codes_cli(x, "edge")) + } + ) cat(lines, sep = "\n") cat("\n") } -print_igraph_graph_attrs_modern <- function(x) { - list <- graph_attr_names(x) - if (length(list) == 0) { +print_igraph_graph_attrs_cli <- function(x) { + attr_names <- graph_attr_names(x) + if (length(attr_names) == 0) { return(invisible(NULL)) } cat("\n", cli::rule(left = "Graph attributes"), "\n", sep = "") - for (n in list) { - cat(cli::format_inline("{.field {n}}:"), "\n", sep = "") - indent_print(graph_attr(x, n), .indent = " ") + for (attr_name in attr_names) { + cat(cli::format_inline("{.field {attr_name}}:"), "\n", sep = "") + indent_print(graph_attr(x, attr_name), .indent = " ") } } -print_igraph_vertex_attrs_modern <- function(x) { +print_igraph_vertex_attrs_cli <- function(x) { if (length(vertex_attr_names(x)) == 0) { return(invisible(NULL)) } @@ -784,7 +798,7 @@ print_igraph_vertex_attrs_modern <- function(x) { .print.vertex.attributes.old(x, full = TRUE, max.lines = NULL) } -print_igraph_edges_modern <- function( +print_igraph_edges_cli <- function( x, edges = E(x), names = TRUE, @@ -805,8 +819,8 @@ print_igraph_edges_modern <- function( is_named_g <- FALSE } - ec <- length(edges) - if (ec == 0) { + n_edges <- length(edges) + if (n_edges == 0) { return(invisible(NULL)) } @@ -819,36 +833,46 @@ print_igraph_edges_modern <- function( } cat("\n", cli::rule(left = title), "\n", sep = "") - arrow <- modern_edge_arrow(is_directed(x)) + arrow <- edge_arrow_cli(is_directed(x)) + endpoints <- ends(x, edges, names = is_named_g) if (show_attrs) { - eattrs <- setdiff(edge_attr_names(x), "name") - el <- ends(x, edges, names = is_named_g) - if (is.numeric(el)) { - w <- nchar(max(el)) + # Tabular layout: one row per edge, endpoints in an "edge" column + # followed by one column per (non-name) edge attribute. + other_attrs <- setdiff(edge_attr_names(x), "name") + width <- if (is.numeric(endpoints)) { + nchar(max(endpoints)) } else { - w <- max(nchar(el)) + max(nchar(endpoints)) } - ename <- if ("name" %in% edge_attr_names(x)) { + edge_names <- if ("name" %in% edge_attr_names(x)) { paste0("'", edge_attr(x, "name"), "'") } else { - seq_len(nrow(el)) + seq_len(nrow(endpoints)) } - tab <- data.frame(row.names = paste0("[", ename, "]")) + tab <- data.frame(row.names = paste0("[", edge_names, "]")) tab[["edge"]] <- paste0( - format(el[, 1], width = w), + format(endpoints[, 1], width = width), " ", arrow, " ", - format(el[, 2], width = w) + format(endpoints[, 2], width = width) ) - for (i in eattrs) { - tab[[i]] <- edge_attr(x, i) + for (attr_name in other_attrs) { + tab[[attr_name]] <- edge_attr(x, attr_name) } print(tab) } else { - el <- ends(x, edges, names = is_named_g) - formatted <- paste0(format(el[, 1]), " ", arrow, " ", format(el[, 2])) + # Plain edge list. The trailing space puts two spaces between edges + # once print() adds its own single-space separator. + formatted <- paste0( + format(endpoints[, 1]), + " ", + arrow, + " ", + format(endpoints[, 2]), + " " + ) if (is.null(max.lines)) { print(formatted, quote = FALSE) } else { @@ -862,7 +886,7 @@ print_igraph_edges_modern <- function( } } -print_igraph_modern <- function( +print_igraph_cli <- function( x, full = igraph_opt("print.full"), graph.attributes = igraph_opt("print.graph.attributes"), @@ -873,37 +897,37 @@ print_igraph_modern <- function( id = igraph_opt("print.id"), ... ) { - print_igraph_header_modern(x, id) - print_igraph_attr_summary_modern(x) + print_igraph_header_cli(x, id) + print_igraph_attr_summary_cli(x) - if (is.logical(full) && isTRUE(full)) { + if (isTRUE(full)) { if (graph.attributes) { - print_igraph_graph_attrs_modern(x) + print_igraph_graph_attrs_cli(x) } if (vertex.attributes) { - print_igraph_vertex_attrs_modern(x) + print_igraph_vertex_attrs_cli(x) } if (ecount(x) > 0) { if (edge.attributes && length(edge_attr_names(x)) != 0) { - print_igraph_edges_modern( + print_igraph_edges_cli( x, names = names, max.lines = NULL, with_attrs = TRUE ) } else { - print_igraph_edges_modern(x, names = names, max.lines = NULL) + print_igraph_edges_cli(x, names = names, max.lines = NULL) } } } else if (identical(full, "auto")) { - print_igraph_edges_modern(x, names = names, max.lines = max.lines) + print_igraph_edges_cli(x, names = names, max.lines = max.lines) } invisible(x) } -summary_igraph_modern <- function(object) { - print_igraph_header_modern(object, id = igraph_opt("print.id")) - print_igraph_attr_summary_modern(object) +summary_igraph_cli <- function(object) { + print_igraph_header_cli(object, id = igraph_opt("print.id")) + print_igraph_attr_summary_cli(object) invisible(object) } diff --git a/tests/testthat/_snaps/print-modern.md b/tests/testthat/_snaps/print-cli.md similarity index 90% rename from tests/testthat/_snaps/print-modern.md rename to tests/testthat/_snaps/print-cli.md index e3132eaaf55..e4eca8eee64 100644 --- a/tests/testthat/_snaps/print-modern.md +++ b/tests/testthat/_snaps/print-cli.md @@ -1,4 +1,4 @@ -# modern print.igraph: undirected unnamed ring +# cli print.igraph: undirected unnamed ring Code print(g) @@ -12,7 +12,7 @@ ── Edges ─────────────────────────────────────────────────────────────────────── - [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 1 ─ 5 + [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 1 ─ 5 --- @@ -27,7 +27,7 @@ → graph: name , mutual , circular -# modern print.igraph: directed named weighted +# cli print.igraph: directed named weighted Code print(g) @@ -43,7 +43,7 @@ ── Edges (vertex names) ──────────────────────────────────────────────────────── - [1] A → B B → C C → A + [1] A → B B → C C → A --- @@ -60,7 +60,7 @@ → edge: weight -# modern print.igraph: bipartite +# cli print.igraph: bipartite Code print(g) @@ -74,9 +74,9 @@ ── Edges ─────────────────────────────────────────────────────────────────────── - [1] 1 ─ 3 2 ─ 4 + [1] 1 ─ 3 2 ─ 4 -# modern print.igraph: empty graph has no edges section +# cli print.igraph: empty graph has no edges section Code print(make_empty_graph(0)) @@ -94,7 +94,7 @@ ℹ undirected ℹ 3 vertices · 0 edges -# modern print.igraph: full mode with all attribute sections +# cli print.igraph: full mode with all attribute sections Code print(g) @@ -129,7 +129,7 @@ [2] B → C 2 [3] C → A 3 -# modern print.igraph.vs: single and double bracket +# cli print.igraph.vs: single and double bracket Code V(g) @@ -155,18 +155,18 @@ 2 B 11 3 C 12 -# modern print.igraph.es: single and double bracket +# cli print.igraph.es: single and double bracket Code E(g) Output ── 3/3 · vertex names ────────────────────────────────────────── - [1] A → B B → C C → A + [1] A → B B → C C → A Code E(g)[1:2] Output ── 2/3 · vertex names ────────────────────────────────────────── - [1] A → B B → C + [1] A → B B → C Code E(g)[[1]] Output @@ -181,7 +181,7 @@ 2 B C 2 3 2 3 C A 3 1 3 -# modern print.igraph: ASCII fallback when cli.unicode = FALSE +# cli print.igraph: ASCII fallback when cli.unicode = FALSE Code print(g) @@ -196,7 +196,7 @@ -- Edges (vertex names) -------------------------------------------------------- - [1] A -> B B -> C C -> A + [1] A -> B B -> C C -> A --- @@ -212,9 +212,9 @@ E(g) Output -- 3/3 * vertex names ------------------------------------------ - [1] A -> B B -> C C -> A + [1] A -> B B -> C C -> A -# modern print.igraph: truncation in auto mode +# cli print.igraph: truncation in auto mode Code print(g) @@ -228,8 +228,8 @@ ── Edges ─────────────────────────────────────────────────────────────────────── - [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 7 ─ 8 - [8] 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 13 ─ 14 14 ─ 15 - [15] 15 ─ 16 16 ─ 17 17 ─ 18 18 ─ 19 19 ─ 20 20 ─ 21 21 ─ 22 + [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 + [7] 7 ─ 8 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 + [13] 13 ─ 14 14 ─ 15 15 ─ 16 16 ─ 17 17 ─ 18 18 ─ 19 + ... omitted several edges diff --git a/tests/testthat/test-print-modern.R b/tests/testthat/test-print-cli.R similarity index 68% rename from tests/testthat/test-print-modern.R rename to tests/testthat/test-print-cli.R index c49398a5e4f..bbb6fd055a4 100644 --- a/tests/testthat/test-print-modern.R +++ b/tests/testthat/test-print-cli.R @@ -1,13 +1,13 @@ -test_that("modern print.igraph: undirected unnamed ring", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph: undirected unnamed ring", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(5) expect_snapshot(print(g)) expect_snapshot(summary(g)) }) -test_that("modern print.igraph: directed named weighted", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph: directed named weighted", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -17,8 +17,8 @@ test_that("modern print.igraph: directed named weighted", { expect_snapshot(summary(g)) }) -test_that("modern print.igraph: bipartite", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph: bipartite", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_bipartite_graph( types = c(FALSE, FALSE, TRUE, TRUE), @@ -27,16 +27,16 @@ test_that("modern print.igraph: bipartite", { expect_snapshot(print(g)) }) -test_that("modern print.igraph: empty graph has no edges section", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph: empty graph has no edges section", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) expect_snapshot(print(make_empty_graph(0))) expect_snapshot(print(make_empty_graph(3, directed = FALSE))) }) -test_that("modern print.igraph: full mode with all attribute sections", { +test_that("cli print.igraph: full mode with all attribute sections", { local_igraph_options( - print.style = "modern", + print.style = "cli", print.id = FALSE, print.full = TRUE, print.graph.attributes = TRUE, @@ -51,8 +51,8 @@ test_that("modern print.igraph: full mode with all attribute sections", { expect_snapshot(print(g)) }) -test_that("modern print.igraph.vs: single and double bracket", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph.vs: single and double bracket", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -65,8 +65,8 @@ test_that("modern print.igraph.vs: single and double bracket", { }) }) -test_that("modern print.igraph.es: single and double bracket", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph.es: single and double bracket", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -79,8 +79,8 @@ test_that("modern print.igraph.es: single and double bracket", { }) }) -test_that("modern print.igraph: ASCII fallback when cli.unicode = FALSE", { - local_igraph_options(print.style = "modern", print.id = FALSE) +test_that("cli print.igraph: ASCII fallback when cli.unicode = FALSE", { + local_igraph_options(print.style = "cli", print.id = FALSE) withr::local_options(cli.num_colors = 1, cli.unicode = FALSE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) @@ -89,9 +89,9 @@ test_that("modern print.igraph: ASCII fallback when cli.unicode = FALSE", { expect_snapshot(E(g)) }) -test_that("modern print.igraph: truncation in auto mode", { +test_that("cli print.igraph: truncation in auto mode", { local_igraph_options( - print.style = "modern", + print.style = "cli", print.id = FALSE, auto.print.lines = 3 ) From b2818cad50108429251f18e51768aa6da0e32eeb Mon Sep 17 00:00:00 2001 From: schochastics Date: Tue, 2 Jun 2026 19:05:01 +0000 Subject: [PATCH 05/20] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/26841389965 --- R/iterators.R | 13 +++++-------- R/par.R | 3 ++- R/print.R | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index 975169290e4..6e4acdcd259 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -584,12 +584,7 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { ## TRUE iff the vertex is a neighbor (any type) ## of at least one vertex in v mode <- igraph_match_arg(mode) - mode <- switch(mode, - "out" = 1, - "in" = 2, - "all" = 3, - "total" = 3 - ) + mode <- switch(mode, "out" = 1, "in" = 2, "all" = 3, "total" = 3) if (is.logical(v)) { v <- which(v) @@ -1464,7 +1459,8 @@ print.igraph.vs <- function( va <- vertex_attr(graph) if (all(sapply(va, is.atomic))) { print(as.data.frame(va, stringsAsFactors = FALSE)[ - as.vector(x), , + as.vector(x), + , drop = FALSE ]) } else { @@ -1605,7 +1601,8 @@ print_igraph_vs_cli <- function( vertex_attrs <- vertex_attr(graph) if (all(sapply(vertex_attrs, is.atomic))) { print(as.data.frame(vertex_attrs, stringsAsFactors = FALSE)[ - as.vector(x), , + as.vector(x), + , drop = FALSE ]) } else { diff --git a/R/par.R b/R/par.R index 6b2bc649fb8..6524cfbe13d 100644 --- a/R/par.R +++ b/R/par.R @@ -233,7 +233,8 @@ igraph_i_options <- function(..., .in = parent.frame()) { temp <- list(...) if (length(temp) == 1 && is.null(names(temp))) { arg <- temp[[1]] - switch(mode(arg), + switch( + mode(arg), list = temp <- arg, character = return(.igraph.pars[arg]), cli::cli_abort("invalid argument: {arg}.") diff --git a/R/print.R b/R/print.R index 30b9a362d8f..b2b82b3fa42 100644 --- a/R/print.R +++ b/R/print.R @@ -677,7 +677,8 @@ middot_cli <- function() { } attr_label_cli <- function(code) { - switch(code, + switch( + code, c = "", n = "", l = "", From e8a2fcde414f47097e662b9c30f4ef71fc5baf4a Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 09:50:33 +0200 Subject: [PATCH 06/20] Remove fixed-width padding of edge endpoints in plain edge list printing --- R/print.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/print.R b/R/print.R index b2b82b3fa42..b91fc1ae7c7 100644 --- a/R/print.R +++ b/R/print.R @@ -864,14 +864,16 @@ print_igraph_edges_cli <- function( } print(tab) } else { - # Plain edge list. The trailing space puts two spaces between edges - # once print() adds its own single-space separator. + # Plain edge list. Endpoints are not padded to a common width, so each + # edge reads as "tail ─ head" with a single space around the delimiter. + # The trailing space puts two spaces between edges once print() adds its + # own single-space separator. formatted <- paste0( - format(endpoints[, 1]), + endpoints[, 1], " ", arrow, " ", - format(endpoints[, 2]), + endpoints[, 2], " " ) if (is.null(max.lines)) { From 74fc03c02d67b974913b54d217b4ac4c54bac335 Mon Sep 17 00:00:00 2001 From: schochastics Date: Thu, 4 Jun 2026 07:58:26 +0000 Subject: [PATCH 07/20] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/26938465003 --- tests/testthat/_snaps/print-cli.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/_snaps/print-cli.md b/tests/testthat/_snaps/print-cli.md index e4eca8eee64..ec41841ff94 100644 --- a/tests/testthat/_snaps/print-cli.md +++ b/tests/testthat/_snaps/print-cli.md @@ -228,8 +228,8 @@ ── Edges ─────────────────────────────────────────────────────────────────────── - [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 - [7] 7 ─ 8 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 - [13] 13 ─ 14 14 ─ 15 15 ─ 16 16 ─ 17 17 ─ 18 18 ─ 19 + [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 + [7] 7 ─ 8 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 + [13] 13 ─ 14 14 ─ 15 15 ─ 16 16 ─ 17 17 ─ 18 18 ─ 19 + ... omitted several edges From 46bc32025cf3e66c7084231dc720277705a77958 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 15:27:38 +0200 Subject: [PATCH 08/20] make cli default print and fix unnecessary blank lines --- R/iterators.R | 7 +- R/par.R | 10 +- R/print.R | 5 +- tests/testthat/_snaps/aaa-auto.md | 2082 +++++++++++------ tests/testthat/_snaps/adjacency.md | 134 +- tests/testthat/_snaps/flow.md | 6 +- tests/testthat/_snaps/foreign.md | 26 +- tests/testthat/_snaps/incidence.md | 82 +- tests/testthat/_snaps/iterators.md | 42 +- tests/testthat/_snaps/make.md | 175 +- tests/testthat/_snaps/other.md | 26 +- tests/testthat/_snaps/print-cli.md | 8 - .../testthat/_snaps/structural-properties.md | 10 +- tests/testthat/_snaps/trees.md | 15 +- tests/testthat/_snaps/versions.md | 45 +- tests/testthat/test-games.R | 2 + tests/testthat/test-print.R | 18 +- 17 files changed, 1738 insertions(+), 955 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index 6e4acdcd259..62d4d891f10 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1708,12 +1708,15 @@ print_igraph_es_cli <- function( # spaces between edges once print() adds its own single-space separator. arrow <- edge_arrow_cli(is_directed(graph)) endpoints <- ends(graph, x, names = has_vnames || is_named(graph)) + # Endpoints are not padded to a common width, so each edge reads as + # "tail ─ head" with a single space around the delimiter. The trailing + # space puts two spaces between edges once print() adds its own separator. formatted <- paste0( - format(endpoints[, 1]), + endpoints[, 1], " ", arrow, " ", - format(endpoints[, 2]), + endpoints[, 2], " " ) if (is.null(max_lines)) { diff --git a/R/par.R b/R/par.R index 23952837f6d..b76f25024a4 100644 --- a/R/par.R +++ b/R/par.R @@ -72,7 +72,7 @@ getIgraphOpt <- function(x, default = NULL) { "auto.print.lines" = 10, "return.vs.es" = TRUE, "print.id" = TRUE, - "print.style" = "classic" + "print.style" = "cli" ) igraph.pars.set.verbose <- function(verbose) { @@ -160,10 +160,10 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose) #' \item{print.style}{ #' Character string controlling the visual style used by #' [print.igraph()], [summary.igraph()], [print.igraph.vs()] and -#' [print.igraph.es()]. Possible values are `"classic"` (default, -#' the historical `IGRAPH ... DNW-` header relied on by tutorials and -#' parsers) and `"cli"` (a cli-styled output with section rules, -#' Unicode arrows for edges and typed attribute listings). +#' [print.igraph.es()]. Possible values are `"cli"` (default, a +#' cli-styled output with section rules, Unicode arrows for edges and +#' typed attribute listings) and `"classic"` (the historical +#' `IGRAPH ... DNW-` header relied on by tutorials and parsers). #' } #' \item{return.vs.es}{ #' Whether functions that return a set or sequence of vertices/edges diff --git a/R/print.R b/R/print.R index b91fc1ae7c7..b9458fa05f3 100644 --- a/R/print.R +++ b/R/print.R @@ -774,8 +774,9 @@ print_igraph_attr_summary_cli <- function(x) { format_line("edge: ", edge_attrs, attr_codes_cli(x, "edge")) } ) - cat(lines, sep = "\n") - cat("\n") + # One newline per line, no trailing blank: each section starts with its own + # leading blank, so emitting one here would double the gap to the next one. + cat(paste0(lines, "\n"), sep = "") } print_igraph_graph_attrs_cli <- function(x) { diff --git a/tests/testthat/_snaps/aaa-auto.md b/tests/testthat/_snaps/aaa-auto.md index ecfe53099c6..ed9de94f88f 100644 --- a/tests/testthat/_snaps/aaa-auto.md +++ b/tests/testthat/_snaps/aaa-auto.md @@ -3,16 +3,18 @@ Code empty_impl() Output - IGRAPH D--- 0 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 0 vertices * 0 edges --- Code empty_impl(n = 5, directed = FALSE) Output - IGRAPH U--- 5 0 -- - + edges: + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 0 edges # empty_impl errors @@ -28,9 +30,12 @@ Code add_edges_impl(graph = g, edges = c(1, 2, 2, 3)) Output - IGRAPH D--- 3 2 -- - + edges: - [1] 1->2 2->3 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 # add_edges_impl errors @@ -45,8 +50,9 @@ Code copy_impl(from = g) Output - IGRAPH D--- 2 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 0 edges # copy_impl errors @@ -62,8 +68,9 @@ delete_vertices_idx_impl(graph = g, vertices = 1) Output $graph - IGRAPH D--- 2 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 0 edges $idx [1] 0 1 2 @@ -122,7 +129,7 @@ Code get_all_eids_between_impl(graph = g, from = 1, to = 2) Output - + 0/0 edges: + -- 0/0 --------------------------------------------------------- # get_all_eids_between_impl errors @@ -137,18 +144,24 @@ Code wheel_impl(n = 5) Output - IGRAPH D--- 5 8 -- - + edges: - [1] 1->2 1->3 1->4 1->5 2->3 3->4 4->5 5->2 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 8 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 1 -> 4 1 -> 5 2 -> 3 3 -> 4 4 -> 5 5 -> 2 --- Code wheel_impl(n = 5, mode = "in", center = 2) Output - IGRAPH D--- 5 8 -- - + edges: - [1] 1->3 2->3 4->3 5->3 1->2 2->4 4->5 5->1 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 8 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 3 2 -> 3 4 -> 3 5 -> 3 1 -> 2 2 -> 4 4 -> 5 5 -> 1 # wheel_impl errors @@ -164,18 +177,26 @@ Code hypercube_impl(n = 3) Output - IGRAPH U--- 8 12 -- - + edges: - [1] 1--2 1--3 1--5 2--4 2--6 3--4 3--7 4--8 5--6 5--7 6--8 7--8 + -- -------------------------------------------------------------------- + i undirected + i 8 vertices * 12 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 4 3 -- 7 4 -- 8 5 -- 6 + [10] 5 -- 7 6 -- 8 7 -- 8 --- Code hypercube_impl(n = 3, directed = TRUE) Output - IGRAPH D--- 8 12 -- - + edges: - [1] 1->2 1->3 1->5 2->4 2->6 3->4 3->7 4->8 5->6 5->7 6->8 7->8 + -- -------------------------------------------------------------------- + i directed + i 8 vertices * 12 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 1 -> 5 2 -> 4 2 -> 6 3 -> 4 3 -> 7 4 -> 8 5 -> 6 + [10] 5 -> 7 6 -> 8 7 -> 8 # hypercube_impl errors @@ -191,9 +212,12 @@ Code square_lattice_impl(dimvector = c(2, 2)) Output - IGRAPH U--- 4 4 -- - + edges: - [1] 1--2 1--3 2--4 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 4 3 -- 4 --- @@ -201,9 +225,13 @@ square_lattice_impl(dimvector = c(2, 2), nei = 2, directed = TRUE, mutual = TRUE, periodic = c(TRUE, TRUE)) Output - IGRAPH D--- 4 10 -- - + edges: - [1] 1->2 1->3 2->1 2->4 3->4 3->1 4->3 4->2 1->4 2->3 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 4 3 -> 4 3 -> 1 4 -> 3 4 -> 2 1 -> 4 + [10] 2 -> 3 # square_lattice_impl errors @@ -219,18 +247,25 @@ Code triangular_lattice_impl(dimvector = c(2, 2)) Output - IGRAPH U--- 4 5 -- - + edges: - [1] 1--2 1--4 1--3 2--4 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 5 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 4 1 -- 3 2 -- 4 3 -- 4 --- Code triangular_lattice_impl(dimvector = c(2, 2), directed = TRUE, mutual = TRUE) Output - IGRAPH D--- 4 10 -- - + edges: - [1] 1->2 2->1 1->4 4->1 1->3 3->1 2->4 4->2 3->4 4->3 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 1 1 -> 4 4 -> 1 1 -> 3 3 -> 1 2 -> 4 4 -> 2 3 -> 4 + [10] 4 -> 3 # triangular_lattice_impl errors @@ -246,18 +281,24 @@ Code path_graph_impl(n = 5) Output - IGRAPH U--- 5 4 -- - + edges: - [1] 1--2 2--3 3--4 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 --- Code path_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output - IGRAPH D--- 5 8 -- - + edges: - [1] 1->2 2->1 2->3 3->2 3->4 4->3 4->5 5->4 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 8 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 1 2 -> 3 3 -> 2 3 -> 4 4 -> 3 4 -> 5 5 -> 4 # path_graph_impl errors @@ -273,18 +314,25 @@ Code cycle_graph_impl(n = 5) Output - IGRAPH U--- 5 5 -- - + edges: - [1] 1--2 2--3 3--4 4--5 1--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 5 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 --- Code cycle_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output - IGRAPH D--- 5 10 -- - + edges: - [1] 1->2 2->1 2->3 3->2 3->4 4->3 4->5 5->4 5->1 1->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 1 2 -> 3 3 -> 2 3 -> 4 4 -> 3 4 -> 5 5 -> 4 5 -> 1 + [10] 1 -> 5 # cycle_graph_impl errors @@ -300,18 +348,24 @@ Code symmetric_tree_impl(branches = 3) Output - IGRAPH D--- 4 3 -- - + edges: - [1] 1->2 1->3 1->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 1 -> 4 --- Code symmetric_tree_impl(branches = 3, type = "in") Output - IGRAPH D--- 4 3 -- - + edges: - [1] 2->1 3->1 4->1 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 1 4 -> 1 # symmetric_tree_impl errors @@ -327,19 +381,26 @@ Code regular_tree_impl(h = 2) Output - IGRAPH U--- 10 9 -- - + edges: - [1] 1-- 2 1-- 3 1-- 4 2-- 5 2-- 6 3-- 7 3-- 8 4-- 9 4--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 9 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 5 2 -- 6 3 -- 7 3 -- 8 4 -- 9 + [9] 4 -- 10 --- Code regular_tree_impl(h = 2, k = 4, type = "in") Output - IGRAPH D--- 17 16 -- - + edges: - [1] 2->1 3->1 4->1 5->1 6->2 7->2 8->2 9->3 10->3 11->3 12->4 13->4 - [13] 14->4 15->5 16->5 17->5 + -- -------------------------------------------------------------------- + i directed + i 17 vertices * 16 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 1 4 -> 1 5 -> 1 6 -> 2 7 -> 2 8 -> 2 9 -> 3 + [9] 10 -> 3 11 -> 3 12 -> 4 13 -> 4 14 -> 4 15 -> 5 16 -> 5 17 -> 5 # regular_tree_impl errors @@ -355,18 +416,26 @@ Code full_citation_impl(n = 5) Output - IGRAPH D--- 5 10 -- - + edges: - [1] 2->1 3->1 3->2 4->1 4->2 4->3 5->1 5->2 5->3 5->4 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 1 3 -> 2 4 -> 1 4 -> 2 4 -> 3 5 -> 1 5 -> 2 5 -> 3 + [10] 5 -> 4 --- Code full_citation_impl(n = 5, directed = FALSE) Output - IGRAPH U--- 5 10 -- - + edges: - [1] 1--2 1--3 2--3 1--4 2--4 3--4 1--5 2--5 3--5 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 3 -- 4 1 -- 5 2 -- 5 3 -- 5 + [10] 4 -- 5 # full_citation_impl errors @@ -382,17 +451,21 @@ Code atlas_impl(number = 0) Output - IGRAPH U--- 0 0 -- - + edges: + -- -------------------------------------------------------------------- + i undirected + i 0 vertices * 0 edges --- Code atlas_impl(number = 5) Output - IGRAPH U--- 3 1 -- - + edge: - [1] 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 3 # atlas_impl errors @@ -408,18 +481,26 @@ Code extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2))) Output - IGRAPH U--- 5 15 -- - + edges: - [1] 1--2 2--3 3--4 4--5 1--5 1--2 1--3 2--3 2--4 3--4 3--5 4--5 1--4 1--5 2--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 15 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 1 -- 2 1 -- 3 2 -- 3 2 -- 4 + [10] 3 -- 4 3 -- 5 4 -- 5 1 -- 4 1 -- 5 2 -- 5 --- Code extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2)), directed = TRUE) Output - IGRAPH D--- 5 15 -- - + edges: - [1] 1->2 2->3 3->4 4->5 5->1 1->2 1->3 2->3 2->4 3->4 3->5 4->5 4->1 5->1 5->2 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 15 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 4 4 -> 5 5 -> 1 1 -> 2 1 -> 3 2 -> 3 2 -> 4 + [10] 3 -> 4 3 -> 5 4 -> 5 4 -> 1 5 -> 1 5 -> 2 # extended_chordal_ring_impl errors @@ -435,18 +516,24 @@ Code graph_power_impl(graph = g, order = 2) Output - IGRAPH U--- 5 7 -- - + edges: - [1] 1--2 2--3 3--4 4--5 1--3 2--4 3--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 3 2 -- 4 3 -- 5 --- Code graph_power_impl(graph = g, order = 2, directed = TRUE) Output - IGRAPH U--- 5 7 -- - + edges: - [1] 1--2 2--3 3--4 4--5 1--3 2--4 3--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 3 2 -- 4 3 -- 5 # graph_power_impl errors @@ -461,9 +548,12 @@ Code linegraph_impl(graph = g) Output - IGRAPH U--- 4 3 -- - + edges: - [1] 1--2 2--3 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 # linegraph_impl errors @@ -478,10 +568,13 @@ Code de_bruijn_impl(m = 2, n = 3) Output - IGRAPH D--- 8 16 -- - + edges: - [1] 1->1 1->2 2->3 2->4 3->5 3->6 4->7 4->8 5->1 5->2 6->3 6->4 7->5 7->6 8->7 - [16] 8->8 + -- -------------------------------------------------------------------- + i directed + i 8 vertices * 16 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 1 1 -> 2 2 -> 3 2 -> 4 3 -> 5 3 -> 6 4 -> 7 4 -> 8 5 -> 1 + [10] 5 -> 2 6 -> 3 6 -> 4 7 -> 5 7 -> 6 8 -> 7 8 -> 8 # de_bruijn_impl errors @@ -497,13 +590,18 @@ Code kautz_impl(m = 2, n = 3) Output - IGRAPH D--- 24 48 -- - + edges: - [1] 1-> 9 1->10 2->11 2->12 3->13 3->14 4->15 4->16 5->17 5->18 - [11] 6->19 6->20 7->21 7->22 8->23 8->24 9-> 1 9-> 2 10-> 3 10-> 4 - [21] 11-> 5 11-> 6 12-> 7 12-> 8 13->17 13->18 14->19 14->20 15->21 15->22 - [31] 16->23 16->24 17-> 1 17-> 2 18-> 3 18-> 4 19-> 5 19-> 6 20-> 7 20-> 8 - [41] 21-> 9 21->10 22->11 22->12 23->13 23->14 24->15 24->16 + -- -------------------------------------------------------------------- + i directed + i 24 vertices * 48 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 9 1 -> 10 2 -> 11 2 -> 12 3 -> 13 3 -> 14 4 -> 15 + [8] 4 -> 16 5 -> 17 5 -> 18 6 -> 19 6 -> 20 7 -> 21 7 -> 22 + [15] 8 -> 23 8 -> 24 9 -> 1 9 -> 2 10 -> 3 10 -> 4 11 -> 5 + [22] 11 -> 6 12 -> 7 12 -> 8 13 -> 17 13 -> 18 14 -> 19 14 -> 20 + [29] 15 -> 21 15 -> 22 16 -> 23 16 -> 24 17 -> 1 17 -> 2 18 -> 3 + [36] 18 -> 4 19 -> 5 19 -> 6 20 -> 7 20 -> 8 21 -> 9 21 -> 10 + [43] 22 -> 11 22 -> 12 23 -> 13 23 -> 14 24 -> 15 24 -> 16 # kautz_impl errors @@ -519,11 +617,16 @@ Code lcf_vector_impl(n = 10, shifts = c(3, -3, 4), repeats = 2) Output - IGRAPH U--- 10 16 -- LCF graph - + attr: name (g/c) - + edges: - [1] 1-- 2 1-- 4 1--10 2-- 3 2-- 5 2-- 9 3-- 4 3-- 7 4-- 5 4-- 7 5-- 6 6-- 7 - [13] 6--10 7-- 8 8-- 9 9--10 + -- LCF graph ---------------------------------------------------------- + i undirected + i 10 vertices * 16 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 4 1 -- 10 2 -- 3 2 -- 5 2 -- 9 3 -- 4 3 -- 7 + [9] 4 -- 5 4 -- 7 5 -- 6 6 -- 7 6 -- 10 7 -- 8 8 -- 9 9 -- 10 # lcf_vector_impl errors @@ -539,9 +642,12 @@ Code mycielski_graph_impl(k = 3) Output - IGRAPH U--- 5 5 -- - + edges: - [1] 1--2 1--4 2--3 3--5 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 5 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 4 2 -- 3 3 -- 5 4 -- 5 # mycielski_graph_impl errors @@ -557,9 +663,12 @@ Code adjlist_impl(adjlist = list(c(2, 3), c(1), c(1)), mode = "out") Output - IGRAPH D--- 3 4 -- - + edges: - [1] 1->2 1->3 2->1 3->1 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 1 3 -> 1 # adjlist_impl errors @@ -576,9 +685,12 @@ full_bipartite_impl(n1 = 2, n2 = 3) Output $graph - IGRAPH U--- 5 6 -- - + edges: - [1] 1--3 1--4 1--5 2--3 2--4 2--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 4 1 -- 5 2 -- 3 2 -- 4 2 -- 5 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -590,9 +702,12 @@ full_bipartite_impl(n1 = 2, n2 = 3, directed = TRUE, mode = "in") Output $graph - IGRAPH D--- 5 6 -- - + edges: - [1] 3->1 4->1 5->1 3->2 4->2 5->2 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 4 -> 1 5 -> 1 3 -> 2 4 -> 2 5 -> 2 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -613,10 +728,14 @@ full_multipartite_impl(n = c(2, 3, 4)) Output $graph - IGRAPH U--- 9 26 -- - + edges: - [1] 1--3 1--4 1--5 1--6 1--7 1--8 1--9 2--3 2--4 2--5 2--6 2--7 2--8 2--9 3--6 - [16] 3--7 3--8 3--9 4--6 4--7 4--8 4--9 5--6 5--7 5--8 5--9 + -- -------------------------------------------------------------------- + i undirected + i 9 vertices * 26 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 2 -- 3 2 -- 4 + [10] 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 3 -- 6 3 -- 7 3 -- 8 3 -- 9 + [19] 4 -- 6 4 -- 7 4 -- 8 4 -- 9 5 -- 6 5 -- 7 5 -- 8 5 -- 9 $types [1] 1 1 2 2 2 3 3 3 3 @@ -637,10 +756,14 @@ full_multipartite_impl(n = c(2, 3, 4), directed = TRUE, mode = "in") Output $graph - IGRAPH D--- 9 26 -- - + edges: - [1] 3->1 4->1 5->1 6->1 7->1 8->1 9->1 3->2 4->2 5->2 6->2 7->2 8->2 9->2 6->3 - [16] 7->3 8->3 9->3 6->4 7->4 8->4 9->4 6->5 7->5 8->5 9->5 + -- -------------------------------------------------------------------- + i directed + i 9 vertices * 26 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 4 -> 1 5 -> 1 6 -> 1 7 -> 1 8 -> 1 9 -> 1 3 -> 2 4 -> 2 + [10] 5 -> 2 6 -> 2 7 -> 2 8 -> 2 9 -> 2 6 -> 3 7 -> 3 8 -> 3 9 -> 3 + [19] 6 -> 4 7 -> 4 8 -> 4 9 -> 4 6 -> 5 7 -> 5 8 -> 5 9 -> 5 $types [1] 1 1 2 2 2 3 3 3 3 @@ -669,11 +792,15 @@ Code realize_degree_sequence_impl(out_deg = c(2, 2, 2)) Output - IGRAPH U--- 3 3 -- Graph from degree sequence - + attr: name (g/c), out_deg (g/n), in_deg (g/x), allowed_edge_types - | (g/n), method (g/n) - + edges: - [1] 2--3 1--3 1--2 + -- Graph from degree sequence ----------------------------------------- + i undirected + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , out_deg , in_deg , allowed_edge_types , method + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 3 1 -- 3 1 -- 2 --- @@ -681,11 +808,15 @@ realize_degree_sequence_impl(out_deg = c(2, 2, 2), in_deg = c(2, 2, 2), allowed_edge_types = "simple", method = "largest") Output - IGRAPH D--- 3 6 -- Graph from degree sequence - + attr: name (g/c), out_deg (g/n), in_deg (g/n), allowed_edge_types - | (g/n), method (g/n) - + edges: - [1] 1->2 1->3 2->1 2->3 3->1 3->2 + -- Graph from degree sequence ----------------------------------------- + i directed + i 3 vertices * 6 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , out_deg , in_deg , allowed_edge_types , method + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 3 3 -> 1 3 -> 2 # realize_degree_sequence_impl errors @@ -701,11 +832,15 @@ Code realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2)) Output - IGRAPH U--- 4 4 -- Bipartite graph from degree sequence - + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed_edge_types - | (g/n), method (g/n) - + edges: - [1] 2--3 2--4 1--4 1--3 + -- Bipartite graph from degree sequence ------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , degrees1 , degrees2 , allowed_edge_types , method + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 3 2 -- 4 1 -- 4 1 -- 3 --- @@ -713,11 +848,15 @@ realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2), allowed_edge_types = "loops", method = "largest") Output - IGRAPH U--- 4 4 -- Bipartite graph from degree sequence - + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed_edge_types - | (g/n), method (g/n) - + edges: - [1] 1--3 1--4 2--3 2--4 + -- Bipartite graph from degree sequence ------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , degrees1 , degrees2 , allowed_edge_types , method + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 4 2 -- 3 2 -- 4 # realize_bipartite_degree_sequence_impl errors @@ -733,20 +872,32 @@ Code circulant_impl(n = 5, shifts = c(1, 2)) Output - IGRAPH U--- 5 10 -- Circulant graph - + attr: name (g/c), shifts (g/n) - + edges: - [1] 1--2 2--3 3--4 4--5 1--5 1--3 2--4 3--5 1--4 2--5 + -- Circulant graph ---------------------------------------------------- + i undirected + i 5 vertices * 10 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , shifts + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 1 -- 3 2 -- 4 3 -- 5 1 -- 4 + [10] 2 -- 5 --- Code circulant_impl(n = 5, shifts = c(1, 2), directed = TRUE) Output - IGRAPH D--- 5 10 -- Circulant graph - + attr: name (g/c), shifts (g/n) - + edges: - [1] 1->2 2->3 3->4 4->5 5->1 1->3 2->4 3->5 4->1 5->2 + -- Circulant graph ---------------------------------------------------- + i directed + i 5 vertices * 10 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , shifts + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 4 4 -> 5 5 -> 1 1 -> 3 2 -> 4 3 -> 5 4 -> 1 + [10] 5 -> 2 # circulant_impl errors @@ -762,10 +913,13 @@ Code generalized_petersen_impl(n = 5, k = 2) Output - IGRAPH U--- 10 15 -- - + edges: - [1] 1-- 2 1-- 6 6-- 8 2-- 3 2-- 7 7-- 9 3-- 4 3-- 8 8--10 4-- 5 4-- 9 6-- 9 - [13] 1-- 5 5--10 7--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 15 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 6 6 -- 8 2 -- 3 2 -- 7 7 -- 9 3 -- 4 3 -- 8 + [9] 8 -- 10 4 -- 5 4 -- 9 6 -- 9 1 -- 5 5 -- 10 7 -- 10 # generalized_petersen_impl errors @@ -782,9 +936,12 @@ turan_impl(n = 5, r = 2) Output $graph - IGRAPH U--- 5 6 -- - + edges: - [1] 1--4 1--5 2--4 2--5 3--4 3--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 4 1 -- 5 2 -- 4 2 -- 5 3 -- 4 3 -- 5 $types [1] 1 1 1 2 2 @@ -813,18 +970,25 @@ Code erdos_renyi_game_gnp_impl(n = 5, p = 0.5) Output - IGRAPH U--- 5 7 -- - + edges: - [1] 1--2 1--3 2--3 1--4 2--4 1--5 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 --- Code erdos_renyi_game_gnp_impl(n = 5, p = 0.5, directed = TRUE, loops = TRUE) Output - IGRAPH D--- 5 12 -- - + edges: - [1] 2->1 3->1 4->1 2->2 1->3 2->3 4->3 1->4 2->4 5->4 3->5 4->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 12 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 1 4 -> 1 2 -> 2 1 -> 3 2 -> 3 4 -> 3 1 -> 4 2 -> 4 + [10] 5 -> 4 3 -> 5 4 -> 5 # erdos_renyi_game_gnp_impl errors @@ -840,18 +1004,24 @@ Code erdos_renyi_game_gnm_impl(n = 5, m = 3) Output - IGRAPH U--- 5 3 -- - + edges: - [1] 3--4 2--5 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -- 4 2 -- 5 4 -- 5 --- Code erdos_renyi_game_gnm_impl(n = 5, m = 3, directed = TRUE, loops = TRUE) Output - IGRAPH D--- 5 3 -- - + edges: - [1] 4->3 5->3 3->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 4 -> 3 5 -> 3 3 -> 5 # erdos_renyi_game_gnm_impl errors @@ -867,30 +1037,45 @@ Code growing_random_game_impl(n = 5, m = 2) Output - IGRAPH D--- 5 8 -- Growing random graph - + attr: name (g/c), m (g/n), citation (g/l) - + edges: - [1] 2->2 1->2 3->3 3->3 3->3 1->2 2->2 5->4 + -- Growing random graph ----------------------------------------------- + i directed + i 5 vertices * 8 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , m , citation + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 2 1 -> 2 3 -> 3 3 -> 3 3 -> 3 1 -> 2 2 -> 2 5 -> 4 --- Code growing_random_game_impl(n = 5, m = 2, directed = FALSE, citation = TRUE) Output - IGRAPH U--- 5 8 -- Growing random graph - + attr: name (g/c), m (g/n), citation (g/l) - + edges: - [1] 1--2 1--2 2--3 1--3 1--4 2--4 1--5 4--5 + -- Growing random graph ----------------------------------------------- + i undirected + i 5 vertices * 8 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , m , citation + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 2 -- 3 1 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 --- Code growing_random_game_impl(n = 10, m = 1, directed = TRUE, citation = FALSE) Output - IGRAPH D--- 10 9 -- Growing random graph - + attr: name (g/c), m (g/n), citation (g/l) - + edges: - [1] 2->2 2->3 4->4 4->4 3->2 1->3 1->8 5->6 5->4 + -- Growing random graph ----------------------------------------------- + i directed + i 10 vertices * 9 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , m , citation + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 2 2 -> 3 4 -> 4 4 -> 4 3 -> 2 1 -> 3 1 -> 8 5 -> 6 5 -> 4 # growing_random_game_impl errors @@ -908,9 +1093,12 @@ fixed_sizes = FALSE, pref_matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph - IGRAPH U--- 5 4 -- - + edges: - [1] 1--3 3--4 1--4 1--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 3 -- 4 1 -- 4 1 -- 5 $node_type_vec [1] 1 0 0 1 1 @@ -934,9 +1122,12 @@ c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph - IGRAPH D--- 5 9 -- - + edges: - [1] 2->4 4->2 5->2 1->3 4->3 4->5 3->1 1->4 1->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 9 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 4 4 -> 2 5 -> 2 1 -> 3 4 -> 3 4 -> 5 3 -> 1 1 -> 4 1 -> 5 $node_type_out_vec [1] 1 0 1 1 1 @@ -961,9 +1152,12 @@ Code rewire_edges_impl(graph = g, prob = 0.5) Output - IGRAPH U--- 5 4 -- - + edges: - [1] 2--4 3--4 1--3 2--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 4 3 -- 4 1 -- 3 2 -- 5 # rewire_edges_impl errors @@ -978,9 +1172,12 @@ Code rewire_directed_edges_impl(graph = g, prob = 0.5) Output - IGRAPH D--- 5 4 -- - + edges: - [1] 1->4 2->3 3->2 4->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 4 2 -> 3 3 -> 2 4 -> 5 # rewire_directed_edges_impl errors @@ -995,10 +1192,15 @@ Code forest_fire_game_impl(nodes = 5, fw_prob = 0.5) Output - IGRAPH D--- 5 9 -- Forest fire model - + attr: name (g/c), fw_prob (g/n), bw_factor (g/n), ambs (g/n) - + edges: - [1] 2->1 3->2 4->2 4->1 4->3 5->1 5->2 5->4 5->3 + -- Forest fire model -------------------------------------------------- + i directed + i 5 vertices * 9 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , fw_prob , bw_factor , ambs + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 2 4 -> 2 4 -> 1 4 -> 3 5 -> 1 5 -> 2 5 -> 4 5 -> 3 --- @@ -1006,10 +1208,15 @@ forest_fire_game_impl(nodes = 5, fw_prob = 0.5, bw_factor = 0.2, ambs = 2, directed = FALSE) Output - IGRAPH U--- 5 4 -- Forest fire model - + attr: name (g/c), fw_prob (g/n), bw_factor (g/n), ambs (g/n) - + edges: - [1] 1--2 1--3 1--4 4--5 + -- Forest fire model -------------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , fw_prob , bw_factor , ambs + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 4 -- 5 # forest_fire_game_impl errors @@ -1026,11 +1233,15 @@ simple_interconnected_islands_game_impl(islands_n = 2, islands_size = 3, islands_pin = 0.5, n_inter = 1) Output - IGRAPH U--- 6 5 -- Interconnected islands model - + attr: name (g/c), islands_n (g/n), islands_size (g/n), islands_pin - | (g/n), n_inter (g/n) - + edges: - [1] 1--2 1--3 2--3 3--6 5--6 + -- Interconnected islands model --------------------------------------- + i undirected + i 6 vertices * 5 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , islands_n , islands_size , islands_pin , n_inter + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 3 -- 6 5 -- 6 # simple_interconnected_islands_game_impl errors @@ -1047,10 +1258,15 @@ Code chung_lu_game_impl(out_weights = c(2, 2, 2)) Output - IGRAPH U--- 3 5 -- Chung-Lu model - + attr: name (g/c), variant (g/n) - + edges: - [1] 1--2 1--3 2--2 2--3 3--3 + -- Chung-Lu model ----------------------------------------------------- + i undirected + i 3 vertices * 5 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , variant + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 2 2 -- 3 3 -- 3 --- @@ -1058,10 +1274,15 @@ chung_lu_game_impl(out_weights = c(1, 2, 3), in_weights = c(1, 2, 3), loops = FALSE, variant = "maxent") Output - IGRAPH D--- 3 1 -- Chung-Lu model - + attr: name (g/c), variant (g/n) - + edge: - [1] 3->1 + -- Chung-Lu model ----------------------------------------------------- + i directed + i 3 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , variant + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 # chung_lu_game_impl errors @@ -1077,10 +1298,15 @@ Code static_fitness_game_impl(no_of_edges = 3, fitness_out = c(1, 2, 3)) Output - IGRAPH U--- 3 3 -- Static fitness model - + attr: name (g/c), loops (g/l), multiple (g/l) - + edges: - [1] 1--2 1--3 2--3 + -- Static fitness model ----------------------------------------------- + i undirected + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , loops , multiple + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 --- @@ -1088,10 +1314,15 @@ static_fitness_game_impl(no_of_edges = 3, fitness_out = c(1, 2, 3), fitness_in = c( 1, 2, 3), loops = TRUE, multiple = TRUE) Output - IGRAPH D--- 3 3 -- Static fitness model - + attr: name (g/c), loops (g/l), multiple (g/l) - + edges: - [1] 1->2 2->3 1->3 + -- Static fitness model ----------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , loops , multiple + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 1 -> 3 # static_fitness_game_impl errors @@ -1107,11 +1338,15 @@ Code static_power_law_game_impl(no_of_nodes = 5, no_of_edges = 4, exponent_out = 2.5) Output - IGRAPH U--- 5 4 -- Static power law model - + attr: name (g/c), exponent_out (g/n), exponent_in (g/n), loops (g/l), - | multiple (g/l), finite_size_correction (g/l) - + edges: - [1] 1--5 2--4 3--5 4--5 + -- Static power law model --------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , exponent_out , exponent_in , loops , multiple , finite_size_correction + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 5 2 -- 4 3 -- 5 4 -- 5 --- @@ -1119,11 +1354,15 @@ static_power_law_game_impl(no_of_nodes = 5, no_of_edges = 4, exponent_out = 2.5, exponent_in = 2, loops = TRUE, multiple = TRUE, finite_size_correction = FALSE) Output - IGRAPH D--- 5 4 -- Static power law model - + attr: name (g/c), exponent_out (g/n), exponent_in (g/n), loops (g/l), - | multiple (g/l), finite_size_correction (g/l) - + edges: - [1] 1->1 3->5 1->4 5->1 + -- Static power law model --------------------------------------------- + i directed + i 5 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , exponent_out , exponent_in , loops , multiple , finite_size_correction + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 1 3 -> 5 1 -> 4 5 -> 1 # static_power_law_game_impl errors @@ -1139,20 +1378,31 @@ Code k_regular_game_impl(no_of_nodes = 5, k = 2) Output - IGRAPH U--- 5 5 -- k-regular graph - + attr: name (g/c), k (g/n) - + edges: - [1] 1--3 1--5 2--3 2--4 4--5 + -- k-regular graph ---------------------------------------------------- + i undirected + i 5 vertices * 5 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , k + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 5 2 -- 3 2 -- 4 4 -- 5 --- Code k_regular_game_impl(no_of_nodes = 5, k = 2, directed = TRUE, multiple = TRUE) Output - IGRAPH D--- 5 10 -- k-regular graph - + attr: name (g/c), k (g/n) - + edges: - [1] 3->4 3->3 2->1 5->5 1->5 4->3 5->2 4->1 1->2 2->4 + -- k-regular graph ---------------------------------------------------- + i directed + i 5 vertices * 10 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , k + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 4 3 -> 3 2 -> 1 5 -> 5 1 -> 5 4 -> 3 5 -> 2 4 -> 1 1 -> 2 + [10] 2 -> 4 # k_regular_game_impl errors @@ -1168,10 +1418,15 @@ Code sbm_game_impl(n = 5, pref_matrix = matrix(0.5, 2, 2), block_sizes = c(2, 3)) Output - IGRAPH U--- 5 6 -- Stochastic block model - + attr: name (g/c), loops (g/l) - + edges: - [1] 1--2 1--3 2--3 1--4 1--5 3--5 + -- Stochastic block model --------------------------------------------- + i undirected + i 5 vertices * 6 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , loops + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 1 -- 5 3 -- 5 --- @@ -1179,10 +1434,16 @@ sbm_game_impl(n = 5, pref_matrix = matrix(0.5, 2, 2), block_sizes = c(2, 3), directed = TRUE, loops = TRUE) Output - IGRAPH D--- 5 14 -- Stochastic block model - + attr: name (g/c), loops (g/l) - + edges: - [1] 1->1 2->1 2->4 1->5 4->1 5->1 5->2 3->3 5->3 3->4 4->4 5->4 3->5 5->5 + -- Stochastic block model --------------------------------------------- + i directed + i 5 vertices * 14 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , loops + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 1 2 -> 1 2 -> 4 1 -> 5 4 -> 1 5 -> 1 5 -> 2 3 -> 3 5 -> 3 + [10] 3 -> 4 4 -> 4 5 -> 4 3 -> 5 5 -> 5 # sbm_game_impl errors @@ -1198,10 +1459,15 @@ Code hsbm_game_impl(n = 6, m = 2, rho = c(0.5, 0.5), C = matrix(1, 2, 2), p = 0.5) Output - IGRAPH U--- 6 9 -- Hierarchical stochastic block model - + attr: name (g/c), m (g/n), rho (g/n), C (g/n), p (g/n) - + edges: - [1] 1--2 3--4 5--6 1--4 1--5 2--5 1--6 4--5 3--6 + -- Hierarchical stochastic block model -------------------------------- + i undirected + i 6 vertices * 9 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , m , rho , C , p + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 3 -- 4 5 -- 6 1 -- 4 1 -- 5 2 -- 5 1 -- 6 4 -- 5 3 -- 6 # hsbm_game_impl errors @@ -1218,17 +1484,24 @@ hsbm_list_game_impl(n = 100, mlist = list(50, 50), rholist = list(c(3, 3, 4) / 10), Clist = list(C), p = 1 / 20) Output - IGRAPH U--- 100 783 -- Hierarchical stochastic block model - + attr: name (g/c), p (g/n) - + edges: - [1] 1-- 2 1-- 3 2-- 3 1-- 4 2-- 4 3-- 4 1-- 5 2-- 5 3-- 5 4-- 5 - [11] 1-- 6 2-- 6 3-- 6 4-- 6 5-- 6 1-- 7 2-- 7 3-- 7 4-- 7 5-- 7 - [21] 6-- 7 1-- 8 2-- 8 3-- 8 4-- 8 5-- 8 6-- 8 7-- 8 1-- 9 2-- 9 - [31] 3-- 9 4-- 9 5-- 9 6-- 9 7-- 9 8-- 9 1--10 2--10 3--10 4--10 - [41] 5--10 6--10 7--10 8--10 9--10 1--11 2--11 3--11 4--11 5--11 - [51] 6--11 7--11 8--11 9--11 10--11 1--12 2--12 3--12 4--12 5--12 - [61] 6--12 7--12 8--12 9--12 10--12 11--12 1--13 2--13 3--13 4--13 - [71] 5--13 6--13 7--13 8--13 9--13 10--13 11--13 12--13 1--14 2--14 + -- Hierarchical stochastic block model -------------------------------- + i undirected + i 100 vertices * 783 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , p + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 3 -- 4 + [7] 1 -- 5 2 -- 5 3 -- 5 4 -- 5 1 -- 6 2 -- 6 + [13] 3 -- 6 4 -- 6 5 -- 6 1 -- 7 2 -- 7 3 -- 7 + [19] 4 -- 7 5 -- 7 6 -- 7 1 -- 8 2 -- 8 3 -- 8 + [25] 4 -- 8 5 -- 8 6 -- 8 7 -- 8 1 -- 9 2 -- 9 + [31] 3 -- 9 4 -- 9 5 -- 9 6 -- 9 7 -- 9 8 -- 9 + [37] 1 -- 10 2 -- 10 3 -- 10 4 -- 10 5 -- 10 6 -- 10 + [43] 7 -- 10 8 -- 10 9 -- 10 1 -- 11 2 -- 11 3 -- 11 + [49] 4 -- 11 5 -- 11 6 -- 11 7 -- 11 8 -- 11 9 -- 11 + [55] 10 -- 11 1 -- 12 2 -- 12 3 -- 12 4 -- 12 5 -- 12 + ... omitted several edges # hsbm_list_game_impl errors @@ -1246,10 +1519,15 @@ Code correlated_game_impl(old_graph = g, corr = 0.5) Output - IGRAPH U--- 5 3 -- Correlated random graph - + attr: name (g/c), corr (g/n), p (g/n) - + edges: - [1] 1--3 3--4 2--5 + -- Correlated random graph -------------------------------------------- + i undirected + i 5 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , corr , p + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 3 -- 4 2 -- 5 # correlated_game_impl errors @@ -1265,14 +1543,20 @@ correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5) Output $graph1 - IGRAPH U--- 5 7 -- - + edges: - [1] 1--2 1--3 2--3 1--4 2--4 1--5 4--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 $graph2 - IGRAPH U--- 5 7 -- - + edges: - [1] 1--2 1--3 2--3 1--4 2--4 1--5 3--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 3 -- 5 --- @@ -1281,14 +1565,21 @@ correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5, directed = TRUE) Output $graph1 - IGRAPH D--- 5 10 -- - + edges: - [1] 4->1 5->1 2->5 4->2 5->2 3->5 1->4 2->4 4->5 5->4 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 4 -> 1 5 -> 1 2 -> 5 4 -> 2 5 -> 2 3 -> 5 1 -> 4 2 -> 4 4 -> 5 + [10] 5 -> 4 $graph2 - IGRAPH D--- 5 9 -- - + edges: - [1] 1->5 2->1 2->5 4->2 4->3 1->4 2->4 4->5 5->4 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 9 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 5 2 -> 1 2 -> 5 4 -> 2 4 -> 3 1 -> 4 2 -> 4 4 -> 5 5 -> 4 # correlated_pair_game_impl errors @@ -1309,9 +1600,12 @@ Greater than 1 connection probability in dot-product graph. Source: games/dotproduct.c:90 Output - IGRAPH U--- 2 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 --- @@ -1322,9 +1616,12 @@ Greater than 1 connection probability in dot-product graph. Source: games/dotproduct.c:90 Output - IGRAPH D--- 2 2 -- - + edges: - [1] 1->2 2->1 + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 1 # dot_product_game_impl errors @@ -1523,12 +1820,12 @@ get_shortest_path_impl(graph = g, from = 1, to = 3) Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # get_shortest_path_impl errors @@ -1545,12 +1842,12 @@ get_shortest_path_bellman_ford_impl(graph = g, from = 1, to = 3) Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # get_shortest_path_bellman_ford_impl errors @@ -1567,12 +1864,12 @@ get_shortest_path_dijkstra_impl(graph = g, from = 1, to = 3) Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # get_shortest_path_dijkstra_impl errors @@ -1590,14 +1887,14 @@ Output $vpaths $vpaths[[1]] - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $epaths $epaths[[1]] - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $nrgeo @@ -1619,14 +1916,14 @@ Output $vpaths $vpaths[[1]] - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $epaths $epaths[[1]] - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $nrgeo @@ -1690,7 +1987,7 @@ Code get_all_simple_paths_impl(graph = g, from = 1, to = 3) Output - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 # get_all_simple_paths_impl errors @@ -1708,14 +2005,14 @@ Output $vpaths $vpaths[[1]] - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $epaths $epaths[[1]] - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 @@ -1733,12 +2030,12 @@ get_widest_path_impl(graph = g, from = 1, to = 3, weights = c(1, 2)) Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # get_widest_path_impl errors @@ -1756,14 +2053,14 @@ Output $vertices $vertices[[1]] - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges $edges[[1]] - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $parents @@ -1786,16 +2083,16 @@ Code spanner_impl(graph = g, stretch = 2) Output - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 --- Code spanner_impl(graph = g, stretch = 2) Output - + 5/5 edges: - [1] 1--2 2--3 3--4 4--5 1--5 + -- 5/5 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 # spanner_impl errors @@ -2094,9 +2391,12 @@ Code induced_subgraph_impl(graph = g, vids = 1:2) Output - IGRAPH U--- 2 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 # induced_subgraph_impl errors @@ -2111,9 +2411,12 @@ Code subgraph_from_edges_impl(graph = g, eids = 1) Output - IGRAPH U--- 2 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 # subgraph_from_edges_impl errors @@ -2128,9 +2431,12 @@ Code reverse_edges_impl(graph = g) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # reverse_edges_impl errors @@ -2177,18 +2483,24 @@ Code simplify_impl(graph = g) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 --- Code simplify_impl(graph = g, remove_multiple = FALSE, remove_loops = FALSE) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # simplify_impl errors @@ -2409,14 +2721,14 @@ Code feedback_arc_set_impl(graph = g) Output - + 0/2 edges: + -- 0/2 --------------------------------------------------------- --- Code feedback_arc_set_impl(graph = g, algo = "exact_ip") Output - + 0/2 edges: + -- 0/2 --------------------------------------------------------- # feedback_arc_set_impl errors @@ -2431,7 +2743,7 @@ Code feedback_vertex_set_impl(graph = g) Output - + 0/3 vertices: + -- 0/3 ------------------------------------------------------- # feedback_vertex_set_impl errors @@ -2915,9 +3227,12 @@ unfold_tree_impl(graph = g, roots = 1) Output $tree - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $vertex_index [1] 1 2 3 @@ -2929,9 +3244,12 @@ unfold_tree_impl(graph = g, mode = "in", roots = 1) Output $tree - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $vertex_index [1] 1 2 3 @@ -2998,7 +3316,7 @@ [1] 3 2 1 $alpham1 - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 3 2 1 @@ -3663,9 +3981,12 @@ Code contract_vertices_impl(graph = g, mapping = c(1, 1, 2)) Output - IGRAPH U--- 2 2 -- - + edges: - [1] 1--1 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 1 1 -- 2 # contract_vertices_impl errors @@ -3702,7 +4023,7 @@ Code graph_center_dijkstra_impl(graph = g) Output - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 --- @@ -3710,7 +4031,7 @@ Code graph_center_dijkstra_impl(graph = g, mode = "in") Output - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 # graph_center_dijkstra_impl errors @@ -3841,12 +4162,12 @@ random_walk_impl(graph = g, start = 1, steps = 2) Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $edges - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 --- @@ -3855,12 +4176,12 @@ random_walk_impl(graph = g, start = 1, steps = 2, mode = "in", stuck = "error") Output $vertices - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 1 $edges - + 2/2 edges: - [1] 1--2 1--2 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 1 -- 2 # random_walk_impl errors @@ -3942,9 +4263,12 @@ Code transitive_closure_dag_impl(graph = g) Output - IGRAPH D--- 3 3 -- - + edges: - [1] 1->3 1->2 2->3 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 3 1 -> 2 2 -> 3 # transitive_closure_dag_impl errors @@ -3959,9 +4283,12 @@ Code transitive_closure_impl(graph = g) Output - IGRAPH U--- 3 3 -- - + edges: - [1] 1--2 1--3 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 # transitive_closure_impl errors @@ -4018,7 +4345,7 @@ bfs_simple_impl(graph = g, root = 1) Output $order - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $layers @@ -4034,7 +4361,7 @@ bfs_simple_impl(graph = g, root = 1, mode = "in") Output $order - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 $layers @@ -4084,9 +4411,12 @@ biadjacency_impl(incidence = m) Output $graph - IGRAPH U--- 5 4 -- - + edges: - [1] 1--3 1--4 1--5 2--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 4 1 -- 5 2 -- 5 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -4098,9 +4428,12 @@ biadjacency_impl(incidence = m, directed = TRUE, mode = "in", multiple = TRUE) Output $graph - IGRAPH D--- 5 4 -- - + edges: - [1] 3->1 4->1 5->1 5->2 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 4 -> 1 5 -> 1 5 -> 2 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -4166,9 +4499,12 @@ bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5) Output $graph - IGRAPH U--- 4 4 -- - + edges: - [1] 1--3 2--3 1--4 2--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 2 -- 3 1 -- 4 2 -- 4 $types [1] FALSE FALSE TRUE TRUE @@ -4180,9 +4516,12 @@ bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5, directed = TRUE, mode = "in") Output $graph - IGRAPH D--- 4 1 -- - + edge: - [1] 3->2 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 2 $types [1] FALSE FALSE TRUE TRUE @@ -4203,9 +4542,12 @@ bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1) Output $graph - IGRAPH U--- 4 1 -- - + edge: - [1] 2--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 4 $types [1] FALSE FALSE TRUE TRUE @@ -4217,9 +4559,12 @@ bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1, directed = TRUE, mode = "in") Output $graph - IGRAPH D--- 4 1 -- - + edge: - [1] 3->1 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 $types [1] FALSE FALSE TRUE TRUE @@ -4375,7 +4720,7 @@ Code articulation_points_impl(graph = g) Output - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 # articulation_points_impl errors @@ -4396,36 +4741,36 @@ $tree_edges $tree_edges[[1]] - + 1/2 edge: - [1] 2--3 + -- 1/2 --------------------------------------------------------- + [1] 2 -- 3 $tree_edges[[2]] - + 1/2 edge: - [1] 1--2 + -- 1/2 --------------------------------------------------------- + [1] 1 -- 2 $component_edges $component_edges[[1]] - + 1/2 edge: - [1] 2--3 + -- 1/2 --------------------------------------------------------- + [1] 2 -- 3 $component_edges[[2]] - + 1/2 edge: - [1] 1--2 + -- 1/2 --------------------------------------------------------- + [1] 1 -- 2 $components $components[[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 3 2 $components[[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 1 $articulation_points - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 @@ -4442,8 +4787,8 @@ Code bridges_impl(graph = g) Output - + 2/2 edges: - [1] 2--3 1--2 + -- 2/2 --------------------------------------------------------- + [1] 2 -- 3 1 -- 2 # bridges_impl errors @@ -4578,23 +4923,23 @@ cliques_impl(graph = g) Output [[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 [[2]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 3 [[3]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 [[4]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 [[5]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -4604,11 +4949,11 @@ cliques_impl(graph = g, min = 2, max = 2) Output [[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 [[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -4648,11 +4993,11 @@ largest_cliques_impl(graph = g) Output [[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 [[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 @@ -4707,23 +5052,23 @@ weighted_cliques_impl(graph = g) Output [[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 [[2]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 3 [[3]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 [[4]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 [[5]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -4734,7 +5079,7 @@ max_weight = 3, maximal = TRUE) Output [[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -4752,11 +5097,11 @@ largest_weighted_cliques_impl(graph = g) Output [[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 [[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 @@ -4766,7 +5111,7 @@ largest_weighted_cliques_impl(graph = g, vertex_weights = c(1, 2, 3)) Output [[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 @@ -4950,7 +5295,7 @@ Code roots_for_tree_layout_impl(graph = g, mode = "out", heuristic = 1) Output - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 # roots_for_tree_layout_impl errors @@ -5021,9 +5366,12 @@ [3,] 1.0 1 $extd_graph - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $extd_to_orig_eids [1] 1 2 @@ -5042,9 +5390,12 @@ [3,] 0 4 $extd_graph - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $extd_to_orig_eids [1] 1 2 @@ -5718,11 +6069,11 @@ Output $cliques $cliques[[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 $cliques[[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -5737,11 +6088,11 @@ Output $cliques $cliques[[1]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 $cliques[[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -5791,12 +6142,17 @@ Code hrg_sample_impl(hrg = hrg_model) Output - IGRAPH U--- 10 45 -- - + edges: - [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 - [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 - [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 - [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 45 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 + [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 + [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 + [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 + [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 + [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 # hrg_sample_impl errors @@ -5813,20 +6169,30 @@ hrg_sample_many_impl(hrg = hrg_model, num_samples = 2) Output [[1]] - IGRAPH U--- 10 45 -- - + edges: - [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 - [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 - [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 - [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 45 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 + [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 + [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 + [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 + [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 + [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 [[2]] - IGRAPH U--- 10 45 -- - + edges: - [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 - [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 - [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 - [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 45 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 + [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 + [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 + [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 + [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 + [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 # hrg_sample_many_impl errors @@ -5843,13 +6209,20 @@ Code hrg_game_impl(hrg = hrg_model) Output - IGRAPH U--- 10 45 -- Hierarchical random graph model - + attr: name (g/c) - + edges: - [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 - [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 - [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 - [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 + -- Hierarchical random graph model ------------------------------------ + i undirected + i 10 vertices * 45 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 + [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 + [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 + [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 + [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 + [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 # hrg_game_impl errors @@ -5946,10 +6319,14 @@ from_hrg_dendrogram_impl(hrg = hrg_model) Output $graph - IGRAPH D--- 19 18 -- - + edges: - [1] 11-> 1 11->14 12->19 12-> 5 13->16 13-> 8 14->12 14->18 15-> 3 15-> 6 - [11] 16->15 16->10 17->13 17-> 4 18-> 7 18-> 9 19-> 2 19->17 + -- -------------------------------------------------------------------- + i directed + i 19 vertices * 18 edges + + -- Edges ----------------------------------------------------------------------- + [1] 11 -> 1 11 -> 14 12 -> 19 12 -> 5 13 -> 16 13 -> 8 14 -> 12 + [8] 14 -> 18 15 -> 3 15 -> 6 16 -> 15 16 -> 10 17 -> 13 17 -> 4 + [15] 18 -> 7 18 -> 9 19 -> 2 19 -> 17 $prob [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1 1 1 1 1 1 1 1 1 @@ -6105,18 +6482,24 @@ Code to_directed_impl(graph = g) Output - IGRAPH D--- 3 4 -- - + edges: - [1] 1->2 2->3 2->1 3->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 2 -> 1 3 -> 2 --- Code to_directed_impl(graph = g, mode = "acyclic") Output - IGRAPH D--- 3 2 -- - + edges: - [1] 1->2 2->3 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 # to_directed_impl errors @@ -6131,18 +6514,24 @@ Code to_undirected_impl(graph = g) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 --- Code to_undirected_impl(graph = g, mode = "mutual", edge_attr_comb = "sum") Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # to_undirected_impl errors @@ -6484,7 +6873,7 @@ Code list_triangles_impl(graph = g) Output - + 0/3 vertices: + -- 0/3 ------------------------------------------------------- # list_triangles_impl errors @@ -6499,9 +6888,13 @@ Code join_impl(left = g1, right = g2) Output - IGRAPH U--- 6 13 -- - + edges: - [1] 1--2 2--3 4--5 5--6 1--4 1--5 1--6 2--4 2--5 2--6 3--4 3--5 3--6 + -- -------------------------------------------------------------------- + i undirected + i 6 vertices * 13 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 4 -- 5 5 -- 6 1 -- 4 1 -- 5 1 -- 6 2 -- 4 2 -- 5 + [10] 2 -- 6 3 -- 4 3 -- 5 3 -- 6 # join_impl errors @@ -6517,9 +6910,12 @@ induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "auto") Output $res - IGRAPH U--- 2 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 $map [1] 2 3 1 @@ -6534,9 +6930,12 @@ induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "copy_and_delete") Output $res - IGRAPH U--- 2 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 $map [1] 2 3 1 @@ -6558,21 +6957,28 @@ Code mycielskian_impl(graph = g) Output - IGRAPH U--- 7 9 -- - + edges: - [1] 1--2 2--3 1--5 2--4 2--6 3--5 4--7 5--7 6--7 + -- -------------------------------------------------------------------- + i undirected + i 7 vertices * 9 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 7 5 -- 7 6 -- 7 --- Code mycielskian_impl(graph = g, k = 2) Output - IGRAPH U--- 15 34 -- - + edges: - [1] 1-- 2 2-- 3 1-- 5 2-- 4 2-- 6 3-- 5 4-- 7 5-- 7 6-- 7 1-- 9 - [11] 2-- 8 2--10 3-- 9 1--12 5-- 8 2--11 4-- 9 2--13 6-- 9 3--12 - [21] 5--10 4--14 7--11 5--14 7--12 6--14 7--13 8--15 9--15 10--15 - [31] 11--15 12--15 13--15 14--15 + -- -------------------------------------------------------------------- + i undirected + i 15 vertices * 34 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 7 + [8] 5 -- 7 6 -- 7 1 -- 9 2 -- 8 2 -- 10 3 -- 9 1 -- 12 + [15] 5 -- 8 2 -- 11 4 -- 9 2 -- 13 6 -- 9 3 -- 12 5 -- 10 + [22] 4 -- 14 7 -- 11 5 -- 14 7 -- 12 6 -- 14 7 -- 13 8 -- 15 + [29] 9 -- 15 10 -- 15 11 -- 15 12 -- 15 13 -- 15 14 -- 15 # mycielskian_impl errors @@ -6587,18 +6993,25 @@ Code product_impl(g1 = g1, g2 = g2) Output - IGRAPH U--- 9 12 -- - + edges: - [1] 1--4 2--5 3--6 4--7 5--8 6--9 1--2 4--5 7--8 2--3 5--6 8--9 + -- -------------------------------------------------------------------- + i undirected + i 9 vertices * 12 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 4 2 -- 5 3 -- 6 4 -- 7 5 -- 8 6 -- 9 1 -- 2 4 -- 5 7 -- 8 + [10] 2 -- 3 5 -- 6 8 -- 9 --- Code product_impl(g1 = g1, g2 = g2, type = "tensor") Output - IGRAPH U--- 9 8 -- - + edges: - [1] 1--5 2--4 2--6 3--5 4--8 5--7 5--9 6--8 + -- -------------------------------------------------------------------- + i undirected + i 9 vertices * 8 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 8 5 -- 7 5 -- 9 6 -- 8 # product_impl errors @@ -6613,9 +7026,12 @@ Code rooted_product_impl(g1 = g1, g2 = g2, root = 1) Output - IGRAPH U--- 9 8 -- - + edges: - [1] 1--4 4--7 1--2 4--5 7--8 2--3 5--6 8--9 + -- -------------------------------------------------------------------- + i undirected + i 9 vertices * 8 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 4 4 -- 7 1 -- 2 4 -- 5 7 -- 8 2 -- 3 5 -- 6 8 -- 9 # rooted_product_impl errors @@ -6631,9 +7047,12 @@ gomory_hu_tree_impl(graph = g) Output $tree - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $flows [1] 1 1 @@ -6645,9 +7064,12 @@ gomory_hu_tree_impl(graph = g, capacity = c(1, 2)) Output $tree - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $flows [1] 1 2 @@ -6673,15 +7095,15 @@ [1] 1 1 $cut - + 1/2 edge: - [1] 2--3 + -- 1/2 --------------------------------------------------------- + [1] 2 -- 3 $partition1 - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 $partition2 - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 3 $stats @@ -6714,15 +7136,15 @@ [1] 1 1 $cut - + 1/2 edge: - [1] 1--2 + -- 1/2 --------------------------------------------------------- + [1] 1 -- 2 $partition1 - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 $partition2 - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 $stats @@ -6757,8 +7179,9 @@ residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output $residual - IGRAPH D--- 3 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 0 edges $residual_capacity numeric(0) @@ -6777,9 +7200,12 @@ Code reverse_residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output - IGRAPH D--- 3 2 -- - + edges: - [1] 2->1 3->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 2 # reverse_residual_graph_impl errors @@ -6798,15 +7224,15 @@ [1] 1 $cut - + 1/2 edge: - [1] 2--3 + -- 1/2 --------------------------------------------------------- + [1] 2 -- 3 $partition1 - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 $partition2 - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 3 @@ -6819,15 +7245,15 @@ [1] 1 $cut - + 1/2 edge: - [1] 1--2 + -- 1/2 --------------------------------------------------------- + [1] 1 -- 2 $partition1 - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 $partition2 - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 @@ -6848,12 +7274,15 @@ [1] 0 1 2 $domtree - IGRAPH D--- 3 2 -- - + edges: - [1] 1->2 2->3 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 $leftout - + 0/3 vertices: + -- 0/3 ------------------------------------------------------- --- @@ -6865,11 +7294,12 @@ [1] 0 -1 -1 $domtree - IGRAPH D--- 3 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 0 edges $leftout - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 2 3 @@ -6888,21 +7318,21 @@ Output $cuts $cuts[[1]] - + 1/2 edge: - [1] 1->2 + -- 1/2 --------------------------------------------------------- + [1] 1 -> 2 $cuts[[2]] - + 1/2 edge: - [1] 2->3 + -- 1/2 --------------------------------------------------------- + [1] 2 -> 3 $partition1s $partition1s[[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 $partition1s[[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -6925,21 +7355,21 @@ $cuts $cuts[[1]] - + 1/2 edge: - [1] 1->2 + -- 1/2 --------------------------------------------------------- + [1] 1 -> 2 $cuts[[2]] - + 1/2 edge: - [1] 2->3 + -- 1/2 --------------------------------------------------------- + [1] 2 -> 3 $partition1s $partition1s[[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 $partition1s[[2]] - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 @@ -6954,13 +7384,13 @@ $cuts $cuts[[1]] - + 1/2 edge: - [1] 1->2 + -- 1/2 --------------------------------------------------------- + [1] 1 -> 2 $partition1s $partition1s[[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 @@ -6979,9 +7409,12 @@ even_tarjan_reduction_impl(graph = g) Output $graphbar - IGRAPH D--- 6 7 -- - + edges: - [1] 1->4 2->5 3->6 5->1 4->2 6->2 5->3 + -- -------------------------------------------------------------------- + i directed + i 6 vertices * 7 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 4 2 -> 5 3 -> 6 5 -> 1 4 -> 2 6 -> 2 5 -> 3 $capacity [1] 1 1 1 3 3 3 3 @@ -7031,7 +7464,7 @@ all_minimal_st_separators_impl(graph = g) Output [[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 @@ -7049,7 +7482,7 @@ minimum_size_separators_impl(graph = g) Output [[1]] - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 2 @@ -7111,18 +7544,24 @@ Code isoclass_create_impl(size = 3, number = 1) Output - IGRAPH D--- 3 1 -- - + edge: - [1] 2->1 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 --- Code isoclass_create_impl(size = 3, number = 1, directed = FALSE) Output - IGRAPH U--- 3 1 -- - + edge: - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 # isoclass_create_impl errors @@ -7405,9 +7844,12 @@ Code permute_vertices_impl(graph = g, permutation = 3:1) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 2--3 1--2 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 3 1 -- 2 # permute_vertices_impl errors @@ -7598,7 +8040,7 @@ automorphism_group_impl(graph = g) Output [[1]] - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 3 2 1 @@ -7645,9 +8087,12 @@ simplify_and_colorize_impl(graph = g) Output $res - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $vertex_color [1] 0 0 0 @@ -9708,10 +10153,10 @@ find_cycle_impl(graph = g) Output $vertices - + 0/3 vertices: + -- 0/3 ------------------------------------------------------- $edges - + 0/2 edges: + -- 0/2 --------------------------------------------------------- --- @@ -9720,10 +10165,10 @@ find_cycle_impl(graph = g, mode = "in") Output $vertices - + 0/3 vertices: + -- 0/3 ------------------------------------------------------- $edges - + 0/2 edges: + -- 0/2 --------------------------------------------------------- # find_cycle_impl errors @@ -9793,11 +10238,11 @@ eulerian_path_impl(graph = g) Output $epath - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $vpath - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 @@ -9824,11 +10269,11 @@ eulerian_cycle_impl(graph = g2) Output $epath - + 4/4 edges: - [1] 1--2 2--3 3--4 1--4 + -- 4/4 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 1 -- 4 $vpath - + 5/4 vertices: + -- 5/4 ------------------------------------------------------- [1] 1 2 3 4 1 @@ -9901,7 +10346,7 @@ [1] TRUE $root - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 @@ -9929,7 +10374,7 @@ [1] TRUE $roots - + 1/3 vertex: + -- 1/3 ------------------------------------------------------- [1] 1 @@ -9946,10 +10391,15 @@ Code from_prufer_impl(prufer = 1:2) Output - IGRAPH U--- 4 3 -- Tree from Prufer sequence - + attr: name (g/c), prufer (g/n) - + edges: - [1] 1--3 1--2 2--4 + -- Tree from Prufer sequence ------------------------------------------ + i undirected + i 4 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , prufer + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 2 2 -- 4 # from_prufer_impl errors @@ -9982,18 +10432,24 @@ Code tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3)) Output - IGRAPH D--- 4 3 -- - + edges: - [1] 1->2 2->3 3->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 4 --- Code tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3), type = "in") Output - IGRAPH D--- 4 3 -- - + edges: - [1] 2->1 3->2 4->3 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 2 4 -> 3 # tree_from_parent_vector_impl errors @@ -10026,8 +10482,8 @@ Code random_spanning_tree_impl(graph = g, vid = 1) Output - + 2/2 edges: - [1] 1--2 2--3 + -- 2/2 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # random_spanning_tree_impl errors @@ -10042,18 +10498,24 @@ Code tree_game_impl(n = 3) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 2--3 1--2 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 3 1 -- 2 --- Code tree_game_impl(n = 3, directed = TRUE, method = "lerw") Output - IGRAPH D--- 3 2 -- - + edges: - [1] 3->1 1->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -> 1 1 -> 2 # tree_game_impl errors @@ -10242,9 +10704,12 @@ Code invalidate_cache_impl(graph = g) Output - IGRAPH U--- 3 2 -- - + edges: - [1] 1--2 2--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 # invalidate_cache_impl errors @@ -10259,7 +10724,7 @@ Code vertex_path_from_edge_path_impl(graph = g, start = 1, edge_path = c(1, 2)) Output - + 3/3 vertices: + -- 3/3 ------------------------------------------------------- [1] 1 2 3 --- @@ -10267,7 +10732,7 @@ Code vertex_path_from_edge_path_impl(graph = g, start = 1, edge_path = c(1), mode = "in") Output - + 2/3 vertices: + -- 2/3 ------------------------------------------------------- [1] 1 2 # vertex_path_from_edge_path_impl errors @@ -10342,7 +10807,7 @@ Code edges_impl(graph = g, eids = E(g)) Output - + 6/4 vertices: + -- 6/4 ------------------------------------------------------- [1] 1 2 2 3 3 4 --- @@ -10350,7 +10815,7 @@ Code edges_impl(graph = g, eids = c(1, 3)) Output - + 4/4 vertices: + -- 4/4 ------------------------------------------------------- [1] 1 2 3 4 # edges_impl errors @@ -10411,24 +10876,24 @@ Code incident_impl(graph = g, vid = 2, mode = "out") Output - + 1/3 edge: - [1] 2->3 + -- 1/3 --------------------------------------------------------- + [1] 2 -> 3 --- Code incident_impl(graph = g, vid = 2, mode = "in") Output - + 1/3 edge: - [1] 1->2 + -- 1/3 --------------------------------------------------------- + [1] 1 -> 2 --- Code incident_impl(graph = g, vid = 2, mode = "all") Output - + 2/3 edges: - [1] 1->2 2->3 + -- 2/3 --------------------------------------------------------- + [1] 1 -> 2 2 -> 3 # incident_impl errors @@ -10443,16 +10908,22 @@ Code famous_impl(name = "Zachary") Output - IGRAPH U--- 34 78 -- - + edges: - [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--11 1--12 - [11] 1--13 1--14 1--18 1--20 1--22 1--32 2-- 3 2-- 4 2-- 8 2--14 - [21] 2--18 2--20 2--22 2--31 3-- 4 3-- 8 3--28 3--29 3--33 3--10 - [31] 3-- 9 3--14 4-- 8 4--13 4--14 5-- 7 5--11 6-- 7 6--11 6--17 - [41] 7--17 9--31 9--33 9--34 10--34 14--34 15--33 15--34 16--33 16--34 - [51] 19--33 19--34 20--34 21--33 21--34 23--33 23--34 24--26 24--28 24--33 - [61] 24--34 24--30 25--26 25--28 25--32 26--32 27--30 27--34 28--34 29--32 - [71] 29--34 30--33 30--34 31--33 31--34 32--33 32--34 33--34 + -- -------------------------------------------------------------------- + i undirected + i 34 vertices * 78 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 + [8] 1 -- 9 1 -- 11 1 -- 12 1 -- 13 1 -- 14 1 -- 18 1 -- 20 + [15] 1 -- 22 1 -- 32 2 -- 3 2 -- 4 2 -- 8 2 -- 14 2 -- 18 + [22] 2 -- 20 2 -- 22 2 -- 31 3 -- 4 3 -- 8 3 -- 28 3 -- 29 + [29] 3 -- 33 3 -- 10 3 -- 9 3 -- 14 4 -- 8 4 -- 13 4 -- 14 + [36] 5 -- 7 5 -- 11 6 -- 7 6 -- 11 6 -- 17 7 -- 17 9 -- 31 + [43] 9 -- 33 9 -- 34 10 -- 34 14 -- 34 15 -- 33 15 -- 34 16 -- 33 + [50] 16 -- 34 19 -- 33 19 -- 34 20 -- 34 21 -- 33 21 -- 34 23 -- 33 + [57] 23 -- 34 24 -- 26 24 -- 28 24 -- 33 24 -- 34 24 -- 30 25 -- 26 + [64] 25 -- 28 25 -- 32 26 -- 32 27 -- 30 27 -- 34 28 -- 34 29 -- 32 + + ... omitted several edges # famous_impl errors @@ -10523,9 +10994,12 @@ union_impl(left = g1, right = g2) Output $res - IGRAPH D--- 4 4 -- - + edges: - [1] 1->2 1->3 2->3 3->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 3 3 -> 4 $edge_map_left [1] 1 3 @@ -10548,9 +11022,12 @@ intersection_impl(left = g1, right = g2) Output $res - IGRAPH D--- 3 2 -- - + edges: - [1] 1->2 2->3 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 $edge_map_left [1] 1 2 @@ -10572,101 +11049,137 @@ Code star_impl(n = 5, mode = "out", center = 0) Output - IGRAPH D--- 5 4 -- - + edges: - [1] 1->2 1->3 1->4 1->5 + -- -------------------------------------------------------------------- + i directed + i 5 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 1 -> 4 1 -> 5 --- Code star_impl(n = 6, mode = "in", center = 1) Output - IGRAPH D--- 6 5 -- - + edges: - [1] 1->2 3->2 4->2 5->2 6->2 + -- -------------------------------------------------------------------- + i directed + i 6 vertices * 5 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 3 -> 2 4 -> 2 5 -> 2 6 -> 2 --- Code star_impl(n = 4, mode = "undirected", center = 0) Output - IGRAPH U--- 4 3 -- - + edges: - [1] 1--2 1--3 1--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 # ring_impl basic Code ring_impl(n = 5, directed = FALSE, mutual = FALSE, circular = TRUE) Output - IGRAPH U--- 5 5 -- - + edges: - [1] 1--2 2--3 3--4 4--5 1--5 + -- -------------------------------------------------------------------- + i undirected + i 5 vertices * 5 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 --- Code ring_impl(n = 4, directed = TRUE, mutual = FALSE, circular = FALSE) Output - IGRAPH D--- 4 3 -- - + edges: - [1] 1->2 2->3 3->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 4 # full_impl basic Code full_impl(n = 4, directed = FALSE, loops = FALSE) Output - IGRAPH U--- 4 6 -- - + edges: - [1] 1--2 1--3 1--4 2--3 2--4 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 3 2 -- 4 3 -- 4 --- Code full_impl(n = 3, directed = TRUE, loops = FALSE) Output - IGRAPH D--- 3 6 -- - + edges: - [1] 1->2 1->3 2->1 2->3 3->1 3->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 3 3 -> 1 3 -> 2 # kary_tree_impl basic Code kary_tree_impl(n = 7, children = 2, type = c("out", "in", "undirected")) Output - IGRAPH D--- 7 6 -- - + edges: - [1] 1->2 1->3 2->4 2->5 3->6 3->7 + -- -------------------------------------------------------------------- + i directed + i 7 vertices * 6 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 1 -> 3 2 -> 4 2 -> 5 3 -> 6 3 -> 7 --- Code kary_tree_impl(n = 10, children = 3, type = c("in", "out", "undirected")) Output - IGRAPH D--- 10 9 -- - + edges: - [1] 2->1 3->1 4->1 5->2 6->2 7->2 8->3 9->3 10->3 + -- -------------------------------------------------------------------- + i directed + i 10 vertices * 9 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 3 -> 1 4 -> 1 5 -> 2 6 -> 2 7 -> 2 8 -> 3 9 -> 3 + [9] 10 -> 3 # barabasi_game_impl basic Code barabasi_game_impl(n = 10, power = 1, m = 2, directed = FALSE, algo = "bag") Output - IGRAPH U--- 10 18 -- - + edges: - [1] 1-- 2 1-- 2 2-- 3 1-- 3 2-- 4 2-- 4 2-- 5 2-- 5 4-- 6 2-- 6 2-- 7 1-- 7 - [13] 3-- 8 2-- 8 8-- 9 5-- 9 6--10 5--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 18 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 2 -- 3 1 -- 3 2 -- 4 2 -- 4 2 -- 5 2 -- 5 + [9] 4 -- 6 2 -- 6 2 -- 7 1 -- 7 3 -- 8 2 -- 8 8 -- 9 5 -- 9 + [17] 6 -- 10 5 -- 10 --- Code barabasi_game_impl(n = 10, power = 1, m = 2, directed = FALSE, algo = "psumtree") Output - IGRAPH U--- 10 17 -- - + edges: - [1] 1-- 2 1-- 3 2-- 3 1-- 4 2-- 4 2-- 5 4-- 5 1-- 6 3-- 6 6-- 7 3-- 7 6-- 8 - [13] 2-- 8 3-- 9 5-- 9 2--10 6--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 17 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 2 -- 5 4 -- 5 1 -- 6 + [9] 3 -- 6 6 -- 7 3 -- 7 6 -- 8 2 -- 8 3 -- 9 5 -- 9 2 -- 10 + [17] 6 -- 10 # grg_game_impl basic @@ -10674,9 +11187,13 @@ grg_game_impl(nodes = 10, radius = 0.3, torus = FALSE) Output $graph - IGRAPH U--- 10 12 -- - + edges: - [1] 3-- 5 3-- 6 5-- 6 5-- 7 5-- 8 6-- 8 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 12 edges + + -- Edges ----------------------------------------------------------------------- + [1] 3 -- 5 3 -- 6 5 -- 6 5 -- 7 5 -- 8 6 -- 8 7 -- 8 7 -- 9 + [9] 7 -- 10 8 -- 9 8 -- 10 9 -- 10 $x [1] 0.08565451 0.15145413 0.45222514 0.45939554 0.55956278 0.61872370 @@ -10692,10 +11209,14 @@ Code watts_strogatz_game_impl(dim = 1, size = 10, nei = 2, p = 0.1) Output - IGRAPH U--- 10 20 -- - + edges: - [1] 1-- 2 2-- 6 2-- 3 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10 1-- 8 1-- 9 - [13] 2--10 2-- 4 3-- 5 4-- 6 5-- 7 6-- 8 7-- 9 8--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 20 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 6 2 -- 3 4 -- 5 5 -- 6 6 -- 7 7 -- 8 8 -- 9 + [9] 9 -- 10 1 -- 10 1 -- 8 1 -- 9 2 -- 10 2 -- 4 3 -- 5 4 -- 6 + [17] 5 -- 7 6 -- 8 7 -- 9 8 -- 10 # distances_impl basic @@ -10739,14 +11260,14 @@ Output $vertices $vertices[[1]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 1 2 3 $edges $edges[[1]] - + 2/5 edges: - [1] 1--2 2--3 + -- 2/5 --------------------------------------------------------- + [1] 1 -- 2 2 -- 3 $parents @@ -10761,7 +11282,7 @@ Code subcomponent_impl(graph = g, v = 1, mode = c("all", "out", "in")) Output - + 3/6 vertices, named: + -- 3/6 * named ----------------------------------------------- [1] A B C # betweenness_impl basic @@ -11097,9 +11618,12 @@ create_bipartite_impl(types = c(FALSE, FALSE, TRUE, TRUE), edges = c(0, 2, 0, 3, 1, 2, 1, 3), directed = FALSE) Output - IGRAPH U--- 4 4 -- - + edges: - [1] 1--3 1--4 2--3 2--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 3 1 -- 4 2 -- 3 2 -- 4 # bipartite_game_impl basic @@ -11107,9 +11631,13 @@ bipartite_game_impl(type = "gnp", n1 = 5, n2 = 5, p = 0.3, directed = FALSE) Output $graph - IGRAPH U--- 10 10 -- - + edges: - [1] 1-- 6 2-- 6 4-- 6 5-- 6 1-- 7 4-- 7 4-- 8 3-- 9 3--10 4--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 6 2 -- 6 4 -- 6 5 -- 6 1 -- 7 4 -- 7 4 -- 8 3 -- 9 + [9] 3 -- 10 4 -- 10 $types [1] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE @@ -11121,9 +11649,13 @@ bipartite_game_impl(type = "gnm", n1 = 5, n2 = 5, m = 10, directed = FALSE) Output $graph - IGRAPH U--- 10 10 -- - + edges: - [1] 1-- 6 3-- 7 5-- 7 1-- 8 3-- 8 4-- 8 2-- 9 5-- 9 2--10 3--10 + -- -------------------------------------------------------------------- + i undirected + i 10 vertices * 10 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 6 3 -- 7 5 -- 7 1 -- 8 3 -- 8 4 -- 8 2 -- 9 5 -- 9 + [9] 2 -- 10 3 -- 10 $types [1] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE @@ -11135,16 +11667,26 @@ decompose_impl(graph = g, mode = c("weak", "strong")) Output [[1]] - IGRAPH UN-- 3 2 -- - + attr: name (v/c) - + edges (vertex names): - [1] A--B B--C + -- -------------------------------------------------------------------- + i undirected * named + i 3 vertices * 2 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- B B -- C [[2]] - IGRAPH UN-- 2 1 -- - + attr: name (v/c) - + edge (vertex names): - [1] D--E + -- -------------------------------------------------------------------- + i undirected * named + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] D -- E # neighborhood_impl basic @@ -11154,23 +11696,23 @@ "in")) Output [[1]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 1 2 5 [[2]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 2 1 3 [[3]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 3 2 4 [[4]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 4 3 5 [[5]] - + 3/5 vertices: + -- 3/5 ------------------------------------------------------- [1] 5 1 4 @@ -11194,10 +11736,15 @@ numeric(0) $newgraph - IGRAPH U--- 4 6 -- Full graph - + attr: name (g/c), loops (g/l) - + edges: - [1] 1--2 1--3 1--4 2--3 2--4 3--4 + -- Full graph --------------------------------------------------------- + i undirected + i 4 vertices * 6 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , loops + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 3 2 -- 4 3 -- 4 --- @@ -11212,10 +11759,15 @@ [1] 1 3 $newgraph - IGRAPH U--- 4 5 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l) - + edges: - [1] 1--2 2--3 3--4 1--4 2--4 + -- Ring graph --------------------------------------------------------- + i undirected + i 4 vertices * 5 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 1 -- 4 2 -- 4 # get_adjacency_impl basic @@ -11240,27 +11792,36 @@ Code read_graph_edgelist_impl(instream = tmp, n = 3, directed = FALSE) Output - IGRAPH U--- 3 3 -- - + edges: - [1] 1--2 2--3 1--3 + -- -------------------------------------------------------------------- + i undirected + i 3 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 1 -- 3 # degree_sequence_game_impl basic Code degree_sequence_game_impl(out_deg = c(2, 2, 2, 2), method = "configuration") Output - IGRAPH U--- 4 4 -- - + edges: - [1] 2--4 3--3 1--4 1--2 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -- 4 3 -- 3 1 -- 4 1 -- 2 --- Code degree_sequence_game_impl(out_deg = c(2, 2, 2, 2), method = "vl") Output - IGRAPH U--- 4 4 -- - + edges: - [1] 1--2 1--4 2--3 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 4 2 -- 3 3 -- 4 # connect_neighborhood_impl basic @@ -11271,10 +11832,15 @@ Order smaller than two, graph will be unchanged. Source: : Output - IGRAPH U--- 5 5 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l) - + edges: - [1] 1--2 2--3 3--4 4--5 1--5 + -- Ring graph --------------------------------------------------------- + i undirected + i 5 vertices * 5 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 # eccentricity_impl basic @@ -11295,7 +11861,7 @@ Code graph_center_impl(graph = g, mode = c("out", "in", "all")) Output - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 1 # maximal_cliques_impl basic @@ -11304,7 +11870,7 @@ maximal_cliques_impl(graph = g, min_size = 1, max_size = 0) Output [[1]] - + 4/4 vertices: + -- 4/4 ------------------------------------------------------- [1] 1 2 4 3 @@ -11314,43 +11880,43 @@ independent_vertex_sets_impl(graph = g, min_size = 1, max_size = 0) Output [[1]] - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 1 [[2]] - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 2 [[3]] - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 3 [[4]] - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 4 [[5]] - + 1/5 vertex: + -- 1/5 ------------------------------------------------------- [1] 5 [[6]] - + 2/5 vertices: + -- 2/5 ------------------------------------------------------- [1] 1 3 [[7]] - + 2/5 vertices: + -- 2/5 ------------------------------------------------------- [1] 1 4 [[8]] - + 2/5 vertices: + -- 2/5 ------------------------------------------------------- [1] 2 4 [[9]] - + 2/5 vertices: + -- 2/5 ------------------------------------------------------- [1] 2 5 [[10]] - + 2/5 vertices: + -- 2/5 ------------------------------------------------------- [1] 3 5 @@ -11364,7 +11930,7 @@ print(result) Output $order - + 10/10 vertices: + -- 10/10 ----------------------------------------------------- [1] 1 2 10 3 9 4 8 5 7 6 $rank @@ -11431,11 +11997,11 @@ print(result) Output $order - + 10/10 vertices: + -- 10/10 ----------------------------------------------------- [1] 1 2 3 4 5 6 7 8 9 10 $order_out - + 10/10 vertices: + -- 10/10 ----------------------------------------------------- [1] 10 9 8 7 6 5 4 3 2 1 $father @@ -11687,18 +12253,24 @@ Code sparse_adjacency_impl(adjmatrix = M) Output - IGRAPH D--- 4 4 -- - + edges: - [1] 4->1 1->2 2->3 3->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 --- Code sparse_adjacency_impl(adjmatrix = M_sym, mode = "undirected", loops = "once") Output - IGRAPH U--- 4 4 -- - + edges: - [1] 1--2 2--3 1--4 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 1 -- 4 3 -- 4 # sparse_weighted_adjacency_impl basic @@ -11706,9 +12278,12 @@ sparse_weighted_adjacency_impl(adjmatrix = M) Output $graph - IGRAPH D--- 4 4 -- - + edges: - [1] 4->1 1->2 2->3 3->4 + -- -------------------------------------------------------------------- + i directed + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 $weights [1] 0.5 2.5 1.0 3.0 @@ -11720,9 +12295,12 @@ sparse_weighted_adjacency_impl(adjmatrix = M_sym, mode = "undirected", loops = "once") Output $graph - IGRAPH U--- 4 4 -- - + edges: - [1] 1--2 2--3 1--4 3--4 + -- -------------------------------------------------------------------- + i undirected + i 4 vertices * 4 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 2 -- 3 1 -- 4 3 -- 4 $weights [1] 2.5 1.0 0.5 3.0 @@ -11733,18 +12311,24 @@ Code weighted_sparsemat_impl(A = M, directed = TRUE, attr = "weight", loops = FALSE) Output - IGRAPH D-W- 4 4 -- - + attr: weight (e/n) - + edges: - [1] 4->1 1->2 2->3 3->4 + -- -------------------------------------------------------------------- + i directed * weighted + i 4 vertices * 4 edges + + -- Attributes ------------------------------------------------------------------ + -> edge: weight + + -- Edges ----------------------------------------------------------------------- + [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 # disjoint_union_many_impl basic Code disjoint_union_many_impl(graphs = list(g1, g2, g3)) Output - IGRAPH D--- 6 0 -- - + edges: + -- -------------------------------------------------------------------- + i directed + i 6 vertices * 0 edges # union_many_impl basic @@ -11752,9 +12336,12 @@ union_many_impl(graphs = list(g1, g2, g3)) Output $res - IGRAPH D--- 3 3 -- - + edges: - [1] 2->3 1->3 1->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 3 1 -> 3 1 -> 2 $edgemaps $edgemaps[[1]] @@ -11774,9 +12361,12 @@ intersection_many_impl(graphs = list(g1, g2, g3)) Output $res - IGRAPH D--- 3 1 -- - + edge: - [1] 1->2 + -- -------------------------------------------------------------------- + i directed + i 3 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 $edgemaps $edgemaps[[1]] @@ -11808,8 +12398,8 @@ Code get_eid_impl(graph = g, from = 1, to = 2) Output - + 1/4 edge: - [1] 1->2 + -- 1/4 --------------------------------------------------------- + [1] 1 -> 2 # get_eid_impl errors @@ -11844,7 +12434,7 @@ [1] 3 3 3 3 0 3 2 2 1 1 $generators - + 4/10 vertices: + -- 4/10 ------------------------------------------------------ [1] 2 9 7 1 $modularity diff --git a/tests/testthat/_snaps/adjacency.md b/tests/testthat/_snaps/adjacency.md index 1af5c9cbcee..0dffe02bc8c 100644 --- a/tests/testthat/_snaps/adjacency.md +++ b/tests/testthat/_snaps/adjacency.md @@ -14,9 +14,12 @@ Code graph_from_adjacency_matrix(m) Output - IGRAPH D--- 2 2 -- - + edges: - [1] 2->1 2->1 + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 2 -> 1 Code graph_from_adjacency_matrix(m, mode = "undirected") Condition @@ -24,29 +27,45 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - IGRAPH U--- 2 2 -- - + edges: - [1] 1--2 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 Code graph_from_adjacency_matrix(m, mode = "max") Output - IGRAPH U--- 2 2 -- - + edges: - [1] 1--2 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 Code graph_from_adjacency_matrix(m, weighted = TRUE) Output - IGRAPH D-W- 2 1 -- - + attr: weight (e/n) - + edge: - [1] 2->1 + -- -------------------------------------------------------------------- + i directed * weighted + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> edge: weight + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 Code graph_from_adjacency_matrix(m, weighted = "w") Output - IGRAPH D--- 2 1 -- - + attr: w (e/n) - + edge: - [1] 2->1 + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> edge: w + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 Code m2 <- structure(c(0, 0.00211360121966095, 0.00211360121966098, 0), dim = c(2L, 2L)) @@ -56,26 +75,33 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - IGRAPH U--- 2 0 -- - + edges: + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 0 edges Code graph_from_adjacency_matrix(1) Condition Warning: The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0. Output - IGRAPH D--- 1 1 -- - + edge: - [1] 1->1 + -- -------------------------------------------------------------------- + i directed + i 1 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 1 Code graph_from_adjacency_matrix(1, mode = "undirected") Condition Warning: The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0. Output - IGRAPH U--- 1 1 -- - + edge: - [1] 1--1 + -- -------------------------------------------------------------------- + i undirected + i 1 vertices * 1 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 1 # graph_from_adjacency_matrix() snapshot for sparse matrices @@ -94,9 +120,12 @@ Code graph_from_adjacency_matrix(m) Output - IGRAPH D--- 2 2 -- - + edges: - [1] 2->1 2->1 + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 2 -> 1 Code graph_from_adjacency_matrix(m, mode = "undirected") Condition @@ -104,29 +133,45 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - IGRAPH U--- 2 2 -- - + edges: - [1] 1--2 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 Code graph_from_adjacency_matrix(m, mode = "max") Output - IGRAPH U--- 2 2 -- - + edges: - [1] 1--2 1--2 + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 2 edges + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 2 Code graph_from_adjacency_matrix(m, weighted = TRUE) Output - IGRAPH D-W- 2 1 -- - + attr: weight (e/n) - + edge: - [1] 2->1 + -- -------------------------------------------------------------------- + i directed * weighted + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> edge: weight + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 Code graph_from_adjacency_matrix(m, weighted = "w") Output - IGRAPH D--- 2 1 -- - + attr: w (e/n) - + edge: - [1] 2->1 + -- -------------------------------------------------------------------- + i directed + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> edge: w + + -- Edges ----------------------------------------------------------------------- + [1] 2 -> 1 Code m2 <- Matrix::sparseMatrix(2:1, 1:2, x = c(0.00211360121966095, 0.00211360121966098)) @@ -136,8 +181,9 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - IGRAPH U--- 2 0 -- - + edges: + -- -------------------------------------------------------------------- + i undirected + i 2 vertices * 0 edges # graph_from_adjacency_matrix errors for NAs diff --git a/tests/testthat/_snaps/flow.md b/tests/testthat/_snaps/flow.md index 61e2886e0f3..c59a984beb6 100644 --- a/tests/testthat/_snaps/flow.md +++ b/tests/testthat/_snaps/flow.md @@ -102,15 +102,15 @@ min_st_separators(g_note) Output [[1]] - + 1/5 vertex, named, from something + -- 1/5 * named * from something [1] 1 [[2]] - + 2/5 vertices, named, from something + -- 2/5 * named * from something [1] 2 4 [[3]] - + 2/5 vertices, named, from something + -- 2/5 * named * from something [1] 1 3 diff --git a/tests/testthat/_snaps/foreign.md b/tests/testthat/_snaps/foreign.md index 5ff13f89152..9efdd756d43 100644 --- a/tests/testthat/_snaps/foreign.md +++ b/tests/testthat/_snaps/foreign.md @@ -3,20 +3,30 @@ Code read_graph(ncol_path, "ncol") Output - IGRAPH UN-- 3 2 -- - + attr: name (v/c) - + edges (vertex names): - [1] 0--1 1--2 + -- -------------------------------------------------------------------- + i undirected * named + i 3 vertices * 2 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] 0 -- 1 1 -- 2 # reading graph in LGL format Code read_graph(lgl_path, "lgl") Output - IGRAPH UN-- 3 2 -- - + attr: name (v/c) - + edges (vertex names): - [1] 0--1 1--2 + -- -------------------------------------------------------------------- + i undirected * named + i 3 vertices * 2 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] 0 -- 1 1 -- 2 # reading graph, unused argument diff --git a/tests/testthat/_snaps/incidence.md b/tests/testthat/_snaps/incidence.md index dbb1ba9a91e..e0e1030b4e1 100644 --- a/tests/testthat/_snaps/incidence.md +++ b/tests/testthat/_snaps/incidence.md @@ -3,60 +3,94 @@ Code (g <- graph_from_biadjacency_matrix(inc)) Output - IGRAPH UN-B 8 7 -- - + attr: type (v/l), name (v/c) - + edges (vertex names): - [1] A--c A--d B--b B--c B--e C--b C--d + -- -------------------------------------------------------------------- + i undirected * named * bipartite + i 8 vertices * 7 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- c A -- d B -- b B -- c B -- e C -- b C -- d --- Code (weighted_g <- graph_from_biadjacency_matrix(inc, weighted = TRUE)) Output - IGRAPH UNWB 8 7 -- - + attr: type (v/l), name (v/c), weight (e/n) - + edges (vertex names): - [1] B--b C--b A--c B--c A--d C--d B--e + -- -------------------------------------------------------------------- + i undirected * named * weighted * bipartite + i 8 vertices * 7 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + -> edge: weight + + -- Edges (vertex names) -------------------------------------------------------- + [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e # graph_from_biadjacency_matrix() works -- dense + multiple Code (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE)) Output - IGRAPH UN-B 8 10 -- - + attr: type (v/l), name (v/c) - + edges (vertex names): - [1] A--c A--d A--d A--e B--b B--e C--b C--c C--c C--e + -- -------------------------------------------------------------------- + i undirected * named * bipartite + i 8 vertices * 10 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- c A -- d A -- d A -- e B -- b B -- e C -- b C -- c C -- c + [10] C -- e # graph_from_biadjacency_matrix() works -- sparse Code (g <- graph_from_biadjacency_matrix(inc)) Output - IGRAPH UN-B 8 7 -- - + attr: type (v/l), name (v/c) - + edges (vertex names): - [1] B--b C--b A--c B--c A--d C--d B--e + -- -------------------------------------------------------------------- + i undirected * named * bipartite + i 8 vertices * 7 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + + -- Edges (vertex names) -------------------------------------------------------- + [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e --- Code (weighted_g <- graph_from_biadjacency_matrix(inc, weighted = TRUE)) Output - IGRAPH UNWB 8 7 -- - + attr: type (v/l), name (v/c), weight (e/n) - + edges (vertex names): - [1] B--b C--b A--c B--c A--d C--d B--e + -- -------------------------------------------------------------------- + i undirected * named * weighted * bipartite + i 8 vertices * 7 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + -> edge: weight + + -- Edges (vertex names) -------------------------------------------------------- + [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e # graph_from_biadjacency_matrix() works -- sparse + multiple Code (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE)) Output - IGRAPH UN-B 8 10 -- - + attr: type (v/l), name (v/c) - + edges (vertex names): - [1] B--b C--b A--c C--c C--c A--d A--d A--e B--e C--e + -- -------------------------------------------------------------------- + i undirected * named * bipartite + i 8 vertices * 10 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: type , name + + -- Edges (vertex names) -------------------------------------------------------- + [1] B -- b C -- b A -- c C -- c C -- c A -- d A -- d A -- e B -- e + [10] C -- e # graph_from_biadjacency_matrix() errors well diff --git a/tests/testthat/_snaps/iterators.md b/tests/testthat/_snaps/iterators.md index d01392169aa..8a36fd9788f 100644 --- a/tests/testthat/_snaps/iterators.md +++ b/tests/testthat/_snaps/iterators.md @@ -3,80 +3,82 @@ Code vs Output - + 10/10 vertices: + -- 10/10 ----------------------------------------------------- [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - + 10/10 edges: - [1] 1-- 2 2-- 3 3-- 4 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10 + -- 10/10 ------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 5 -- 6 6 -- 7 7 -- 8 8 -- 9 + [9] 9 -- 10 1 -- 10 Code vs[1:5] Output - + 5/10 vertices: + -- 5/10 ------------------------------------------------------ [1] 1 2 3 4 5 Code es[1:5] Output - + 5/10 edges: - [1] 1--2 2--3 3--4 4--5 5--6 + -- 5/10 -------------------------------------------------------- + [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 5 -- 6 Code vs[numeric()] Output - + 0/10 vertices: + -- 0/10 ------------------------------------------------------ --- Code es[numeric()] Output - + 0/10 edges: + -- 0/10 -------------------------------------------------------- # printing named connected vs/es works Code vs Output - + 10/10 vertices, named: + -- 10/10 * named --------------------------------------------- [1] a b c d e f g h i j Code es Output - + 10/10 edges (vertex names): - [1] a--b b--c c--d d--e e--f f--g g--h h--i i--j a--j + -- 10/10 * vertex names ---------------------------------------- + [1] a -- b b -- c c -- d d -- e e -- f f -- g g -- h h -- i i -- j + [10] a -- j Code vs[1:5] Output - + 5/10 vertices, named: + -- 5/10 * named ---------------------------------------------- [1] a b c d e Code es[1:5] Output - + 5/10 edges (vertex names): - [1] a--b b--c c--d d--e e--f + -- 5/10 * vertex names ----------------------------------------- + [1] a -- b b -- c c -- d d -- e e -- f Code vs[numeric()] Output - + 0/10 vertices, named: + -- 0/10 * named ---------------------------------------------- --- Code es[numeric()] Output - + 0/10 edges (vertex names): + -- 0/10 * vertex names ----------------------------------------- # printing unconnected vs/es works Code vs Output - + 10/? vertices (deleted): + -- 10/? * deleted -------------------------------------------- [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - + 10/? edges (deleted): + -- 10/? * deleted ---------------------------------------------- [1] 1 2 3 4 5 6 7 8 9 10 --- @@ -84,12 +86,12 @@ Code vs Output - + 10/? vertices (deleted): + -- 10/? * deleted -------------------------------------------- [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - + 10/? edges (deleted) (vertex names): + -- 10/? * vertex names * deleted ------------------------------- [1] a|b b|c c|d d|e e|f f|g g|h h|i i|j a|j # logical indices are not recycled diff --git a/tests/testthat/_snaps/make.md b/tests/testthat/_snaps/make.md index 8fc69bf8504..054643ae674 100644 --- a/tests/testthat/_snaps/make.md +++ b/tests/testthat/_snaps/make.md @@ -46,108 +46,175 @@ Code graph_from_literal(A - B) Output - IGRAPH UN-- 2 1 -- - + attr: name (v/c) - + edge (vertex names): - [1] A--B + -- -------------------------------------------------------------------- + i undirected * named + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- B Code graph_from_literal(A - B - C) Output - IGRAPH UN-- 3 2 -- - + attr: name (v/c) - + edges (vertex names): - [1] A--B B--C + -- -------------------------------------------------------------------- + i undirected * named + i 3 vertices * 2 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- B B -- C Code graph_from_literal(A - B - C - A) Output - IGRAPH UN-- 3 3 -- - + attr: name (v/c) - + edges (vertex names): - [1] A--B A--C B--C + -- -------------------------------------------------------------------- + i undirected * named + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- B A -- C B -- C # graph_from_literal() and undirected explosion Code graph_from_literal(A:B:C - D:E, B:D - C:E) Output - IGRAPH UN-- 5 8 -- - + attr: name (v/c) - + edges (vertex names): - [1] A--D A--E B--C B--D B--E C--D C--E D--E + -- -------------------------------------------------------------------- + i undirected * named + i 5 vertices * 8 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- D A -- E B -- C B -- D B -- E C -- D C -- E D -- E Code graph_from_literal(A:B:C - D:E - F:G:H - I - J:K:L:M) Output - IGRAPH UN-- 13 19 -- - + attr: name (v/c) - + edges (vertex names): - [1] A--D A--E B--D B--E C--D C--E D--F D--G D--H E--F E--G E--H F--I G--I H--I - [16] I--J I--K I--L I--M + -- -------------------------------------------------------------------- + i undirected * named + i 13 vertices * 19 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -- D A -- E B -- D B -- E C -- D C -- E D -- F D -- G D -- H + [10] E -- F E -- G E -- H F -- I G -- I H -- I I -- J I -- K I -- L + [19] I -- M # graph_from_literal() and simple directed graphs Code graph_from_literal(A - +B) Output - IGRAPH DN-- 2 1 -- - + attr: name (v/c) - + edge (vertex names): - [1] A->B + -- -------------------------------------------------------------------- + i directed * named + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> B Code graph_from_literal(A - +B - +C) Output - IGRAPH DN-- 3 2 -- - + attr: name (v/c) - + edges (vertex names): - [1] A->B B->C + -- -------------------------------------------------------------------- + i directed * named + i 3 vertices * 2 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> B B -> C Code graph_from_literal(A - +B - +C - +A) Output - IGRAPH DN-- 3 3 -- - + attr: name (v/c) - + edges (vertex names): - [1] A->B B->C C->A + -- -------------------------------------------------------------------- + i directed * named + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> B B -> C C -> A Code graph_from_literal(A - +B + -C - +A) Output - IGRAPH DN-- 3 3 -- - + attr: name (v/c) - + edges (vertex names): - [1] A->B C->A C->B + -- -------------------------------------------------------------------- + i directed * named + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> B C -> A C -> B # graph_from_literal() and directed explosion Code graph_from_literal(A:B:C - +D:E, B:D + -C:E) Output - IGRAPH DN-- 5 9 -- - + attr: name (v/c) - + edges (vertex names): - [1] A->D A->E B->D B->E C->B C->D C->E E->B E->D + -- -------------------------------------------------------------------- + i directed * named + i 5 vertices * 9 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> D A -> E B -> D B -> E C -> B C -> D C -> E E -> B E -> D Code graph_from_literal(A:B:C - +D:E + -F:G:H - +I + -J:K:L:M) Output - IGRAPH DN-- 13 19 -- - + attr: name (v/c) - + edges (vertex names): - [1] A->D A->E B->D B->E C->D C->E F->D F->E F->I G->D G->E G->I H->D H->E H->I - [16] J->I K->I L->I M->I + -- -------------------------------------------------------------------- + i directed * named + i 13 vertices * 19 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] A -> D A -> E B -> D B -> E C -> D C -> E F -> D F -> E F -> I + [10] G -> D G -> E G -> I H -> D H -> E H -> I J -> I K -> I L -> I + [19] M -> I # graph_from_literal(simplify = FALSE) Code graph_from_literal(1 - 1, 1 - 2, 1 - 2) Output - IGRAPH UN-- 2 1 -- - + attr: name (v/c) - + edge (vertex names): - [1] 1--2 + -- -------------------------------------------------------------------- + i undirected * named + i 2 vertices * 1 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] 1 -- 2 Code graph_from_literal(1 - 1, 1 - 2, 1 - 2, simplify = FALSE) Output - IGRAPH UN-- 2 3 -- - + attr: name (v/c) - + edges (vertex names): - [1] 1--1 1--2 1--2 + -- -------------------------------------------------------------------- + i undirected * named + i 2 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> vertex: name + + -- Edges (vertex names) -------------------------------------------------------- + [1] 1 -- 1 1 -- 2 1 -- 2 # make_empty_graph gives an error for invalid arguments diff --git a/tests/testthat/_snaps/other.md b/tests/testthat/_snaps/other.md index 5c2f5616b89..0b5dc90eb4a 100644 --- a/tests/testthat/_snaps/other.md +++ b/tests/testthat/_snaps/other.md @@ -11,17 +11,27 @@ Code g Output - IGRAPH D--- 3 3 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l) - + edges: - [1] 1->2 2->3 3->1 + -- Ring graph --------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 1 Code gs Output - IGRAPH D--- 3 3 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l) - + edges: - [1] 1->2 2->3 3->1 + -- Ring graph --------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 1 # VS/ES require explicit conversion diff --git a/tests/testthat/_snaps/print-cli.md b/tests/testthat/_snaps/print-cli.md index ec41841ff94..3e32563bb99 100644 --- a/tests/testthat/_snaps/print-cli.md +++ b/tests/testthat/_snaps/print-cli.md @@ -10,7 +10,6 @@ ── Attributes ────────────────────────────────────────────────────────────────── → graph: name , mutual , circular - ── Edges ─────────────────────────────────────────────────────────────────────── [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 1 ─ 5 @@ -25,7 +24,6 @@ ── Attributes ────────────────────────────────────────────────────────────────── → graph: name , mutual , circular - # cli print.igraph: directed named weighted @@ -41,7 +39,6 @@ → vertex: name → edge: weight - ── Edges (vertex names) ──────────────────────────────────────────────────────── [1] A → B B → C C → A @@ -58,7 +55,6 @@ → graph: name , mutual , circular → vertex: name → edge: weight - # cli print.igraph: bipartite @@ -72,7 +68,6 @@ ── Attributes ────────────────────────────────────────────────────────────────── → vertex: type - ── Edges ─────────────────────────────────────────────────────────────────────── [1] 1 ─ 3 2 ─ 4 @@ -108,7 +103,6 @@ → vertex: name → edge: weight - ── Graph attributes ──────────────────────────────────────────────────────────── name: [1] "trio" @@ -194,7 +188,6 @@ -> graph: name , mutual , circular -> vertex: name - -- Edges (vertex names) -------------------------------------------------------- [1] A -> B B -> C C -> A @@ -226,7 +219,6 @@ ── Attributes ────────────────────────────────────────────────────────────────── → graph: name , mutual , circular - ── Edges ─────────────────────────────────────────────────────────────────────── [1] 1 ─ 2 2 ─ 3 3 ─ 4 4 ─ 5 5 ─ 6 6 ─ 7 [7] 7 ─ 8 8 ─ 9 9 ─ 10 10 ─ 11 11 ─ 12 12 ─ 13 diff --git a/tests/testthat/_snaps/structural-properties.md b/tests/testthat/_snaps/structural-properties.md index e006e10afcb..a2b0489cf8c 100644 --- a/tests/testthat/_snaps/structural-properties.md +++ b/tests/testthat/_snaps/structural-properties.md @@ -21,7 +21,7 @@ [1] "out" $order - + 2/5 vertices, named: + -- 2/5 * named ----------------------------------------------- [1] b c $rank @@ -29,17 +29,17 @@ 0 1 2 0 0 $parent - + 5/5 vertices, named: + -- 5/5 * named ----------------------------------------------- a b c z d b $pred - + 5/5 vertices, named: + -- 5/5 * named ----------------------------------------------- a b c z d b $succ - + 5/5 vertices, named: + -- 5/5 * named ----------------------------------------------- a b c z d c @@ -51,7 +51,7 @@ [1] "out" $father - + 5/5 vertices, named: + -- 5/5 * named ----------------------------------------------- a b c z d b diff --git a/tests/testthat/_snaps/trees.md b/tests/testthat/_snaps/trees.md index 91a639c3a30..72ad7519390 100644 --- a/tests/testthat/_snaps/trees.md +++ b/tests/testthat/_snaps/trees.md @@ -7,9 +7,14 @@ `subgraph.edges()` was deprecated in igraph 2.1.0. i Please use `subgraph_from_edges()` instead. Output - IGRAPH U--- 13 11 -- - + attr: name_1 (g/c), name_2 (g/c), loops_1 (g/l), loops_2 (g/l) - + edges: - [1] 1-- 2 1-- 8 3-- 6 3-- 8 4-- 5 5-- 7 6-- 7 9--11 9--13 10--13 - [11] 12--13 + -- -------------------------------------------------------------------- + i undirected + i 13 vertices * 11 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name_1 , name_2 , loops_1 , loops_2 + + -- Edges ----------------------------------------------------------------------- + [1] 1 -- 2 1 -- 8 3 -- 6 3 -- 8 4 -- 5 5 -- 7 6 -- 7 + [8] 9 -- 11 9 -- 13 10 -- 13 12 -- 13 diff --git a/tests/testthat/_snaps/versions.md b/tests/testthat/_snaps/versions.md index 27d877e05dd..7184cd347a6 100644 --- a/tests/testthat/_snaps/versions.md +++ b/tests/testthat/_snaps/versions.md @@ -56,10 +56,17 @@ i Call `igraph::upgrade_graph()` on it to use with the current igraph version. For now we convert it on the fly... Output - IGRAPH D--- 3 3 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) - + edges: - [1] 1->2 2->3 3->1 + -- Ring graph --------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + -> vertex: bar + -> edge: foo + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 1 Code graph_version(g) Output @@ -110,18 +117,32 @@ i Call `igraph::upgrade_graph()` on it to use with the current igraph version. For now we convert it on the fly... Output - IGRAPH D--- 3 3 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) - + edges: - [1] 1->2 2->3 3->1 + -- Ring graph --------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + -> vertex: bar + -> edge: foo + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 1 --- Code s[["1.5.0"]] Output - IGRAPH D--- 3 3 -- Ring graph - + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) - + edges: - [1] 1->2 2->3 3->1 + -- Ring graph --------------------------------------------------------- + i directed + i 3 vertices * 3 edges + + -- Attributes ------------------------------------------------------------------ + -> graph: name , mutual , circular + -> vertex: bar + -> edge: foo + + -- Edges ----------------------------------------------------------------------- + [1] 1 -> 2 2 -> 3 3 -> 1 diff --git a/tests/testthat/test-games.R b/tests/testthat/test-games.R index f06cfc8835d..6400837cbdd 100644 --- a/tests/testthat/test-games.R +++ b/tests/testthat/test-games.R @@ -393,6 +393,7 @@ test_that("sample_bipartite works -- undirected gnp", { }) test_that("sample_bipartite works -- directed gnp", { + local_igraph_options(print.style = "classic") g_rand_bip_dir <- sample_bipartite_gnp(10, 5, p = 0.1, directed = TRUE) expect_vcount(g_rand_bip_dir, 15) expect_ecount(g_rand_bip_dir, 6) @@ -418,6 +419,7 @@ test_that("sample_bipartite works -- undirected gnm", { expect_false(is_directed(g_rand_bip_gnm)) }) test_that("sample_bipartite works -- directed gnm", { + local_igraph_options(print.style = "classic") g_rand_bip_gnm_dir <- sample_bipartite_gnm(10, 5, m = 8, directed = TRUE) expect_vcount(g_rand_bip_gnm_dir, 15) expect_ecount(g_rand_bip_gnm_dir, 8) diff --git a/tests/testthat/test-print.R b/tests/testthat/test-print.R index 940b857af20..70362ad1995 100644 --- a/tests/testthat/test-print.R +++ b/tests/testthat/test-print.R @@ -1,5 +1,5 @@ test_that("print.igraph() works", { - local_igraph_options(print.full = TRUE) + local_igraph_options(print.full = TRUE, print.style = "classic") withr::local_options(width = 76) g <- make_ring(5) @@ -72,7 +72,7 @@ test_that("print.igraph() works", { }) test_that("print.igraph() respects max.print for adjacency list formats", { - local_igraph_options(print.full = TRUE) + local_igraph_options(print.full = TRUE, print.style = "classic") withr::local_options(width = 76, max.print = 3) g <- make_full_graph(6) @@ -98,7 +98,7 @@ test_that("print.igraph() respects max.print for adjacency list formats", { }) test_that("print.igraph() omits no message when vcount <= max.print", { - local_igraph_options(print.full = TRUE) + local_igraph_options(print.full = TRUE, print.style = "classic") withr::local_options(width = 76, max.print = 10) g <- make_full_graph(6) @@ -111,7 +111,7 @@ test_that("print.igraph() omits no message when vcount <= max.print", { }) test_that("print.igraph() respects max.print in the adjlist wrapping branch", { - local_igraph_options(print.full = TRUE) + local_igraph_options(print.full = TRUE, print.style = "classic") withr::local_options(width = 40, max.print = 2) g <- make_full_graph(20) @@ -129,7 +129,7 @@ test_that("print.igraph() respects max.print in the adjlist wrapping branch", { }) test_that("print.igraph.es() uses vertex names", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.style = "classic") g <- make_directed_graph(c("A", "B")) expect_snapshot({ @@ -139,7 +139,7 @@ test_that("print.igraph.es() uses vertex names", { test_that("vs printing", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -156,7 +156,7 @@ test_that("vs printing", { }) test_that("vs printing, complex attributes", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -172,7 +172,7 @@ test_that("vs printing, complex attributes", { }) test_that("es printing", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -187,7 +187,7 @@ test_that("es printing", { }) test_that("es printing, complex attributes", { - local_igraph_options(print.id = FALSE) + local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) From 1e41d56ba3c305280047bd50631606b440013afc Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 15:32:26 +0200 Subject: [PATCH 09/20] Document print.style option for cli-styled output in print.igraph man page --- man/print.igraph.Rd | 5 +++++ man/print.igraph.es.Rd | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/man/print.igraph.Rd b/man/print.igraph.Rd index 286ef6bd9a0..9b3c821a4ea 100644 --- a/man/print.igraph.Rd +++ b/man/print.igraph.Rd @@ -100,6 +100,11 @@ As of igraph 0.4 \code{print_all()} and \code{print.igraph()} use the As of igraph 1.1.1, the \code{str.igraph} function is defunct, use \code{print_all()}. + +Set \code{igraph_options(print.style = "cli")} to switch to a cli-styled +output with section rules, typed attribute listings and Unicode arrows +for edges. The default \code{"classic"} keeps the historical +\verb{IGRAPH ... DNW-} header relied on by parsers and tutorials. } \section{Related documentation in the C library}{ \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_degree}{\code{degree()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_is_directed}{\code{is_directed()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}} diff --git a/man/print.igraph.es.Rd b/man/print.igraph.es.Rd index 4b481b4147a..b5d2dbe95f1 100644 --- a/man/print.igraph.es.Rd +++ b/man/print.igraph.es.Rd @@ -30,7 +30,7 @@ differently, together with all attributes of the edges in the sequence, as a table. } \section{Related documentation in the C library}{ -\href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_is_directed}{\code{is_directed()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}} +\href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_is_directed}{\code{is_directed()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}} } \examples{ From 9b2de7c17c01faca1a7590d58d80e036092612cd Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 15:34:37 +0200 Subject: [PATCH 10/20] Fix whitespace in `make_graph` formula examples in documentation --- R/iterators.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index 62d4d891f10..bfdc908317b 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -523,14 +523,14 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { #' #' # ----------------------------------------------------------------- #' # The same with vertex names -#' g <- make_graph(~A -+ B, B -+ C:D, D -+ B) +#' g <- make_graph(~ A -+ B, B -+ C:D, D -+ B) #' V(g)[.nei(c("B", "D"))] #' V(g)[.nei(c("B", "D"), "in")] #' V(g)[.nei(c("B", "D"), "out")] #' #' # ----------------------------------------------------------------- #' # Resolving attributes -#' g <- make_graph(~A -+ B, B -+ C:D, D -+ B) +#' g <- make_graph(~ A -+ B, B -+ C:D, D -+ B) #' V(g)$color <- c("red", "red", "green", "green") #' V(g)[color == "red"] #' From a72b769cfb76c22f77e129f43c66a28281ed46c1 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 15:45:50 +0200 Subject: [PATCH 11/20] Improve comments and robustness of vertex/edge sequence printing Add detailed documentation explaining the dual layout modes (detailed vs compact) for vertex and edge sequence printing, clarify the role of the "single" attribute flag, and replace `identical(full, TRUE)` / `is.logical(full) && full` with `isTRUE(full)` for consistency. --- R/iterators.R | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index bfdc908317b..b6c5039df62 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1592,13 +1592,28 @@ print_igraph_vs_cli <- function( ) cat(cli::rule(left = title), "\n", sep = "") - # Single index into a graph with attributes: show the attribute table. + # A vertex sequence prints in one of two layouts: + # + # * detailed -- one row per selected vertex with every vertex attribute as + # a column (a metadata table); produced by `V(g)[[...]]`. + # * compact -- a bare list of vertex ids, or names when present; produced + # by `V(g)[...]`. + # + # `[[` and `[` build the *same* underlying sequence: `[[.igraph.vs` merely + # tags its result with a "single" attribute, which is_single_index() reads + # here. So the only signal asking for the detailed view is that flag. We use + # the table only when it is set AND the graph is still alive (a sequence can + # outlive its graph) AND the graph actually has attributes to tabulate; + # anything else falls through to the compact list below. if ( is_single_index(x) && !is.null(graph) && length(vertex_attr_names(graph)) > 0 ) { vertex_attrs <- vertex_attr(graph) + # A data.frame needs flat columns, so it works only when every attribute is + # atomic. If any attribute is list-valued, drop to a named list sliced to + # the selected vertices instead of forcing it into a table. if (all(sapply(vertex_attrs, is.atomic))) { print(as.data.frame(vertex_attrs, stringsAsFactors = FALSE)[ as.vector(x), @@ -1619,7 +1634,7 @@ print_igraph_vs_cli <- function( x2 <- as.vector(x) } if (length(x2)) { - if (is.logical(full) && full) { + if (isTRUE(full)) { print(x2, quote = FALSE) } else { head_print( @@ -1669,9 +1684,24 @@ print_igraph_es_cli <- function( return(invisible(x)) } - # Single index into a graph: show endpoints plus the attribute table. + # An edge sequence prints in one of two layouts, mirroring vertex sequences: + # + # * detailed -- one row per selected edge with its endpoints and every edge + # attribute as columns (a metadata table); produced by `E(g)[[...]]`. + # * compact -- a list of "tail head" strings; produced by + # `E(g)[...]`. Handled further below. + # + # As with vertex sequences, `[[` and `[` build the same underlying sequence; + # `[[.igraph.es` only tags its result with the "single" attribute that + # is_single_index() reads here. The table needs only that flag and a live + # graph -- unlike the vertex case there is no attribute-count check, because + # an edge always has endpoints to tabulate (the tail/head names plus their + # raw numeric ids in tid/hid), so the table is never empty. if (is_single_index(x) && !is.null(graph)) { edge_attrs <- edge_attr(graph) + # A data.frame needs flat columns, so the endpoint table is built only when + # every attribute is atomic; a list-valued attribute drops to a named list + # slice instead (and loses the endpoint columns, as there is no frame). if (all(sapply(edge_attrs, is.atomic))) { etail <- tail_of(graph, x) ehead <- head_of(graph, x) @@ -1697,7 +1727,7 @@ print_igraph_es_cli <- function( return(invisible(x)) } - max_lines <- if (identical(full, TRUE)) { + max_lines <- if (isTRUE(full)) { NULL } else { igraph_opt("auto.print.lines") From 97d642d60a04c27e029093d01fb8cb7c6b40787f Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 15:46:38 +0200 Subject: [PATCH 12/20] Reformat if-else expression in print_igraph_header_cli for readability --- R/print.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/print.R b/R/print.R index b9458fa05f3..c5bbb14fd42 100644 --- a/R/print.R +++ b/R/print.R @@ -698,7 +698,11 @@ attr_codes_cli <- function(x, kind) { } print_igraph_header_cli <- function(x, id) { - name <- if ("name" %in% graph_attr_names(x)) as.character(x$name)[1] else NULL + name <- if ("name" %in% graph_attr_names(x)) { + as.character(x$name)[1] + } else { + NULL + } title <- if (!is.null(name) && !is.na(name) && nzchar(name)) { paste0(" ", name) } else { From defa9c0dd6e0bba0c7ac8c01bd503390c62e36c9 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 16:08:18 +0200 Subject: [PATCH 13/20] Refactor `attr_label_cli` and attribute summary formatting to use cli semantic classes (`.field`, `.cls`) instead of hard-coded colors --- R/print.R | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/R/print.R b/R/print.R index c5bbb14fd42..bc5c5fb9762 100644 --- a/R/print.R +++ b/R/print.R @@ -676,14 +676,16 @@ middot_cli <- function() { if (cli::is_utf8_output()) "\u00b7" else "*" } +# Bare type label for an attribute mode code; the surrounding `<...>` is added +# by cli's `{.cls}` inline class at the call site. attr_label_cli <- function(code) { switch( code, - c = "", - n = "", - l = "", - x = "", - paste0("<", code, ">") + c = "chr", + n = "dbl", + l = "lgl", + x = "list", + code ) } @@ -758,11 +760,19 @@ print_igraph_attr_summary_cli <- function(x) { cat("\n", cli::rule(left = "Attributes"), "\n", sep = "") arrow <- if (cli::is_utf8_output()) "\u2192" else "->" + # Style names and type codes via cli's semantic classes (`.field`, `.cls`) + # rather than hand-picked colors, so cli's theme owns the palette and it + # respects NO_COLOR / non-tty output. `.cls` also supplies the `<...>`. format_line <- function(label, names, codes) { - parts <- paste0( - cli::col_yellow(names), - " ", - cli::col_silver(vapply(codes, attr_label_cli, character(1))) + labels <- vapply(codes, attr_label_cli, character(1)) + parts <- vapply( + seq_along(names), + function(i) { + nm <- names[i] + lbl <- labels[i] + cli::format_inline("{.field {nm}} {.cls {lbl}}") + }, + character(1) ) paste0(arrow, " ", label, paste(parts, collapse = ", ")) } From f68ce312df09d7ecffcc1fd915af0d138af865b8 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 16:34:40 +0200 Subject: [PATCH 14/20] Refactor CLI print helpers: extract shared utilities for section rules, edge formatting, and line printing --- R/iterators.R | 87 ++++------------------------------ R/print.R | 126 +++++++++++++++++++++++++++++--------------------- 2 files changed, 83 insertions(+), 130 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index b6c5039df62..70319d81ef7 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1590,7 +1590,7 @@ print_igraph_vs_cli <- function( total, flag_suffix_cli(flags, middot) ) - cat(cli::rule(left = title), "\n", sep = "") + cli_section(title, blank = FALSE) # A vertex sequence prints in one of two layouts: # @@ -1614,7 +1614,7 @@ print_igraph_vs_cli <- function( # A data.frame needs flat columns, so it works only when every attribute is # atomic. If any attribute is list-valued, drop to a named list sliced to # the selected vertices instead of forcing it into a table. - if (all(sapply(vertex_attrs, is.atomic))) { + if (all(vapply(vertex_attrs, is.atomic, logical(1)))) { print(as.data.frame(vertex_attrs, stringsAsFactors = FALSE)[ as.vector(x), , @@ -1634,16 +1634,8 @@ print_igraph_vs_cli <- function( x2 <- as.vector(x) } if (length(x2)) { - if (isTRUE(full)) { - print(x2, quote = FALSE) - } else { - head_print( - x2, - omitted_footer = "+ ... omitted several vertices\n", - quote = FALSE, - max_lines = igraph_opt("auto.print.lines") - ) - } + max_lines <- if (isTRUE(full)) NULL else igraph_opt("auto.print.lines") + print_cli_lines(x2, max_lines, "+ ... omitted several vertices\n") } } @@ -1678,7 +1670,7 @@ print_igraph_es_cli <- function( total, flag_suffix_cli(flags, middot) ) - cat(cli::rule(left = title), "\n", sep = "") + cli_section(title, blank = FALSE) if (length(x) == 0) { return(invisible(x)) @@ -1698,67 +1690,17 @@ print_igraph_es_cli <- function( # an edge always has endpoints to tabulate (the tail/head names plus their # raw numeric ids in tid/hid), so the table is never empty. if (is_single_index(x) && !is.null(graph)) { - edge_attrs <- edge_attr(graph) - # A data.frame needs flat columns, so the endpoint table is built only when - # every attribute is atomic; a list-valued attribute drops to a named list - # slice instead (and loses the endpoint columns, as there is no frame). - if (all(sapply(edge_attrs, is.atomic))) { - etail <- tail_of(graph, x) - ehead <- head_of(graph, x) - df <- data.frame( - stringsAsFactors = FALSE, - tail = as_ids(etail), - head = as_ids(ehead), - tid = as.vector(etail), - hid = as.vector(ehead) - ) - if (length(edge_attrs)) { - edge_attrs <- do_call( - data.frame, - .args = edge_attrs, - stringsAsFactors = FALSE - ) - df <- cbind(df, edge_attrs[as.vector(x), , drop = FALSE]) - } - print(df) - } else { - print(lapply(edge_attrs, "[", as.vector(x))) - } + print_edge_detail(graph, x) return(invisible(x)) } - max_lines <- if (isTRUE(full)) { - NULL - } else { - igraph_opt("auto.print.lines") - } + max_lines <- if (isTRUE(full)) NULL else igraph_opt("auto.print.lines") if (!is.null(graph)) { - # Live graph: render endpoints with arrows. The trailing space puts two - # spaces between edges once print() adds its own single-space separator. + # Live graph: render endpoints with arrows. arrow <- edge_arrow_cli(is_directed(graph)) endpoints <- ends(graph, x, names = has_vnames || is_named(graph)) - # Endpoints are not padded to a common width, so each edge reads as - # "tail ─ head" with a single space around the delimiter. The trailing - # space puts two spaces between edges once print() adds its own separator. - formatted <- paste0( - endpoints[, 1], - " ", - arrow, - " ", - endpoints[, 2], - " " - ) - if (is.null(max_lines)) { - print(formatted, quote = FALSE) - } else { - head_print( - formatted, - omitted_footer = "+ ... omitted several edges\n", - quote = FALSE, - max_lines = max_lines - ) - } + body <- format_cli_edge_endpoints(endpoints, arrow) } else { # Graph was deleted: fall back to stored vertex names / ids. body <- if (!is.null(attr(x, "vnames"))) { @@ -1768,17 +1710,8 @@ print_igraph_es_cli <- function( } else { as.vector(x) } - if (is.null(max_lines)) { - print(body, quote = FALSE) - } else { - head_print( - body, - omitted_footer = "+ ... omitted several edges\n", - quote = FALSE, - max_lines = max_lines - ) - } } + print_cli_lines(body, max_lines, "+ ... omitted several edges\n") invisible(x) } diff --git a/R/print.R b/R/print.R index bc5c5fb9762..00a284db25d 100644 --- a/R/print.R +++ b/R/print.R @@ -286,6 +286,32 @@ } } +# Print the "single index" (`[[`) edge detail view: one row per edge with +# tail/head names, their raw numeric ids (tid/hid) and one column per atomic +# edge attribute. If any attribute is list-valued, the frame can't hold it, so +# fall back to a per-attribute named list sliced to the selected edges. +print_edge_detail <- function(graph, edges) { + ea <- edge_attr(graph) + if (all(vapply(ea, is.atomic, logical(1)))) { + etail <- tail_of(graph, edges) + ehead <- head_of(graph, edges) + df <- data.frame( + stringsAsFactors = FALSE, + tail = as_ids(etail), + head = as_ids(ehead), + tid = as.vector(etail), + hid = as.vector(ehead) + ) + if (length(ea)) { + ea <- do_call(data.frame, .args = ea, stringsAsFactors = FALSE) + df <- cbind(df, ea[as.vector(edges), , drop = FALSE]) + } + print(df) + } else { + print(lapply(ea, "[", as.vector(edges))) + } +} + .print.edges.compressed <- function( x, edges = E(x), @@ -316,25 +342,7 @@ if (is_single_index(edges) && !is.null(x)) { ## Double bracket - ea <- edge_attr(x) - if (all(sapply(ea, is.atomic))) { - etail <- tail_of(x, edges) - ehead <- head_of(x, edges) - df <- data.frame( - stringsAsFactors = FALSE, - tail = as_ids(etail), - head = as_ids(ehead), - tid = as.vector(etail), - hid = as.vector(ehead) - ) - if (length(ea)) { - ea <- do_call(data.frame, .args = ea, stringsAsFactors = FALSE) - df <- cbind(df, ea[as.vector(edges), , drop = FALSE]) - } - print(df) - } else { - print(lapply(ea, "[", as.vector(edges))) - } + print_edge_detail(x, edges) } else if (is.null(max.lines)) { .print.edges.compressed.all(x, edges, names) } else { @@ -548,9 +556,10 @@ print_all <- function(object, ...) { #' As of igraph 1.1.1, the `str.igraph` function is defunct, use #' `print_all()`. #' -#' Set `igraph_options(print.style = "cli")` to switch to a cli-styled -#' output with section rules, typed attribute listings and Unicode arrows -#' for edges. The default `"classic"` keeps the historical +#' Output style is controlled by the `print.style` igraph option. The default +#' `"cli"` produces cli-styled output with section rules, typed attribute +#' listings and Unicode arrows for edges. Set +#' `igraph_options(print.style = "classic")` for the historical #' `IGRAPH ... DNW-` header relied on by parsers and tutorials. #' #' @aliases print.igraph print_all summary.igraph str.igraph @@ -658,6 +667,40 @@ is_cli_style <- function() { identical(igraph_opt("print.style"), "cli") } +# Emit a cli section rule. The leading blank line separates this section from +# the previous one; `blank = FALSE` omits it for the first (header) rule. +cli_section <- function(title, right = NULL, blank = TRUE) { + rule <- if (is.null(right)) { + cli::rule(left = title) + } else { + cli::rule(left = title, right = right) + } + cat(if (blank) "\n", rule, "\n", sep = "") +} + +# Print a character vector either in full (`max.lines = NULL`) or truncated to +# `max.lines` with cli's omission footer. +print_cli_lines <- function(x, max.lines, omitted_footer) { + if (is.null(max.lines)) { + print(x, quote = FALSE) + } else { + head_print( + x, + omitted_footer = omitted_footer, + quote = FALSE, + max_lines = max.lines + ) + } +} + +# Format edge endpoints as "tail head " strings. Endpoints are not +# padded to a common width, so each edge reads with a single space around the +# delimiter; the trailing space yields two spaces between edges once print() +# adds its own single-space separator. +format_cli_edge_endpoints <- function(endpoints, arrow) { + paste0(endpoints[, 1], " ", arrow, " ", endpoints[, 2], " ") +} + # Leading + interleaved middot separators for a vector of flag labels; # returns "" when there are no flags (avoids an if/else at the call site). flag_suffix_cli <- function(flags, middot) { @@ -714,11 +757,8 @@ print_igraph_header_cli <- function(x, id) { graph_id_short <- if (isTRUE(id)) substr(graph_id(x), 1, 7) else NA_character_ # Show the graph id on the right of the rule only when we have one. - if (!is.na(graph_id_short) && nzchar(graph_id_short)) { - cat(cli::rule(left = title, right = graph_id_short), "\n", sep = "") - } else { - cat(cli::rule(left = title), "\n", sep = "") - } + has_id <- !is.na(graph_id_short) && nzchar(graph_id_short) + cli_section(title, right = if (has_id) graph_id_short, blank = FALSE) properties <- c( if (is_directed(x)) "directed" else "undirected", @@ -757,7 +797,7 @@ print_igraph_attr_summary_cli <- function(x) { return(invisible(NULL)) } - cat("\n", cli::rule(left = "Attributes"), "\n", sep = "") + cli_section("Attributes") arrow <- if (cli::is_utf8_output()) "\u2192" else "->" # Style names and type codes via cli's semantic classes (`.field`, `.cls`) @@ -798,7 +838,7 @@ print_igraph_graph_attrs_cli <- function(x) { if (length(attr_names) == 0) { return(invisible(NULL)) } - cat("\n", cli::rule(left = "Graph attributes"), "\n", sep = "") + cli_section("Graph attributes") for (attr_name in attr_names) { cat(cli::format_inline("{.field {attr_name}}:"), "\n", sep = "") indent_print(graph_attr(x, attr_name), .indent = " ") @@ -809,7 +849,7 @@ print_igraph_vertex_attrs_cli <- function(x) { if (length(vertex_attr_names(x)) == 0) { return(invisible(NULL)) } - cat("\n", cli::rule(left = "Vertex attributes"), "\n", sep = "") + cli_section("Vertex attributes") # reuse classic tabular renderer .print.vertex.attributes.old(x, full = TRUE, max.lines = NULL) } @@ -847,7 +887,7 @@ print_igraph_edges_cli <- function( } else { paste0("Edges", title_suffix) } - cat("\n", cli::rule(left = title), "\n", sep = "") + cli_section(title) arrow <- edge_arrow_cli(is_directed(x)) endpoints <- ends(x, edges, names = is_named_g) @@ -879,28 +919,8 @@ print_igraph_edges_cli <- function( } print(tab) } else { - # Plain edge list. Endpoints are not padded to a common width, so each - # edge reads as "tail ─ head" with a single space around the delimiter. - # The trailing space puts two spaces between edges once print() adds its - # own single-space separator. - formatted <- paste0( - endpoints[, 1], - " ", - arrow, - " ", - endpoints[, 2], - " " - ) - if (is.null(max.lines)) { - print(formatted, quote = FALSE) - } else { - head_print( - formatted, - omitted_footer = "+ ... omitted several edges\n", - quote = FALSE, - max_lines = max.lines - ) - } + formatted <- format_cli_edge_endpoints(endpoints, arrow) + print_cli_lines(formatted, max.lines, "+ ... omitted several edges\n") } } From ee520abb4e6c89172150a579d6b44d02c9f1b201 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 17:02:29 +0200 Subject: [PATCH 15/20] Pin print options in test setup; split classic print tests out Add tests/testthat/setup.R pinning `print.style = "classic"` and `print.id = FALSE` for the whole suite, so test output is deterministic and no longer depends on the package defaults (print.style now defaults to "cli"). cli output is exercised explicitly in test-print-cli.R. - Rename test-print.R -> test-print-classic.R (and its snapshot file) to mirror test-print-cli.R, and revert its content to the pre-branch state now that setup.R pins the style. - Drop the now-redundant per-test `print.style = "classic"` settings (test-games.R) and `print.id = FALSE` settings across the suite. test-par.R keeps its print.id settings as it tests the option itself. - Restore the snapshots that had churned to cli output back to classic; regenerate flow.md, where pinning print.id off removes a graph id that the test previously masked via transform. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/testthat/_snaps/aaa-auto.md | 2082 ++++++----------- tests/testthat/_snaps/adjacency.md | 134 +- tests/testthat/_snaps/flow.md | 6 +- tests/testthat/_snaps/foreign.md | 26 +- tests/testthat/_snaps/incidence.md | 82 +- tests/testthat/_snaps/iterators.md | 42 +- tests/testthat/_snaps/make.md | 175 +- tests/testthat/_snaps/other.md | 26 +- .../_snaps/{print.md => print-classic.md} | 0 .../testthat/_snaps/structural-properties.md | 10 +- tests/testthat/_snaps/trees.md | 15 +- tests/testthat/_snaps/versions.md | 45 +- tests/testthat/setup.R | 6 + tests/testthat/test-aaa-auto.R | 728 +----- tests/testthat/test-adjacency.R | 2 - tests/testthat/test-conversion.R | 2 - tests/testthat/test-foreign.R | 3 - tests/testthat/test-games.R | 2 - tests/testthat/test-incidence.R | 8 - tests/testthat/test-iterators.R | 3 - tests/testthat/test-make.R | 5 - tests/testthat/test-other.R | 1 - .../{test-print.R => test-print-classic.R} | 13 +- tests/testthat/test-print-cli.R | 16 +- tests/testthat/test-structural-properties.R | 1 - tests/testthat/test-trees.R | 1 - tests/testthat/test-versions.R | 2 - 27 files changed, 947 insertions(+), 2489 deletions(-) rename tests/testthat/_snaps/{print.md => print-classic.md} (100%) create mode 100644 tests/testthat/setup.R rename tests/testthat/{test-print.R => test-print-classic.R} (89%) diff --git a/tests/testthat/_snaps/aaa-auto.md b/tests/testthat/_snaps/aaa-auto.md index ed9de94f88f..ecfe53099c6 100644 --- a/tests/testthat/_snaps/aaa-auto.md +++ b/tests/testthat/_snaps/aaa-auto.md @@ -3,18 +3,16 @@ Code empty_impl() Output - -- -------------------------------------------------------------------- - i directed - i 0 vertices * 0 edges + IGRAPH D--- 0 0 -- + + edges: --- Code empty_impl(n = 5, directed = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 0 edges + IGRAPH U--- 5 0 -- + + edges: # empty_impl errors @@ -30,12 +28,9 @@ Code add_edges_impl(graph = g, edges = c(1, 2, 2, 3)) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 + IGRAPH D--- 3 2 -- + + edges: + [1] 1->2 2->3 # add_edges_impl errors @@ -50,9 +45,8 @@ Code copy_impl(from = g) Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 0 edges + IGRAPH D--- 2 0 -- + + edges: # copy_impl errors @@ -68,9 +62,8 @@ delete_vertices_idx_impl(graph = g, vertices = 1) Output $graph - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 0 edges + IGRAPH D--- 2 0 -- + + edges: $idx [1] 0 1 2 @@ -129,7 +122,7 @@ Code get_all_eids_between_impl(graph = g, from = 1, to = 2) Output - -- 0/0 --------------------------------------------------------- + + 0/0 edges: # get_all_eids_between_impl errors @@ -144,24 +137,18 @@ Code wheel_impl(n = 5) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 8 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 1 -> 4 1 -> 5 2 -> 3 3 -> 4 4 -> 5 5 -> 2 + IGRAPH D--- 5 8 -- + + edges: + [1] 1->2 1->3 1->4 1->5 2->3 3->4 4->5 5->2 --- Code wheel_impl(n = 5, mode = "in", center = 2) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 8 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 3 2 -> 3 4 -> 3 5 -> 3 1 -> 2 2 -> 4 4 -> 5 5 -> 1 + IGRAPH D--- 5 8 -- + + edges: + [1] 1->3 2->3 4->3 5->3 1->2 2->4 4->5 5->1 # wheel_impl errors @@ -177,26 +164,18 @@ Code hypercube_impl(n = 3) Output - -- -------------------------------------------------------------------- - i undirected - i 8 vertices * 12 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 4 3 -- 7 4 -- 8 5 -- 6 - [10] 5 -- 7 6 -- 8 7 -- 8 + IGRAPH U--- 8 12 -- + + edges: + [1] 1--2 1--3 1--5 2--4 2--6 3--4 3--7 4--8 5--6 5--7 6--8 7--8 --- Code hypercube_impl(n = 3, directed = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 8 vertices * 12 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 1 -> 5 2 -> 4 2 -> 6 3 -> 4 3 -> 7 4 -> 8 5 -> 6 - [10] 5 -> 7 6 -> 8 7 -> 8 + IGRAPH D--- 8 12 -- + + edges: + [1] 1->2 1->3 1->5 2->4 2->6 3->4 3->7 4->8 5->6 5->7 6->8 7->8 # hypercube_impl errors @@ -212,12 +191,9 @@ Code square_lattice_impl(dimvector = c(2, 2)) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 4 3 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--2 1--3 2--4 3--4 --- @@ -225,13 +201,9 @@ square_lattice_impl(dimvector = c(2, 2), nei = 2, directed = TRUE, mutual = TRUE, periodic = c(TRUE, TRUE)) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 4 3 -> 4 3 -> 1 4 -> 3 4 -> 2 1 -> 4 - [10] 2 -> 3 + IGRAPH D--- 4 10 -- + + edges: + [1] 1->2 1->3 2->1 2->4 3->4 3->1 4->3 4->2 1->4 2->3 # square_lattice_impl errors @@ -247,25 +219,18 @@ Code triangular_lattice_impl(dimvector = c(2, 2)) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 5 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 4 1 -- 3 2 -- 4 3 -- 4 + IGRAPH U--- 4 5 -- + + edges: + [1] 1--2 1--4 1--3 2--4 3--4 --- Code triangular_lattice_impl(dimvector = c(2, 2), directed = TRUE, mutual = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 1 1 -> 4 4 -> 1 1 -> 3 3 -> 1 2 -> 4 4 -> 2 3 -> 4 - [10] 4 -> 3 + IGRAPH D--- 4 10 -- + + edges: + [1] 1->2 2->1 1->4 4->1 1->3 3->1 2->4 4->2 3->4 4->3 # triangular_lattice_impl errors @@ -281,24 +246,18 @@ Code path_graph_impl(n = 5) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 + IGRAPH U--- 5 4 -- + + edges: + [1] 1--2 2--3 3--4 4--5 --- Code path_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 8 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 1 2 -> 3 3 -> 2 3 -> 4 4 -> 3 4 -> 5 5 -> 4 + IGRAPH D--- 5 8 -- + + edges: + [1] 1->2 2->1 2->3 3->2 3->4 4->3 4->5 5->4 # path_graph_impl errors @@ -314,25 +273,18 @@ Code cycle_graph_impl(n = 5) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 5 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 + IGRAPH U--- 5 5 -- + + edges: + [1] 1--2 2--3 3--4 4--5 1--5 --- Code cycle_graph_impl(n = 5, directed = TRUE, mutual = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 1 2 -> 3 3 -> 2 3 -> 4 4 -> 3 4 -> 5 5 -> 4 5 -> 1 - [10] 1 -> 5 + IGRAPH D--- 5 10 -- + + edges: + [1] 1->2 2->1 2->3 3->2 3->4 4->3 4->5 5->4 5->1 1->5 # cycle_graph_impl errors @@ -348,24 +300,18 @@ Code symmetric_tree_impl(branches = 3) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 1 -> 4 + IGRAPH D--- 4 3 -- + + edges: + [1] 1->2 1->3 1->4 --- Code symmetric_tree_impl(branches = 3, type = "in") Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 1 4 -> 1 + IGRAPH D--- 4 3 -- + + edges: + [1] 2->1 3->1 4->1 # symmetric_tree_impl errors @@ -381,26 +327,19 @@ Code regular_tree_impl(h = 2) Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 9 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 5 2 -- 6 3 -- 7 3 -- 8 4 -- 9 - [9] 4 -- 10 + IGRAPH U--- 10 9 -- + + edges: + [1] 1-- 2 1-- 3 1-- 4 2-- 5 2-- 6 3-- 7 3-- 8 4-- 9 4--10 --- Code regular_tree_impl(h = 2, k = 4, type = "in") Output - -- -------------------------------------------------------------------- - i directed - i 17 vertices * 16 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 1 4 -> 1 5 -> 1 6 -> 2 7 -> 2 8 -> 2 9 -> 3 - [9] 10 -> 3 11 -> 3 12 -> 4 13 -> 4 14 -> 4 15 -> 5 16 -> 5 17 -> 5 + IGRAPH D--- 17 16 -- + + edges: + [1] 2->1 3->1 4->1 5->1 6->2 7->2 8->2 9->3 10->3 11->3 12->4 13->4 + [13] 14->4 15->5 16->5 17->5 # regular_tree_impl errors @@ -416,26 +355,18 @@ Code full_citation_impl(n = 5) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 1 3 -> 2 4 -> 1 4 -> 2 4 -> 3 5 -> 1 5 -> 2 5 -> 3 - [10] 5 -> 4 + IGRAPH D--- 5 10 -- + + edges: + [1] 2->1 3->1 3->2 4->1 4->2 4->3 5->1 5->2 5->3 5->4 --- Code full_citation_impl(n = 5, directed = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 3 -- 4 1 -- 5 2 -- 5 3 -- 5 - [10] 4 -- 5 + IGRAPH U--- 5 10 -- + + edges: + [1] 1--2 1--3 2--3 1--4 2--4 3--4 1--5 2--5 3--5 4--5 # full_citation_impl errors @@ -451,21 +382,17 @@ Code atlas_impl(number = 0) Output - -- -------------------------------------------------------------------- - i undirected - i 0 vertices * 0 edges + IGRAPH U--- 0 0 -- + + edges: --- Code atlas_impl(number = 5) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 3 + IGRAPH U--- 3 1 -- + + edge: + [1] 2--3 # atlas_impl errors @@ -481,26 +408,18 @@ Code extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2))) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 15 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 1 -- 2 1 -- 3 2 -- 3 2 -- 4 - [10] 3 -- 4 3 -- 5 4 -- 5 1 -- 4 1 -- 5 2 -- 5 + IGRAPH U--- 5 15 -- + + edges: + [1] 1--2 2--3 3--4 4--5 1--5 1--2 1--3 2--3 2--4 3--4 3--5 4--5 1--4 1--5 2--5 --- Code extended_chordal_ring_impl(nodes = 5, W = matrix(c(1, 2)), directed = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 15 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 4 4 -> 5 5 -> 1 1 -> 2 1 -> 3 2 -> 3 2 -> 4 - [10] 3 -> 4 3 -> 5 4 -> 5 4 -> 1 5 -> 1 5 -> 2 + IGRAPH D--- 5 15 -- + + edges: + [1] 1->2 2->3 3->4 4->5 5->1 1->2 1->3 2->3 2->4 3->4 3->5 4->5 4->1 5->1 5->2 # extended_chordal_ring_impl errors @@ -516,24 +435,18 @@ Code graph_power_impl(graph = g, order = 2) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 3 2 -- 4 3 -- 5 + IGRAPH U--- 5 7 -- + + edges: + [1] 1--2 2--3 3--4 4--5 1--3 2--4 3--5 --- Code graph_power_impl(graph = g, order = 2, directed = TRUE) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 3 2 -- 4 3 -- 5 + IGRAPH U--- 5 7 -- + + edges: + [1] 1--2 2--3 3--4 4--5 1--3 2--4 3--5 # graph_power_impl errors @@ -548,12 +461,9 @@ Code linegraph_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 + IGRAPH U--- 4 3 -- + + edges: + [1] 1--2 2--3 3--4 # linegraph_impl errors @@ -568,13 +478,10 @@ Code de_bruijn_impl(m = 2, n = 3) Output - -- -------------------------------------------------------------------- - i directed - i 8 vertices * 16 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 1 1 -> 2 2 -> 3 2 -> 4 3 -> 5 3 -> 6 4 -> 7 4 -> 8 5 -> 1 - [10] 5 -> 2 6 -> 3 6 -> 4 7 -> 5 7 -> 6 8 -> 7 8 -> 8 + IGRAPH D--- 8 16 -- + + edges: + [1] 1->1 1->2 2->3 2->4 3->5 3->6 4->7 4->8 5->1 5->2 6->3 6->4 7->5 7->6 8->7 + [16] 8->8 # de_bruijn_impl errors @@ -590,18 +497,13 @@ Code kautz_impl(m = 2, n = 3) Output - -- -------------------------------------------------------------------- - i directed - i 24 vertices * 48 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 9 1 -> 10 2 -> 11 2 -> 12 3 -> 13 3 -> 14 4 -> 15 - [8] 4 -> 16 5 -> 17 5 -> 18 6 -> 19 6 -> 20 7 -> 21 7 -> 22 - [15] 8 -> 23 8 -> 24 9 -> 1 9 -> 2 10 -> 3 10 -> 4 11 -> 5 - [22] 11 -> 6 12 -> 7 12 -> 8 13 -> 17 13 -> 18 14 -> 19 14 -> 20 - [29] 15 -> 21 15 -> 22 16 -> 23 16 -> 24 17 -> 1 17 -> 2 18 -> 3 - [36] 18 -> 4 19 -> 5 19 -> 6 20 -> 7 20 -> 8 21 -> 9 21 -> 10 - [43] 22 -> 11 22 -> 12 23 -> 13 23 -> 14 24 -> 15 24 -> 16 + IGRAPH D--- 24 48 -- + + edges: + [1] 1-> 9 1->10 2->11 2->12 3->13 3->14 4->15 4->16 5->17 5->18 + [11] 6->19 6->20 7->21 7->22 8->23 8->24 9-> 1 9-> 2 10-> 3 10-> 4 + [21] 11-> 5 11-> 6 12-> 7 12-> 8 13->17 13->18 14->19 14->20 15->21 15->22 + [31] 16->23 16->24 17-> 1 17-> 2 18-> 3 18-> 4 19-> 5 19-> 6 20-> 7 20-> 8 + [41] 21-> 9 21->10 22->11 22->12 23->13 23->14 24->15 24->16 # kautz_impl errors @@ -617,16 +519,11 @@ Code lcf_vector_impl(n = 10, shifts = c(3, -3, 4), repeats = 2) Output - -- LCF graph ---------------------------------------------------------- - i undirected - i 10 vertices * 16 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 4 1 -- 10 2 -- 3 2 -- 5 2 -- 9 3 -- 4 3 -- 7 - [9] 4 -- 5 4 -- 7 5 -- 6 6 -- 7 6 -- 10 7 -- 8 8 -- 9 9 -- 10 + IGRAPH U--- 10 16 -- LCF graph + + attr: name (g/c) + + edges: + [1] 1-- 2 1-- 4 1--10 2-- 3 2-- 5 2-- 9 3-- 4 3-- 7 4-- 5 4-- 7 5-- 6 6-- 7 + [13] 6--10 7-- 8 8-- 9 9--10 # lcf_vector_impl errors @@ -642,12 +539,9 @@ Code mycielski_graph_impl(k = 3) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 5 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 4 2 -- 3 3 -- 5 4 -- 5 + IGRAPH U--- 5 5 -- + + edges: + [1] 1--2 1--4 2--3 3--5 4--5 # mycielski_graph_impl errors @@ -663,12 +557,9 @@ Code adjlist_impl(adjlist = list(c(2, 3), c(1), c(1)), mode = "out") Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 1 3 -> 1 + IGRAPH D--- 3 4 -- + + edges: + [1] 1->2 1->3 2->1 3->1 # adjlist_impl errors @@ -685,12 +576,9 @@ full_bipartite_impl(n1 = 2, n2 = 3) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 4 1 -- 5 2 -- 3 2 -- 4 2 -- 5 + IGRAPH U--- 5 6 -- + + edges: + [1] 1--3 1--4 1--5 2--3 2--4 2--5 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -702,12 +590,9 @@ full_bipartite_impl(n1 = 2, n2 = 3, directed = TRUE, mode = "in") Output $graph - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 4 -> 1 5 -> 1 3 -> 2 4 -> 2 5 -> 2 + IGRAPH D--- 5 6 -- + + edges: + [1] 3->1 4->1 5->1 3->2 4->2 5->2 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -728,14 +613,10 @@ full_multipartite_impl(n = c(2, 3, 4)) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 9 vertices * 26 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 2 -- 3 2 -- 4 - [10] 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 3 -- 6 3 -- 7 3 -- 8 3 -- 9 - [19] 4 -- 6 4 -- 7 4 -- 8 4 -- 9 5 -- 6 5 -- 7 5 -- 8 5 -- 9 + IGRAPH U--- 9 26 -- + + edges: + [1] 1--3 1--4 1--5 1--6 1--7 1--8 1--9 2--3 2--4 2--5 2--6 2--7 2--8 2--9 3--6 + [16] 3--7 3--8 3--9 4--6 4--7 4--8 4--9 5--6 5--7 5--8 5--9 $types [1] 1 1 2 2 2 3 3 3 3 @@ -756,14 +637,10 @@ full_multipartite_impl(n = c(2, 3, 4), directed = TRUE, mode = "in") Output $graph - -- -------------------------------------------------------------------- - i directed - i 9 vertices * 26 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 4 -> 1 5 -> 1 6 -> 1 7 -> 1 8 -> 1 9 -> 1 3 -> 2 4 -> 2 - [10] 5 -> 2 6 -> 2 7 -> 2 8 -> 2 9 -> 2 6 -> 3 7 -> 3 8 -> 3 9 -> 3 - [19] 6 -> 4 7 -> 4 8 -> 4 9 -> 4 6 -> 5 7 -> 5 8 -> 5 9 -> 5 + IGRAPH D--- 9 26 -- + + edges: + [1] 3->1 4->1 5->1 6->1 7->1 8->1 9->1 3->2 4->2 5->2 6->2 7->2 8->2 9->2 6->3 + [16] 7->3 8->3 9->3 6->4 7->4 8->4 9->4 6->5 7->5 8->5 9->5 $types [1] 1 1 2 2 2 3 3 3 3 @@ -792,15 +669,11 @@ Code realize_degree_sequence_impl(out_deg = c(2, 2, 2)) Output - -- Graph from degree sequence ----------------------------------------- - i undirected - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , out_deg , in_deg , allowed_edge_types , method - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 3 1 -- 3 1 -- 2 + IGRAPH U--- 3 3 -- Graph from degree sequence + + attr: name (g/c), out_deg (g/n), in_deg (g/x), allowed_edge_types + | (g/n), method (g/n) + + edges: + [1] 2--3 1--3 1--2 --- @@ -808,15 +681,11 @@ realize_degree_sequence_impl(out_deg = c(2, 2, 2), in_deg = c(2, 2, 2), allowed_edge_types = "simple", method = "largest") Output - -- Graph from degree sequence ----------------------------------------- - i directed - i 3 vertices * 6 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , out_deg , in_deg , allowed_edge_types , method - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 3 3 -> 1 3 -> 2 + IGRAPH D--- 3 6 -- Graph from degree sequence + + attr: name (g/c), out_deg (g/n), in_deg (g/n), allowed_edge_types + | (g/n), method (g/n) + + edges: + [1] 1->2 1->3 2->1 2->3 3->1 3->2 # realize_degree_sequence_impl errors @@ -832,15 +701,11 @@ Code realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2)) Output - -- Bipartite graph from degree sequence ------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , degrees1 , degrees2 , allowed_edge_types , method - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 3 2 -- 4 1 -- 4 1 -- 3 + IGRAPH U--- 4 4 -- Bipartite graph from degree sequence + + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed_edge_types + | (g/n), method (g/n) + + edges: + [1] 2--3 2--4 1--4 1--3 --- @@ -848,15 +713,11 @@ realize_bipartite_degree_sequence_impl(degrees1 = c(2, 2), degrees2 = c(2, 2), allowed_edge_types = "loops", method = "largest") Output - -- Bipartite graph from degree sequence ------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , degrees1 , degrees2 , allowed_edge_types , method - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 4 2 -- 3 2 -- 4 + IGRAPH U--- 4 4 -- Bipartite graph from degree sequence + + attr: name (g/c), degrees1 (g/n), degrees2 (g/n), allowed_edge_types + | (g/n), method (g/n) + + edges: + [1] 1--3 1--4 2--3 2--4 # realize_bipartite_degree_sequence_impl errors @@ -872,32 +733,20 @@ Code circulant_impl(n = 5, shifts = c(1, 2)) Output - -- Circulant graph ---------------------------------------------------- - i undirected - i 5 vertices * 10 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , shifts - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 1 -- 3 2 -- 4 3 -- 5 1 -- 4 - [10] 2 -- 5 + IGRAPH U--- 5 10 -- Circulant graph + + attr: name (g/c), shifts (g/n) + + edges: + [1] 1--2 2--3 3--4 4--5 1--5 1--3 2--4 3--5 1--4 2--5 --- Code circulant_impl(n = 5, shifts = c(1, 2), directed = TRUE) Output - -- Circulant graph ---------------------------------------------------- - i directed - i 5 vertices * 10 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , shifts - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 4 4 -> 5 5 -> 1 1 -> 3 2 -> 4 3 -> 5 4 -> 1 - [10] 5 -> 2 + IGRAPH D--- 5 10 -- Circulant graph + + attr: name (g/c), shifts (g/n) + + edges: + [1] 1->2 2->3 3->4 4->5 5->1 1->3 2->4 3->5 4->1 5->2 # circulant_impl errors @@ -913,13 +762,10 @@ Code generalized_petersen_impl(n = 5, k = 2) Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 15 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 6 6 -- 8 2 -- 3 2 -- 7 7 -- 9 3 -- 4 3 -- 8 - [9] 8 -- 10 4 -- 5 4 -- 9 6 -- 9 1 -- 5 5 -- 10 7 -- 10 + IGRAPH U--- 10 15 -- + + edges: + [1] 1-- 2 1-- 6 6-- 8 2-- 3 2-- 7 7-- 9 3-- 4 3-- 8 8--10 4-- 5 4-- 9 6-- 9 + [13] 1-- 5 5--10 7--10 # generalized_petersen_impl errors @@ -936,12 +782,9 @@ turan_impl(n = 5, r = 2) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 4 1 -- 5 2 -- 4 2 -- 5 3 -- 4 3 -- 5 + IGRAPH U--- 5 6 -- + + edges: + [1] 1--4 1--5 2--4 2--5 3--4 3--5 $types [1] 1 1 1 2 2 @@ -970,25 +813,18 @@ Code erdos_renyi_game_gnp_impl(n = 5, p = 0.5) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 + IGRAPH U--- 5 7 -- + + edges: + [1] 1--2 1--3 2--3 1--4 2--4 1--5 4--5 --- Code erdos_renyi_game_gnp_impl(n = 5, p = 0.5, directed = TRUE, loops = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 12 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 1 4 -> 1 2 -> 2 1 -> 3 2 -> 3 4 -> 3 1 -> 4 2 -> 4 - [10] 5 -> 4 3 -> 5 4 -> 5 + IGRAPH D--- 5 12 -- + + edges: + [1] 2->1 3->1 4->1 2->2 1->3 2->3 4->3 1->4 2->4 5->4 3->5 4->5 # erdos_renyi_game_gnp_impl errors @@ -1004,24 +840,18 @@ Code erdos_renyi_game_gnm_impl(n = 5, m = 3) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -- 4 2 -- 5 4 -- 5 + IGRAPH U--- 5 3 -- + + edges: + [1] 3--4 2--5 4--5 --- Code erdos_renyi_game_gnm_impl(n = 5, m = 3, directed = TRUE, loops = TRUE) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 4 -> 3 5 -> 3 3 -> 5 + IGRAPH D--- 5 3 -- + + edges: + [1] 4->3 5->3 3->5 # erdos_renyi_game_gnm_impl errors @@ -1037,45 +867,30 @@ Code growing_random_game_impl(n = 5, m = 2) Output - -- Growing random graph ----------------------------------------------- - i directed - i 5 vertices * 8 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , m , citation - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 2 1 -> 2 3 -> 3 3 -> 3 3 -> 3 1 -> 2 2 -> 2 5 -> 4 + IGRAPH D--- 5 8 -- Growing random graph + + attr: name (g/c), m (g/n), citation (g/l) + + edges: + [1] 2->2 1->2 3->3 3->3 3->3 1->2 2->2 5->4 --- Code growing_random_game_impl(n = 5, m = 2, directed = FALSE, citation = TRUE) Output - -- Growing random graph ----------------------------------------------- - i undirected - i 5 vertices * 8 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , m , citation - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 2 -- 3 1 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 + IGRAPH U--- 5 8 -- Growing random graph + + attr: name (g/c), m (g/n), citation (g/l) + + edges: + [1] 1--2 1--2 2--3 1--3 1--4 2--4 1--5 4--5 --- Code growing_random_game_impl(n = 10, m = 1, directed = TRUE, citation = FALSE) Output - -- Growing random graph ----------------------------------------------- - i directed - i 10 vertices * 9 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , m , citation - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 2 2 -> 3 4 -> 4 4 -> 4 3 -> 2 1 -> 3 1 -> 8 5 -> 6 5 -> 4 + IGRAPH D--- 10 9 -- Growing random graph + + attr: name (g/c), m (g/n), citation (g/l) + + edges: + [1] 2->2 2->3 4->4 4->4 3->2 1->3 1->8 5->6 5->4 # growing_random_game_impl errors @@ -1093,12 +908,9 @@ fixed_sizes = FALSE, pref_matrix = matrix(c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 3 -- 4 1 -- 4 1 -- 5 + IGRAPH U--- 5 4 -- + + edges: + [1] 1--3 3--4 1--4 1--5 $node_type_vec [1] 1 0 0 1 1 @@ -1122,12 +934,9 @@ c(0.5, 0.5, 0.5, 0.5), 2, 2)) Output $graph - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 9 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 4 4 -> 2 5 -> 2 1 -> 3 4 -> 3 4 -> 5 3 -> 1 1 -> 4 1 -> 5 + IGRAPH D--- 5 9 -- + + edges: + [1] 2->4 4->2 5->2 1->3 4->3 4->5 3->1 1->4 1->5 $node_type_out_vec [1] 1 0 1 1 1 @@ -1152,12 +961,9 @@ Code rewire_edges_impl(graph = g, prob = 0.5) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 4 3 -- 4 1 -- 3 2 -- 5 + IGRAPH U--- 5 4 -- + + edges: + [1] 2--4 3--4 1--3 2--5 # rewire_edges_impl errors @@ -1172,12 +978,9 @@ Code rewire_directed_edges_impl(graph = g, prob = 0.5) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 4 2 -> 3 3 -> 2 4 -> 5 + IGRAPH D--- 5 4 -- + + edges: + [1] 1->4 2->3 3->2 4->5 # rewire_directed_edges_impl errors @@ -1192,15 +995,10 @@ Code forest_fire_game_impl(nodes = 5, fw_prob = 0.5) Output - -- Forest fire model -------------------------------------------------- - i directed - i 5 vertices * 9 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , fw_prob , bw_factor , ambs - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 2 4 -> 2 4 -> 1 4 -> 3 5 -> 1 5 -> 2 5 -> 4 5 -> 3 + IGRAPH D--- 5 9 -- Forest fire model + + attr: name (g/c), fw_prob (g/n), bw_factor (g/n), ambs (g/n) + + edges: + [1] 2->1 3->2 4->2 4->1 4->3 5->1 5->2 5->4 5->3 --- @@ -1208,15 +1006,10 @@ forest_fire_game_impl(nodes = 5, fw_prob = 0.5, bw_factor = 0.2, ambs = 2, directed = FALSE) Output - -- Forest fire model -------------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , fw_prob , bw_factor , ambs - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 4 -- 5 + IGRAPH U--- 5 4 -- Forest fire model + + attr: name (g/c), fw_prob (g/n), bw_factor (g/n), ambs (g/n) + + edges: + [1] 1--2 1--3 1--4 4--5 # forest_fire_game_impl errors @@ -1233,15 +1026,11 @@ simple_interconnected_islands_game_impl(islands_n = 2, islands_size = 3, islands_pin = 0.5, n_inter = 1) Output - -- Interconnected islands model --------------------------------------- - i undirected - i 6 vertices * 5 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , islands_n , islands_size , islands_pin , n_inter - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 3 -- 6 5 -- 6 + IGRAPH U--- 6 5 -- Interconnected islands model + + attr: name (g/c), islands_n (g/n), islands_size (g/n), islands_pin + | (g/n), n_inter (g/n) + + edges: + [1] 1--2 1--3 2--3 3--6 5--6 # simple_interconnected_islands_game_impl errors @@ -1258,15 +1047,10 @@ Code chung_lu_game_impl(out_weights = c(2, 2, 2)) Output - -- Chung-Lu model ----------------------------------------------------- - i undirected - i 3 vertices * 5 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , variant - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 2 2 -- 3 3 -- 3 + IGRAPH U--- 3 5 -- Chung-Lu model + + attr: name (g/c), variant (g/n) + + edges: + [1] 1--2 1--3 2--2 2--3 3--3 --- @@ -1274,15 +1058,10 @@ chung_lu_game_impl(out_weights = c(1, 2, 3), in_weights = c(1, 2, 3), loops = FALSE, variant = "maxent") Output - -- Chung-Lu model ----------------------------------------------------- - i directed - i 3 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , variant - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 + IGRAPH D--- 3 1 -- Chung-Lu model + + attr: name (g/c), variant (g/n) + + edge: + [1] 3->1 # chung_lu_game_impl errors @@ -1298,15 +1077,10 @@ Code static_fitness_game_impl(no_of_edges = 3, fitness_out = c(1, 2, 3)) Output - -- Static fitness model ----------------------------------------------- - i undirected - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , loops , multiple - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 + IGRAPH U--- 3 3 -- Static fitness model + + attr: name (g/c), loops (g/l), multiple (g/l) + + edges: + [1] 1--2 1--3 2--3 --- @@ -1314,15 +1088,10 @@ static_fitness_game_impl(no_of_edges = 3, fitness_out = c(1, 2, 3), fitness_in = c( 1, 2, 3), loops = TRUE, multiple = TRUE) Output - -- Static fitness model ----------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , loops , multiple - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 1 -> 3 + IGRAPH D--- 3 3 -- Static fitness model + + attr: name (g/c), loops (g/l), multiple (g/l) + + edges: + [1] 1->2 2->3 1->3 # static_fitness_game_impl errors @@ -1338,15 +1107,11 @@ Code static_power_law_game_impl(no_of_nodes = 5, no_of_edges = 4, exponent_out = 2.5) Output - -- Static power law model --------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , exponent_out , exponent_in , loops , multiple , finite_size_correction - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 5 2 -- 4 3 -- 5 4 -- 5 + IGRAPH U--- 5 4 -- Static power law model + + attr: name (g/c), exponent_out (g/n), exponent_in (g/n), loops (g/l), + | multiple (g/l), finite_size_correction (g/l) + + edges: + [1] 1--5 2--4 3--5 4--5 --- @@ -1354,15 +1119,11 @@ static_power_law_game_impl(no_of_nodes = 5, no_of_edges = 4, exponent_out = 2.5, exponent_in = 2, loops = TRUE, multiple = TRUE, finite_size_correction = FALSE) Output - -- Static power law model --------------------------------------------- - i directed - i 5 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , exponent_out , exponent_in , loops , multiple , finite_size_correction - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 1 3 -> 5 1 -> 4 5 -> 1 + IGRAPH D--- 5 4 -- Static power law model + + attr: name (g/c), exponent_out (g/n), exponent_in (g/n), loops (g/l), + | multiple (g/l), finite_size_correction (g/l) + + edges: + [1] 1->1 3->5 1->4 5->1 # static_power_law_game_impl errors @@ -1378,31 +1139,20 @@ Code k_regular_game_impl(no_of_nodes = 5, k = 2) Output - -- k-regular graph ---------------------------------------------------- - i undirected - i 5 vertices * 5 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , k - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 5 2 -- 3 2 -- 4 4 -- 5 + IGRAPH U--- 5 5 -- k-regular graph + + attr: name (g/c), k (g/n) + + edges: + [1] 1--3 1--5 2--3 2--4 4--5 --- Code k_regular_game_impl(no_of_nodes = 5, k = 2, directed = TRUE, multiple = TRUE) Output - -- k-regular graph ---------------------------------------------------- - i directed - i 5 vertices * 10 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , k - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 4 3 -> 3 2 -> 1 5 -> 5 1 -> 5 4 -> 3 5 -> 2 4 -> 1 1 -> 2 - [10] 2 -> 4 + IGRAPH D--- 5 10 -- k-regular graph + + attr: name (g/c), k (g/n) + + edges: + [1] 3->4 3->3 2->1 5->5 1->5 4->3 5->2 4->1 1->2 2->4 # k_regular_game_impl errors @@ -1418,15 +1168,10 @@ Code sbm_game_impl(n = 5, pref_matrix = matrix(0.5, 2, 2), block_sizes = c(2, 3)) Output - -- Stochastic block model --------------------------------------------- - i undirected - i 5 vertices * 6 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , loops - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 1 -- 5 3 -- 5 + IGRAPH U--- 5 6 -- Stochastic block model + + attr: name (g/c), loops (g/l) + + edges: + [1] 1--2 1--3 2--3 1--4 1--5 3--5 --- @@ -1434,16 +1179,10 @@ sbm_game_impl(n = 5, pref_matrix = matrix(0.5, 2, 2), block_sizes = c(2, 3), directed = TRUE, loops = TRUE) Output - -- Stochastic block model --------------------------------------------- - i directed - i 5 vertices * 14 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , loops - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 1 2 -> 1 2 -> 4 1 -> 5 4 -> 1 5 -> 1 5 -> 2 3 -> 3 5 -> 3 - [10] 3 -> 4 4 -> 4 5 -> 4 3 -> 5 5 -> 5 + IGRAPH D--- 5 14 -- Stochastic block model + + attr: name (g/c), loops (g/l) + + edges: + [1] 1->1 2->1 2->4 1->5 4->1 5->1 5->2 3->3 5->3 3->4 4->4 5->4 3->5 5->5 # sbm_game_impl errors @@ -1459,15 +1198,10 @@ Code hsbm_game_impl(n = 6, m = 2, rho = c(0.5, 0.5), C = matrix(1, 2, 2), p = 0.5) Output - -- Hierarchical stochastic block model -------------------------------- - i undirected - i 6 vertices * 9 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , m , rho , C , p - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 3 -- 4 5 -- 6 1 -- 4 1 -- 5 2 -- 5 1 -- 6 4 -- 5 3 -- 6 + IGRAPH U--- 6 9 -- Hierarchical stochastic block model + + attr: name (g/c), m (g/n), rho (g/n), C (g/n), p (g/n) + + edges: + [1] 1--2 3--4 5--6 1--4 1--5 2--5 1--6 4--5 3--6 # hsbm_game_impl errors @@ -1484,24 +1218,17 @@ hsbm_list_game_impl(n = 100, mlist = list(50, 50), rholist = list(c(3, 3, 4) / 10), Clist = list(C), p = 1 / 20) Output - -- Hierarchical stochastic block model -------------------------------- - i undirected - i 100 vertices * 783 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , p - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 3 -- 4 - [7] 1 -- 5 2 -- 5 3 -- 5 4 -- 5 1 -- 6 2 -- 6 - [13] 3 -- 6 4 -- 6 5 -- 6 1 -- 7 2 -- 7 3 -- 7 - [19] 4 -- 7 5 -- 7 6 -- 7 1 -- 8 2 -- 8 3 -- 8 - [25] 4 -- 8 5 -- 8 6 -- 8 7 -- 8 1 -- 9 2 -- 9 - [31] 3 -- 9 4 -- 9 5 -- 9 6 -- 9 7 -- 9 8 -- 9 - [37] 1 -- 10 2 -- 10 3 -- 10 4 -- 10 5 -- 10 6 -- 10 - [43] 7 -- 10 8 -- 10 9 -- 10 1 -- 11 2 -- 11 3 -- 11 - [49] 4 -- 11 5 -- 11 6 -- 11 7 -- 11 8 -- 11 9 -- 11 - [55] 10 -- 11 1 -- 12 2 -- 12 3 -- 12 4 -- 12 5 -- 12 + IGRAPH U--- 100 783 -- Hierarchical stochastic block model + + attr: name (g/c), p (g/n) + + edges: + [1] 1-- 2 1-- 3 2-- 3 1-- 4 2-- 4 3-- 4 1-- 5 2-- 5 3-- 5 4-- 5 + [11] 1-- 6 2-- 6 3-- 6 4-- 6 5-- 6 1-- 7 2-- 7 3-- 7 4-- 7 5-- 7 + [21] 6-- 7 1-- 8 2-- 8 3-- 8 4-- 8 5-- 8 6-- 8 7-- 8 1-- 9 2-- 9 + [31] 3-- 9 4-- 9 5-- 9 6-- 9 7-- 9 8-- 9 1--10 2--10 3--10 4--10 + [41] 5--10 6--10 7--10 8--10 9--10 1--11 2--11 3--11 4--11 5--11 + [51] 6--11 7--11 8--11 9--11 10--11 1--12 2--12 3--12 4--12 5--12 + [61] 6--12 7--12 8--12 9--12 10--12 11--12 1--13 2--13 3--13 4--13 + [71] 5--13 6--13 7--13 8--13 9--13 10--13 11--13 12--13 1--14 2--14 + ... omitted several edges # hsbm_list_game_impl errors @@ -1519,15 +1246,10 @@ Code correlated_game_impl(old_graph = g, corr = 0.5) Output - -- Correlated random graph -------------------------------------------- - i undirected - i 5 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , corr , p - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 3 -- 4 2 -- 5 + IGRAPH U--- 5 3 -- Correlated random graph + + attr: name (g/c), corr (g/n), p (g/n) + + edges: + [1] 1--3 3--4 2--5 # correlated_game_impl errors @@ -1543,20 +1265,14 @@ correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5) Output $graph1 - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 4 -- 5 + IGRAPH U--- 5 7 -- + + edges: + [1] 1--2 1--3 2--3 1--4 2--4 1--5 4--5 $graph2 - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 1 -- 5 3 -- 5 + IGRAPH U--- 5 7 -- + + edges: + [1] 1--2 1--3 2--3 1--4 2--4 1--5 3--5 --- @@ -1565,21 +1281,14 @@ correlated_pair_game_impl(n = 5, corr = 0.5, p = 0.5, directed = TRUE) Output $graph1 - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 4 -> 1 5 -> 1 2 -> 5 4 -> 2 5 -> 2 3 -> 5 1 -> 4 2 -> 4 4 -> 5 - [10] 5 -> 4 + IGRAPH D--- 5 10 -- + + edges: + [1] 4->1 5->1 2->5 4->2 5->2 3->5 1->4 2->4 4->5 5->4 $graph2 - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 9 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 5 2 -> 1 2 -> 5 4 -> 2 4 -> 3 1 -> 4 2 -> 4 4 -> 5 5 -> 4 + IGRAPH D--- 5 9 -- + + edges: + [1] 1->5 2->1 2->5 4->2 4->3 1->4 2->4 4->5 5->4 # correlated_pair_game_impl errors @@ -1600,12 +1309,9 @@ Greater than 1 connection probability in dot-product graph. Source: games/dotproduct.c:90 Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 2 1 -- + + edge: + [1] 1--2 --- @@ -1616,12 +1322,9 @@ Greater than 1 connection probability in dot-product graph. Source: games/dotproduct.c:90 Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 1 + IGRAPH D--- 2 2 -- + + edges: + [1] 1->2 2->1 # dot_product_game_impl errors @@ -1820,12 +1523,12 @@ get_shortest_path_impl(graph = g, from = 1, to = 3) Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 # get_shortest_path_impl errors @@ -1842,12 +1545,12 @@ get_shortest_path_bellman_ford_impl(graph = g, from = 1, to = 3) Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 # get_shortest_path_bellman_ford_impl errors @@ -1864,12 +1567,12 @@ get_shortest_path_dijkstra_impl(graph = g, from = 1, to = 3) Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 # get_shortest_path_dijkstra_impl errors @@ -1887,14 +1590,14 @@ Output $vpaths $vpaths[[1]] - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $epaths $epaths[[1]] - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 $nrgeo @@ -1916,14 +1619,14 @@ Output $vpaths $vpaths[[1]] - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $epaths $epaths[[1]] - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 $nrgeo @@ -1987,7 +1690,7 @@ Code get_all_simple_paths_impl(graph = g, from = 1, to = 3) Output - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 # get_all_simple_paths_impl errors @@ -2005,14 +1708,14 @@ Output $vpaths $vpaths[[1]] - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $epaths $epaths[[1]] - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 @@ -2030,12 +1733,12 @@ get_widest_path_impl(graph = g, from = 1, to = 3, weights = c(1, 2)) Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 # get_widest_path_impl errors @@ -2053,14 +1756,14 @@ Output $vertices $vertices[[1]] - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges $edges[[1]] - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 $parents @@ -2083,16 +1786,16 @@ Code spanner_impl(graph = g, stretch = 2) Output - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 --- Code spanner_impl(graph = g, stretch = 2) Output - -- 5/5 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 + + 5/5 edges: + [1] 1--2 2--3 3--4 4--5 1--5 # spanner_impl errors @@ -2391,12 +2094,9 @@ Code induced_subgraph_impl(graph = g, vids = 1:2) Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 2 1 -- + + edge: + [1] 1--2 # induced_subgraph_impl errors @@ -2411,12 +2111,9 @@ Code subgraph_from_edges_impl(graph = g, eids = 1) Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 2 1 -- + + edge: + [1] 1--2 # subgraph_from_edges_impl errors @@ -2431,12 +2128,9 @@ Code reverse_edges_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 # reverse_edges_impl errors @@ -2483,24 +2177,18 @@ Code simplify_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 --- Code simplify_impl(graph = g, remove_multiple = FALSE, remove_loops = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 # simplify_impl errors @@ -2721,14 +2409,14 @@ Code feedback_arc_set_impl(graph = g) Output - -- 0/2 --------------------------------------------------------- + + 0/2 edges: --- Code feedback_arc_set_impl(graph = g, algo = "exact_ip") Output - -- 0/2 --------------------------------------------------------- + + 0/2 edges: # feedback_arc_set_impl errors @@ -2743,7 +2431,7 @@ Code feedback_vertex_set_impl(graph = g) Output - -- 0/3 ------------------------------------------------------- + + 0/3 vertices: # feedback_vertex_set_impl errors @@ -3227,12 +2915,9 @@ unfold_tree_impl(graph = g, roots = 1) Output $tree - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $vertex_index [1] 1 2 3 @@ -3244,12 +2929,9 @@ unfold_tree_impl(graph = g, mode = "in", roots = 1) Output $tree - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $vertex_index [1] 1 2 3 @@ -3316,7 +2998,7 @@ [1] 3 2 1 $alpham1 - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 3 2 1 @@ -3981,12 +3663,9 @@ Code contract_vertices_impl(graph = g, mapping = c(1, 1, 2)) Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 1 1 -- 2 + IGRAPH U--- 2 2 -- + + edges: + [1] 1--1 1--2 # contract_vertices_impl errors @@ -4023,7 +3702,7 @@ Code graph_center_dijkstra_impl(graph = g) Output - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 --- @@ -4031,7 +3710,7 @@ Code graph_center_dijkstra_impl(graph = g, mode = "in") Output - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 # graph_center_dijkstra_impl errors @@ -4162,12 +3841,12 @@ random_walk_impl(graph = g, start = 1, steps = 2) Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 --- @@ -4176,12 +3855,12 @@ random_walk_impl(graph = g, start = 1, steps = 2, mode = "in", stuck = "error") Output $vertices - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 1 $edges - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 1 -- 2 + + 2/2 edges: + [1] 1--2 1--2 # random_walk_impl errors @@ -4263,12 +3942,9 @@ Code transitive_closure_dag_impl(graph = g) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 3 1 -> 2 2 -> 3 + IGRAPH D--- 3 3 -- + + edges: + [1] 1->3 1->2 2->3 # transitive_closure_dag_impl errors @@ -4283,12 +3959,9 @@ Code transitive_closure_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 + IGRAPH U--- 3 3 -- + + edges: + [1] 1--2 1--3 2--3 # transitive_closure_impl errors @@ -4345,7 +4018,7 @@ bfs_simple_impl(graph = g, root = 1) Output $order - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $layers @@ -4361,7 +4034,7 @@ bfs_simple_impl(graph = g, root = 1, mode = "in") Output $order - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 $layers @@ -4411,12 +4084,9 @@ biadjacency_impl(incidence = m) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 4 1 -- 5 2 -- 5 + IGRAPH U--- 5 4 -- + + edges: + [1] 1--3 1--4 1--5 2--5 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -4428,12 +4098,9 @@ biadjacency_impl(incidence = m, directed = TRUE, mode = "in", multiple = TRUE) Output $graph - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 4 -> 1 5 -> 1 5 -> 2 + IGRAPH D--- 5 4 -- + + edges: + [1] 3->1 4->1 5->1 5->2 $types [1] FALSE FALSE TRUE TRUE TRUE @@ -4499,12 +4166,9 @@ bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 2 -- 3 1 -- 4 2 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--3 2--3 1--4 2--4 $types [1] FALSE FALSE TRUE TRUE @@ -4516,12 +4180,9 @@ bipartite_game_gnp_impl(n1 = 2, n2 = 2, p = 0.5, directed = TRUE, mode = "in") Output $graph - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 2 + IGRAPH D--- 4 1 -- + + edge: + [1] 3->2 $types [1] FALSE FALSE TRUE TRUE @@ -4542,12 +4203,9 @@ bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 4 + IGRAPH U--- 4 1 -- + + edge: + [1] 2--4 $types [1] FALSE FALSE TRUE TRUE @@ -4559,12 +4217,9 @@ bipartite_game_gnm_impl(n1 = 2, n2 = 2, m = 1, directed = TRUE, mode = "in") Output $graph - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 + IGRAPH D--- 4 1 -- + + edge: + [1] 3->1 $types [1] FALSE FALSE TRUE TRUE @@ -4720,7 +4375,7 @@ Code articulation_points_impl(graph = g) Output - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 # articulation_points_impl errors @@ -4741,36 +4396,36 @@ $tree_edges $tree_edges[[1]] - -- 1/2 --------------------------------------------------------- - [1] 2 -- 3 + + 1/2 edge: + [1] 2--3 $tree_edges[[2]] - -- 1/2 --------------------------------------------------------- - [1] 1 -- 2 + + 1/2 edge: + [1] 1--2 $component_edges $component_edges[[1]] - -- 1/2 --------------------------------------------------------- - [1] 2 -- 3 + + 1/2 edge: + [1] 2--3 $component_edges[[2]] - -- 1/2 --------------------------------------------------------- - [1] 1 -- 2 + + 1/2 edge: + [1] 1--2 $components $components[[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 3 2 $components[[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 1 $articulation_points - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 @@ -4787,8 +4442,8 @@ Code bridges_impl(graph = g) Output - -- 2/2 --------------------------------------------------------- - [1] 2 -- 3 1 -- 2 + + 2/2 edges: + [1] 2--3 1--2 # bridges_impl errors @@ -4923,23 +4578,23 @@ cliques_impl(graph = g) Output [[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 [[2]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 3 [[3]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 [[4]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 [[5]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -4949,11 +4604,11 @@ cliques_impl(graph = g, min = 2, max = 2) Output [[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 [[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -4993,11 +4648,11 @@ largest_cliques_impl(graph = g) Output [[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 [[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 @@ -5052,23 +4707,23 @@ weighted_cliques_impl(graph = g) Output [[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 [[2]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 3 [[3]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 [[4]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 [[5]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -5079,7 +4734,7 @@ max_weight = 3, maximal = TRUE) Output [[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -5097,11 +4752,11 @@ largest_weighted_cliques_impl(graph = g) Output [[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 [[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 @@ -5111,7 +4766,7 @@ largest_weighted_cliques_impl(graph = g, vertex_weights = c(1, 2, 3)) Output [[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 @@ -5295,7 +4950,7 @@ Code roots_for_tree_layout_impl(graph = g, mode = "out", heuristic = 1) Output - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 # roots_for_tree_layout_impl errors @@ -5366,12 +5021,9 @@ [3,] 1.0 1 $extd_graph - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $extd_to_orig_eids [1] 1 2 @@ -5390,12 +5042,9 @@ [3,] 0 4 $extd_graph - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $extd_to_orig_eids [1] 1 2 @@ -6069,11 +5718,11 @@ Output $cliques $cliques[[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 $cliques[[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -6088,11 +5737,11 @@ Output $cliques $cliques[[1]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 $cliques[[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -6142,17 +5791,12 @@ Code hrg_sample_impl(hrg = hrg_model) Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 45 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 - [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 - [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 - [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 - [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 - [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 + IGRAPH U--- 10 45 -- + + edges: + [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 + [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 + [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 + [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 # hrg_sample_impl errors @@ -6169,30 +5813,20 @@ hrg_sample_many_impl(hrg = hrg_model, num_samples = 2) Output [[1]] - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 45 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 - [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 - [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 - [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 - [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 - [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 + IGRAPH U--- 10 45 -- + + edges: + [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 + [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 + [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 + [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 [[2]] - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 45 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 - [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 - [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 - [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 - [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 - [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 + IGRAPH U--- 10 45 -- + + edges: + [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 + [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 + [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 + [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 # hrg_sample_many_impl errors @@ -6209,20 +5843,13 @@ Code hrg_game_impl(hrg = hrg_model) Output - -- Hierarchical random graph model ------------------------------------ - i undirected - i 10 vertices * 45 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 1 -- 9 - [9] 1 -- 10 2 -- 3 2 -- 4 2 -- 5 2 -- 6 2 -- 7 2 -- 8 2 -- 9 - [17] 2 -- 10 3 -- 4 3 -- 5 3 -- 6 3 -- 7 3 -- 8 3 -- 9 3 -- 10 - [25] 4 -- 5 4 -- 6 4 -- 7 4 -- 8 4 -- 9 4 -- 10 5 -- 6 5 -- 7 - [33] 5 -- 8 5 -- 9 5 -- 10 6 -- 7 6 -- 8 6 -- 9 6 -- 10 7 -- 8 - [41] 7 -- 9 7 -- 10 8 -- 9 8 -- 10 9 -- 10 + IGRAPH U--- 10 45 -- Hierarchical random graph model + + attr: name (g/c) + + edges: + [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--10 2-- 3 2-- 4 2-- 5 + [13] 2-- 6 2-- 7 2-- 8 2-- 9 2--10 3-- 4 3-- 5 3-- 6 3-- 7 3-- 8 3-- 9 3--10 + [25] 4-- 5 4-- 6 4-- 7 4-- 8 4-- 9 4--10 5-- 6 5-- 7 5-- 8 5-- 9 5--10 6-- 7 + [37] 6-- 8 6-- 9 6--10 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 # hrg_game_impl errors @@ -6319,14 +5946,10 @@ from_hrg_dendrogram_impl(hrg = hrg_model) Output $graph - -- -------------------------------------------------------------------- - i directed - i 19 vertices * 18 edges - - -- Edges ----------------------------------------------------------------------- - [1] 11 -> 1 11 -> 14 12 -> 19 12 -> 5 13 -> 16 13 -> 8 14 -> 12 - [8] 14 -> 18 15 -> 3 15 -> 6 16 -> 15 16 -> 10 17 -> 13 17 -> 4 - [15] 18 -> 7 18 -> 9 19 -> 2 19 -> 17 + IGRAPH D--- 19 18 -- + + edges: + [1] 11-> 1 11->14 12->19 12-> 5 13->16 13-> 8 14->12 14->18 15-> 3 15-> 6 + [11] 16->15 16->10 17->13 17-> 4 18-> 7 18-> 9 19-> 2 19->17 $prob [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 1 1 1 1 1 1 1 1 1 @@ -6482,24 +6105,18 @@ Code to_directed_impl(graph = g) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 2 -> 1 3 -> 2 + IGRAPH D--- 3 4 -- + + edges: + [1] 1->2 2->3 2->1 3->2 --- Code to_directed_impl(graph = g, mode = "acyclic") Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 + IGRAPH D--- 3 2 -- + + edges: + [1] 1->2 2->3 # to_directed_impl errors @@ -6514,24 +6131,18 @@ Code to_undirected_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 --- Code to_undirected_impl(graph = g, mode = "mutual", edge_attr_comb = "sum") Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 # to_undirected_impl errors @@ -6873,7 +6484,7 @@ Code list_triangles_impl(graph = g) Output - -- 0/3 ------------------------------------------------------- + + 0/3 vertices: # list_triangles_impl errors @@ -6888,13 +6499,9 @@ Code join_impl(left = g1, right = g2) Output - -- -------------------------------------------------------------------- - i undirected - i 6 vertices * 13 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 4 -- 5 5 -- 6 1 -- 4 1 -- 5 1 -- 6 2 -- 4 2 -- 5 - [10] 2 -- 6 3 -- 4 3 -- 5 3 -- 6 + IGRAPH U--- 6 13 -- + + edges: + [1] 1--2 2--3 4--5 5--6 1--4 1--5 1--6 2--4 2--5 2--6 3--4 3--5 3--6 # join_impl errors @@ -6910,12 +6517,9 @@ induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "auto") Output $res - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 2 1 -- + + edge: + [1] 1--2 $map [1] 2 3 1 @@ -6930,12 +6534,9 @@ induced_subgraph_map_impl(graph = g, vids = 1:2, impl = "copy_and_delete") Output $res - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 2 1 -- + + edge: + [1] 1--2 $map [1] 2 3 1 @@ -6957,28 +6558,21 @@ Code mycielskian_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 7 vertices * 9 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 7 5 -- 7 6 -- 7 + IGRAPH U--- 7 9 -- + + edges: + [1] 1--2 2--3 1--5 2--4 2--6 3--5 4--7 5--7 6--7 --- Code mycielskian_impl(graph = g, k = 2) Output - -- -------------------------------------------------------------------- - i undirected - i 15 vertices * 34 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 7 - [8] 5 -- 7 6 -- 7 1 -- 9 2 -- 8 2 -- 10 3 -- 9 1 -- 12 - [15] 5 -- 8 2 -- 11 4 -- 9 2 -- 13 6 -- 9 3 -- 12 5 -- 10 - [22] 4 -- 14 7 -- 11 5 -- 14 7 -- 12 6 -- 14 7 -- 13 8 -- 15 - [29] 9 -- 15 10 -- 15 11 -- 15 12 -- 15 13 -- 15 14 -- 15 + IGRAPH U--- 15 34 -- + + edges: + [1] 1-- 2 2-- 3 1-- 5 2-- 4 2-- 6 3-- 5 4-- 7 5-- 7 6-- 7 1-- 9 + [11] 2-- 8 2--10 3-- 9 1--12 5-- 8 2--11 4-- 9 2--13 6-- 9 3--12 + [21] 5--10 4--14 7--11 5--14 7--12 6--14 7--13 8--15 9--15 10--15 + [31] 11--15 12--15 13--15 14--15 # mycielskian_impl errors @@ -6993,25 +6587,18 @@ Code product_impl(g1 = g1, g2 = g2) Output - -- -------------------------------------------------------------------- - i undirected - i 9 vertices * 12 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 4 2 -- 5 3 -- 6 4 -- 7 5 -- 8 6 -- 9 1 -- 2 4 -- 5 7 -- 8 - [10] 2 -- 3 5 -- 6 8 -- 9 + IGRAPH U--- 9 12 -- + + edges: + [1] 1--4 2--5 3--6 4--7 5--8 6--9 1--2 4--5 7--8 2--3 5--6 8--9 --- Code product_impl(g1 = g1, g2 = g2, type = "tensor") Output - -- -------------------------------------------------------------------- - i undirected - i 9 vertices * 8 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 5 2 -- 4 2 -- 6 3 -- 5 4 -- 8 5 -- 7 5 -- 9 6 -- 8 + IGRAPH U--- 9 8 -- + + edges: + [1] 1--5 2--4 2--6 3--5 4--8 5--7 5--9 6--8 # product_impl errors @@ -7026,12 +6613,9 @@ Code rooted_product_impl(g1 = g1, g2 = g2, root = 1) Output - -- -------------------------------------------------------------------- - i undirected - i 9 vertices * 8 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 4 4 -- 7 1 -- 2 4 -- 5 7 -- 8 2 -- 3 5 -- 6 8 -- 9 + IGRAPH U--- 9 8 -- + + edges: + [1] 1--4 4--7 1--2 4--5 7--8 2--3 5--6 8--9 # rooted_product_impl errors @@ -7047,12 +6631,9 @@ gomory_hu_tree_impl(graph = g) Output $tree - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $flows [1] 1 1 @@ -7064,12 +6645,9 @@ gomory_hu_tree_impl(graph = g, capacity = c(1, 2)) Output $tree - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $flows [1] 1 2 @@ -7095,15 +6673,15 @@ [1] 1 1 $cut - -- 1/2 --------------------------------------------------------- - [1] 2 -- 3 + + 1/2 edge: + [1] 2--3 $partition1 - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 $partition2 - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 3 $stats @@ -7136,15 +6714,15 @@ [1] 1 1 $cut - -- 1/2 --------------------------------------------------------- - [1] 1 -- 2 + + 1/2 edge: + [1] 1--2 $partition1 - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 $partition2 - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 $stats @@ -7179,9 +6757,8 @@ residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output $residual - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 0 edges + IGRAPH D--- 3 0 -- + + edges: $residual_capacity numeric(0) @@ -7200,12 +6777,9 @@ Code reverse_residual_graph_impl(graph = g, capacity = c(1, 2), flow = c(1, 2)) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 2 + IGRAPH D--- 3 2 -- + + edges: + [1] 2->1 3->2 # reverse_residual_graph_impl errors @@ -7224,15 +6798,15 @@ [1] 1 $cut - -- 1/2 --------------------------------------------------------- - [1] 2 -- 3 + + 1/2 edge: + [1] 2--3 $partition1 - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 $partition2 - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 3 @@ -7245,15 +6819,15 @@ [1] 1 $cut - -- 1/2 --------------------------------------------------------- - [1] 1 -- 2 + + 1/2 edge: + [1] 1--2 $partition1 - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 $partition2 - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 @@ -7274,15 +6848,12 @@ [1] 0 1 2 $domtree - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 + IGRAPH D--- 3 2 -- + + edges: + [1] 1->2 2->3 $leftout - -- 0/3 ------------------------------------------------------- + + 0/3 vertices: --- @@ -7294,12 +6865,11 @@ [1] 0 -1 -1 $domtree - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 0 edges + IGRAPH D--- 3 0 -- + + edges: $leftout - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 2 3 @@ -7318,21 +6888,21 @@ Output $cuts $cuts[[1]] - -- 1/2 --------------------------------------------------------- - [1] 1 -> 2 + + 1/2 edge: + [1] 1->2 $cuts[[2]] - -- 1/2 --------------------------------------------------------- - [1] 2 -> 3 + + 1/2 edge: + [1] 2->3 $partition1s $partition1s[[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 $partition1s[[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -7355,21 +6925,21 @@ $cuts $cuts[[1]] - -- 1/2 --------------------------------------------------------- - [1] 1 -> 2 + + 1/2 edge: + [1] 1->2 $cuts[[2]] - -- 1/2 --------------------------------------------------------- - [1] 2 -> 3 + + 1/2 edge: + [1] 2->3 $partition1s $partition1s[[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 $partition1s[[2]] - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 @@ -7384,13 +6954,13 @@ $cuts $cuts[[1]] - -- 1/2 --------------------------------------------------------- - [1] 1 -> 2 + + 1/2 edge: + [1] 1->2 $partition1s $partition1s[[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 @@ -7409,12 +6979,9 @@ even_tarjan_reduction_impl(graph = g) Output $graphbar - -- -------------------------------------------------------------------- - i directed - i 6 vertices * 7 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 4 2 -> 5 3 -> 6 5 -> 1 4 -> 2 6 -> 2 5 -> 3 + IGRAPH D--- 6 7 -- + + edges: + [1] 1->4 2->5 3->6 5->1 4->2 6->2 5->3 $capacity [1] 1 1 1 3 3 3 3 @@ -7464,7 +7031,7 @@ all_minimal_st_separators_impl(graph = g) Output [[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 @@ -7482,7 +7049,7 @@ minimum_size_separators_impl(graph = g) Output [[1]] - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 2 @@ -7544,24 +7111,18 @@ Code isoclass_create_impl(size = 3, number = 1) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 + IGRAPH D--- 3 1 -- + + edge: + [1] 2->1 --- Code isoclass_create_impl(size = 3, number = 1, directed = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 + IGRAPH U--- 3 1 -- + + edge: + [1] 1--2 # isoclass_create_impl errors @@ -7844,12 +7405,9 @@ Code permute_vertices_impl(graph = g, permutation = 3:1) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 3 1 -- 2 + IGRAPH U--- 3 2 -- + + edges: + [1] 2--3 1--2 # permute_vertices_impl errors @@ -8040,7 +7598,7 @@ automorphism_group_impl(graph = g) Output [[1]] - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 3 2 1 @@ -8087,12 +7645,9 @@ simplify_and_colorize_impl(graph = g) Output $res - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 $vertex_color [1] 0 0 0 @@ -10153,10 +9708,10 @@ find_cycle_impl(graph = g) Output $vertices - -- 0/3 ------------------------------------------------------- + + 0/3 vertices: $edges - -- 0/2 --------------------------------------------------------- + + 0/2 edges: --- @@ -10165,10 +9720,10 @@ find_cycle_impl(graph = g, mode = "in") Output $vertices - -- 0/3 ------------------------------------------------------- + + 0/3 vertices: $edges - -- 0/2 --------------------------------------------------------- + + 0/2 edges: # find_cycle_impl errors @@ -10238,11 +9793,11 @@ eulerian_path_impl(graph = g) Output $epath - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 $vpath - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 @@ -10269,11 +9824,11 @@ eulerian_cycle_impl(graph = g2) Output $epath - -- 4/4 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 1 -- 4 + + 4/4 edges: + [1] 1--2 2--3 3--4 1--4 $vpath - -- 5/4 ------------------------------------------------------- + + 5/4 vertices: [1] 1 2 3 4 1 @@ -10346,7 +9901,7 @@ [1] TRUE $root - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 @@ -10374,7 +9929,7 @@ [1] TRUE $roots - -- 1/3 ------------------------------------------------------- + + 1/3 vertex: [1] 1 @@ -10391,15 +9946,10 @@ Code from_prufer_impl(prufer = 1:2) Output - -- Tree from Prufer sequence ------------------------------------------ - i undirected - i 4 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , prufer - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 2 2 -- 4 + IGRAPH U--- 4 3 -- Tree from Prufer sequence + + attr: name (g/c), prufer (g/n) + + edges: + [1] 1--3 1--2 2--4 # from_prufer_impl errors @@ -10432,24 +9982,18 @@ Code tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3)) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 4 + IGRAPH D--- 4 3 -- + + edges: + [1] 1->2 2->3 3->4 --- Code tree_from_parent_vector_impl(parents = c(-1, 1, 2, 3), type = "in") Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 2 4 -> 3 + IGRAPH D--- 4 3 -- + + edges: + [1] 2->1 3->2 4->3 # tree_from_parent_vector_impl errors @@ -10482,8 +10026,8 @@ Code random_spanning_tree_impl(graph = g, vid = 1) Output - -- 2/2 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/2 edges: + [1] 1--2 2--3 # random_spanning_tree_impl errors @@ -10498,24 +10042,18 @@ Code tree_game_impl(n = 3) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 3 1 -- 2 + IGRAPH U--- 3 2 -- + + edges: + [1] 2--3 1--2 --- Code tree_game_impl(n = 3, directed = TRUE, method = "lerw") Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -> 1 1 -> 2 + IGRAPH D--- 3 2 -- + + edges: + [1] 3->1 1->2 # tree_game_impl errors @@ -10704,12 +10242,9 @@ Code invalidate_cache_impl(graph = g) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + IGRAPH U--- 3 2 -- + + edges: + [1] 1--2 2--3 # invalidate_cache_impl errors @@ -10724,7 +10259,7 @@ Code vertex_path_from_edge_path_impl(graph = g, start = 1, edge_path = c(1, 2)) Output - -- 3/3 ------------------------------------------------------- + + 3/3 vertices: [1] 1 2 3 --- @@ -10732,7 +10267,7 @@ Code vertex_path_from_edge_path_impl(graph = g, start = 1, edge_path = c(1), mode = "in") Output - -- 2/3 ------------------------------------------------------- + + 2/3 vertices: [1] 1 2 # vertex_path_from_edge_path_impl errors @@ -10807,7 +10342,7 @@ Code edges_impl(graph = g, eids = E(g)) Output - -- 6/4 ------------------------------------------------------- + + 6/4 vertices: [1] 1 2 2 3 3 4 --- @@ -10815,7 +10350,7 @@ Code edges_impl(graph = g, eids = c(1, 3)) Output - -- 4/4 ------------------------------------------------------- + + 4/4 vertices: [1] 1 2 3 4 # edges_impl errors @@ -10876,24 +10411,24 @@ Code incident_impl(graph = g, vid = 2, mode = "out") Output - -- 1/3 --------------------------------------------------------- - [1] 2 -> 3 + + 1/3 edge: + [1] 2->3 --- Code incident_impl(graph = g, vid = 2, mode = "in") Output - -- 1/3 --------------------------------------------------------- - [1] 1 -> 2 + + 1/3 edge: + [1] 1->2 --- Code incident_impl(graph = g, vid = 2, mode = "all") Output - -- 2/3 --------------------------------------------------------- - [1] 1 -> 2 2 -> 3 + + 2/3 edges: + [1] 1->2 2->3 # incident_impl errors @@ -10908,22 +10443,16 @@ Code famous_impl(name = "Zachary") Output - -- -------------------------------------------------------------------- - i undirected - i 34 vertices * 78 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 1 -- 5 1 -- 6 1 -- 7 1 -- 8 - [8] 1 -- 9 1 -- 11 1 -- 12 1 -- 13 1 -- 14 1 -- 18 1 -- 20 - [15] 1 -- 22 1 -- 32 2 -- 3 2 -- 4 2 -- 8 2 -- 14 2 -- 18 - [22] 2 -- 20 2 -- 22 2 -- 31 3 -- 4 3 -- 8 3 -- 28 3 -- 29 - [29] 3 -- 33 3 -- 10 3 -- 9 3 -- 14 4 -- 8 4 -- 13 4 -- 14 - [36] 5 -- 7 5 -- 11 6 -- 7 6 -- 11 6 -- 17 7 -- 17 9 -- 31 - [43] 9 -- 33 9 -- 34 10 -- 34 14 -- 34 15 -- 33 15 -- 34 16 -- 33 - [50] 16 -- 34 19 -- 33 19 -- 34 20 -- 34 21 -- 33 21 -- 34 23 -- 33 - [57] 23 -- 34 24 -- 26 24 -- 28 24 -- 33 24 -- 34 24 -- 30 25 -- 26 - [64] 25 -- 28 25 -- 32 26 -- 32 27 -- 30 27 -- 34 28 -- 34 29 -- 32 - + ... omitted several edges + IGRAPH U--- 34 78 -- + + edges: + [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--11 1--12 + [11] 1--13 1--14 1--18 1--20 1--22 1--32 2-- 3 2-- 4 2-- 8 2--14 + [21] 2--18 2--20 2--22 2--31 3-- 4 3-- 8 3--28 3--29 3--33 3--10 + [31] 3-- 9 3--14 4-- 8 4--13 4--14 5-- 7 5--11 6-- 7 6--11 6--17 + [41] 7--17 9--31 9--33 9--34 10--34 14--34 15--33 15--34 16--33 16--34 + [51] 19--33 19--34 20--34 21--33 21--34 23--33 23--34 24--26 24--28 24--33 + [61] 24--34 24--30 25--26 25--28 25--32 26--32 27--30 27--34 28--34 29--32 + [71] 29--34 30--33 30--34 31--33 31--34 32--33 32--34 33--34 # famous_impl errors @@ -10994,12 +10523,9 @@ union_impl(left = g1, right = g2) Output $res - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 3 3 -> 4 + IGRAPH D--- 4 4 -- + + edges: + [1] 1->2 1->3 2->3 3->4 $edge_map_left [1] 1 3 @@ -11022,12 +10548,9 @@ intersection_impl(left = g1, right = g2) Output $res - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 + IGRAPH D--- 3 2 -- + + edges: + [1] 1->2 2->3 $edge_map_left [1] 1 2 @@ -11049,137 +10572,101 @@ Code star_impl(n = 5, mode = "out", center = 0) Output - -- -------------------------------------------------------------------- - i directed - i 5 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 1 -> 4 1 -> 5 + IGRAPH D--- 5 4 -- + + edges: + [1] 1->2 1->3 1->4 1->5 --- Code star_impl(n = 6, mode = "in", center = 1) Output - -- -------------------------------------------------------------------- - i directed - i 6 vertices * 5 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 3 -> 2 4 -> 2 5 -> 2 6 -> 2 + IGRAPH D--- 6 5 -- + + edges: + [1] 1->2 3->2 4->2 5->2 6->2 --- Code star_impl(n = 4, mode = "undirected", center = 0) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 + IGRAPH U--- 4 3 -- + + edges: + [1] 1--2 1--3 1--4 # ring_impl basic Code ring_impl(n = 5, directed = FALSE, mutual = FALSE, circular = TRUE) Output - -- -------------------------------------------------------------------- - i undirected - i 5 vertices * 5 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 + IGRAPH U--- 5 5 -- + + edges: + [1] 1--2 2--3 3--4 4--5 1--5 --- Code ring_impl(n = 4, directed = TRUE, mutual = FALSE, circular = FALSE) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 4 + IGRAPH D--- 4 3 -- + + edges: + [1] 1->2 2->3 3->4 # full_impl basic Code full_impl(n = 4, directed = FALSE, loops = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 3 2 -- 4 3 -- 4 + IGRAPH U--- 4 6 -- + + edges: + [1] 1--2 1--3 1--4 2--3 2--4 3--4 --- Code full_impl(n = 3, directed = TRUE, loops = FALSE) Output - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 1 2 -> 3 3 -> 1 3 -> 2 + IGRAPH D--- 3 6 -- + + edges: + [1] 1->2 1->3 2->1 2->3 3->1 3->2 # kary_tree_impl basic Code kary_tree_impl(n = 7, children = 2, type = c("out", "in", "undirected")) Output - -- -------------------------------------------------------------------- - i directed - i 7 vertices * 6 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 1 -> 3 2 -> 4 2 -> 5 3 -> 6 3 -> 7 + IGRAPH D--- 7 6 -- + + edges: + [1] 1->2 1->3 2->4 2->5 3->6 3->7 --- Code kary_tree_impl(n = 10, children = 3, type = c("in", "out", "undirected")) Output - -- -------------------------------------------------------------------- - i directed - i 10 vertices * 9 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 3 -> 1 4 -> 1 5 -> 2 6 -> 2 7 -> 2 8 -> 3 9 -> 3 - [9] 10 -> 3 + IGRAPH D--- 10 9 -- + + edges: + [1] 2->1 3->1 4->1 5->2 6->2 7->2 8->3 9->3 10->3 # barabasi_game_impl basic Code barabasi_game_impl(n = 10, power = 1, m = 2, directed = FALSE, algo = "bag") Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 18 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 2 -- 3 1 -- 3 2 -- 4 2 -- 4 2 -- 5 2 -- 5 - [9] 4 -- 6 2 -- 6 2 -- 7 1 -- 7 3 -- 8 2 -- 8 8 -- 9 5 -- 9 - [17] 6 -- 10 5 -- 10 + IGRAPH U--- 10 18 -- + + edges: + [1] 1-- 2 1-- 2 2-- 3 1-- 3 2-- 4 2-- 4 2-- 5 2-- 5 4-- 6 2-- 6 2-- 7 1-- 7 + [13] 3-- 8 2-- 8 8-- 9 5-- 9 6--10 5--10 --- Code barabasi_game_impl(n = 10, power = 1, m = 2, directed = FALSE, algo = "psumtree") Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 17 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 2 -- 3 1 -- 4 2 -- 4 2 -- 5 4 -- 5 1 -- 6 - [9] 3 -- 6 6 -- 7 3 -- 7 6 -- 8 2 -- 8 3 -- 9 5 -- 9 2 -- 10 - [17] 6 -- 10 + IGRAPH U--- 10 17 -- + + edges: + [1] 1-- 2 1-- 3 2-- 3 1-- 4 2-- 4 2-- 5 4-- 5 1-- 6 3-- 6 6-- 7 3-- 7 6-- 8 + [13] 2-- 8 3-- 9 5-- 9 2--10 6--10 # grg_game_impl basic @@ -11187,13 +10674,9 @@ grg_game_impl(nodes = 10, radius = 0.3, torus = FALSE) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 12 edges - - -- Edges ----------------------------------------------------------------------- - [1] 3 -- 5 3 -- 6 5 -- 6 5 -- 7 5 -- 8 6 -- 8 7 -- 8 7 -- 9 - [9] 7 -- 10 8 -- 9 8 -- 10 9 -- 10 + IGRAPH U--- 10 12 -- + + edges: + [1] 3-- 5 3-- 6 5-- 6 5-- 7 5-- 8 6-- 8 7-- 8 7-- 9 7--10 8-- 9 8--10 9--10 $x [1] 0.08565451 0.15145413 0.45222514 0.45939554 0.55956278 0.61872370 @@ -11209,14 +10692,10 @@ Code watts_strogatz_game_impl(dim = 1, size = 10, nei = 2, p = 0.1) Output - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 20 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 6 2 -- 3 4 -- 5 5 -- 6 6 -- 7 7 -- 8 8 -- 9 - [9] 9 -- 10 1 -- 10 1 -- 8 1 -- 9 2 -- 10 2 -- 4 3 -- 5 4 -- 6 - [17] 5 -- 7 6 -- 8 7 -- 9 8 -- 10 + IGRAPH U--- 10 20 -- + + edges: + [1] 1-- 2 2-- 6 2-- 3 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10 1-- 8 1-- 9 + [13] 2--10 2-- 4 3-- 5 4-- 6 5-- 7 6-- 8 7-- 9 8--10 # distances_impl basic @@ -11260,14 +10739,14 @@ Output $vertices $vertices[[1]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 1 2 3 $edges $edges[[1]] - -- 2/5 --------------------------------------------------------- - [1] 1 -- 2 2 -- 3 + + 2/5 edges: + [1] 1--2 2--3 $parents @@ -11282,7 +10761,7 @@ Code subcomponent_impl(graph = g, v = 1, mode = c("all", "out", "in")) Output - -- 3/6 * named ----------------------------------------------- + + 3/6 vertices, named: [1] A B C # betweenness_impl basic @@ -11618,12 +11097,9 @@ create_bipartite_impl(types = c(FALSE, FALSE, TRUE, TRUE), edges = c(0, 2, 0, 3, 1, 2, 1, 3), directed = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 3 1 -- 4 2 -- 3 2 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--3 1--4 2--3 2--4 # bipartite_game_impl basic @@ -11631,13 +11107,9 @@ bipartite_game_impl(type = "gnp", n1 = 5, n2 = 5, p = 0.3, directed = FALSE) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 6 2 -- 6 4 -- 6 5 -- 6 1 -- 7 4 -- 7 4 -- 8 3 -- 9 - [9] 3 -- 10 4 -- 10 + IGRAPH U--- 10 10 -- + + edges: + [1] 1-- 6 2-- 6 4-- 6 5-- 6 1-- 7 4-- 7 4-- 8 3-- 9 3--10 4--10 $types [1] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE @@ -11649,13 +11121,9 @@ bipartite_game_impl(type = "gnm", n1 = 5, n2 = 5, m = 10, directed = FALSE) Output $graph - -- -------------------------------------------------------------------- - i undirected - i 10 vertices * 10 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 6 3 -- 7 5 -- 7 1 -- 8 3 -- 8 4 -- 8 2 -- 9 5 -- 9 - [9] 2 -- 10 3 -- 10 + IGRAPH U--- 10 10 -- + + edges: + [1] 1-- 6 3-- 7 5-- 7 1-- 8 3-- 8 4-- 8 2-- 9 5-- 9 2--10 3--10 $types [1] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE @@ -11667,26 +11135,16 @@ decompose_impl(graph = g, mode = c("weak", "strong")) Output [[1]] - -- -------------------------------------------------------------------- - i undirected * named - i 3 vertices * 2 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- B B -- C + IGRAPH UN-- 3 2 -- + + attr: name (v/c) + + edges (vertex names): + [1] A--B B--C [[2]] - -- -------------------------------------------------------------------- - i undirected * named - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] D -- E + IGRAPH UN-- 2 1 -- + + attr: name (v/c) + + edge (vertex names): + [1] D--E # neighborhood_impl basic @@ -11696,23 +11154,23 @@ "in")) Output [[1]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 1 2 5 [[2]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 2 1 3 [[3]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 3 2 4 [[4]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 4 3 5 [[5]] - -- 3/5 ------------------------------------------------------- + + 3/5 vertices: [1] 5 1 4 @@ -11736,15 +11194,10 @@ numeric(0) $newgraph - -- Full graph --------------------------------------------------------- - i undirected - i 4 vertices * 6 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , loops - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 3 1 -- 4 2 -- 3 2 -- 4 3 -- 4 + IGRAPH U--- 4 6 -- Full graph + + attr: name (g/c), loops (g/l) + + edges: + [1] 1--2 1--3 1--4 2--3 2--4 3--4 --- @@ -11759,15 +11212,10 @@ [1] 1 3 $newgraph - -- Ring graph --------------------------------------------------------- - i undirected - i 4 vertices * 5 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 1 -- 4 2 -- 4 + IGRAPH U--- 4 5 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1--2 2--3 3--4 1--4 2--4 # get_adjacency_impl basic @@ -11792,36 +11240,27 @@ Code read_graph_edgelist_impl(instream = tmp, n = 3, directed = FALSE) Output - -- -------------------------------------------------------------------- - i undirected - i 3 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 1 -- 3 + IGRAPH U--- 3 3 -- + + edges: + [1] 1--2 2--3 1--3 # degree_sequence_game_impl basic Code degree_sequence_game_impl(out_deg = c(2, 2, 2, 2), method = "configuration") Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -- 4 3 -- 3 1 -- 4 1 -- 2 + IGRAPH U--- 4 4 -- + + edges: + [1] 2--4 3--3 1--4 1--2 --- Code degree_sequence_game_impl(out_deg = c(2, 2, 2, 2), method = "vl") Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 4 2 -- 3 3 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--2 1--4 2--3 3--4 # connect_neighborhood_impl basic @@ -11832,15 +11271,10 @@ Order smaller than two, graph will be unchanged. Source: : Output - -- Ring graph --------------------------------------------------------- - i undirected - i 5 vertices * 5 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 1 -- 5 + IGRAPH U--- 5 5 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1--2 2--3 3--4 4--5 1--5 # eccentricity_impl basic @@ -11861,7 +11295,7 @@ Code graph_center_impl(graph = g, mode = c("out", "in", "all")) Output - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 1 # maximal_cliques_impl basic @@ -11870,7 +11304,7 @@ maximal_cliques_impl(graph = g, min_size = 1, max_size = 0) Output [[1]] - -- 4/4 ------------------------------------------------------- + + 4/4 vertices: [1] 1 2 4 3 @@ -11880,43 +11314,43 @@ independent_vertex_sets_impl(graph = g, min_size = 1, max_size = 0) Output [[1]] - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 1 [[2]] - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 2 [[3]] - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 3 [[4]] - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 4 [[5]] - -- 1/5 ------------------------------------------------------- + + 1/5 vertex: [1] 5 [[6]] - -- 2/5 ------------------------------------------------------- + + 2/5 vertices: [1] 1 3 [[7]] - -- 2/5 ------------------------------------------------------- + + 2/5 vertices: [1] 1 4 [[8]] - -- 2/5 ------------------------------------------------------- + + 2/5 vertices: [1] 2 4 [[9]] - -- 2/5 ------------------------------------------------------- + + 2/5 vertices: [1] 2 5 [[10]] - -- 2/5 ------------------------------------------------------- + + 2/5 vertices: [1] 3 5 @@ -11930,7 +11364,7 @@ print(result) Output $order - -- 10/10 ----------------------------------------------------- + + 10/10 vertices: [1] 1 2 10 3 9 4 8 5 7 6 $rank @@ -11997,11 +11431,11 @@ print(result) Output $order - -- 10/10 ----------------------------------------------------- + + 10/10 vertices: [1] 1 2 3 4 5 6 7 8 9 10 $order_out - -- 10/10 ----------------------------------------------------- + + 10/10 vertices: [1] 10 9 8 7 6 5 4 3 2 1 $father @@ -12253,24 +11687,18 @@ Code sparse_adjacency_impl(adjmatrix = M) Output - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 + IGRAPH D--- 4 4 -- + + edges: + [1] 4->1 1->2 2->3 3->4 --- Code sparse_adjacency_impl(adjmatrix = M_sym, mode = "undirected", loops = "once") Output - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 1 -- 4 3 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--2 2--3 1--4 3--4 # sparse_weighted_adjacency_impl basic @@ -12278,12 +11706,9 @@ sparse_weighted_adjacency_impl(adjmatrix = M) Output $graph - -- -------------------------------------------------------------------- - i directed - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 + IGRAPH D--- 4 4 -- + + edges: + [1] 4->1 1->2 2->3 3->4 $weights [1] 0.5 2.5 1.0 3.0 @@ -12295,12 +11720,9 @@ sparse_weighted_adjacency_impl(adjmatrix = M_sym, mode = "undirected", loops = "once") Output $graph - -- -------------------------------------------------------------------- - i undirected - i 4 vertices * 4 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 2 -- 3 1 -- 4 3 -- 4 + IGRAPH U--- 4 4 -- + + edges: + [1] 1--2 2--3 1--4 3--4 $weights [1] 2.5 1.0 0.5 3.0 @@ -12311,24 +11733,18 @@ Code weighted_sparsemat_impl(A = M, directed = TRUE, attr = "weight", loops = FALSE) Output - -- -------------------------------------------------------------------- - i directed * weighted - i 4 vertices * 4 edges - - -- Attributes ------------------------------------------------------------------ - -> edge: weight - - -- Edges ----------------------------------------------------------------------- - [1] 4 -> 1 1 -> 2 2 -> 3 3 -> 4 + IGRAPH D-W- 4 4 -- + + attr: weight (e/n) + + edges: + [1] 4->1 1->2 2->3 3->4 # disjoint_union_many_impl basic Code disjoint_union_many_impl(graphs = list(g1, g2, g3)) Output - -- -------------------------------------------------------------------- - i directed - i 6 vertices * 0 edges + IGRAPH D--- 6 0 -- + + edges: # union_many_impl basic @@ -12336,12 +11752,9 @@ union_many_impl(graphs = list(g1, g2, g3)) Output $res - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 3 1 -> 3 1 -> 2 + IGRAPH D--- 3 3 -- + + edges: + [1] 2->3 1->3 1->2 $edgemaps $edgemaps[[1]] @@ -12361,12 +11774,9 @@ intersection_many_impl(graphs = list(g1, g2, g3)) Output $res - -- -------------------------------------------------------------------- - i directed - i 3 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 + IGRAPH D--- 3 1 -- + + edge: + [1] 1->2 $edgemaps $edgemaps[[1]] @@ -12398,8 +11808,8 @@ Code get_eid_impl(graph = g, from = 1, to = 2) Output - -- 1/4 --------------------------------------------------------- - [1] 1 -> 2 + + 1/4 edge: + [1] 1->2 # get_eid_impl errors @@ -12434,7 +11844,7 @@ [1] 3 3 3 3 0 3 2 2 1 1 $generators - -- 4/10 ------------------------------------------------------ + + 4/10 vertices: [1] 2 9 7 1 $modularity diff --git a/tests/testthat/_snaps/adjacency.md b/tests/testthat/_snaps/adjacency.md index 0dffe02bc8c..1af5c9cbcee 100644 --- a/tests/testthat/_snaps/adjacency.md +++ b/tests/testthat/_snaps/adjacency.md @@ -14,12 +14,9 @@ Code graph_from_adjacency_matrix(m) Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 2 -> 1 + IGRAPH D--- 2 2 -- + + edges: + [1] 2->1 2->1 Code graph_from_adjacency_matrix(m, mode = "undirected") Condition @@ -27,45 +24,29 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 + IGRAPH U--- 2 2 -- + + edges: + [1] 1--2 1--2 Code graph_from_adjacency_matrix(m, mode = "max") Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 + IGRAPH U--- 2 2 -- + + edges: + [1] 1--2 1--2 Code graph_from_adjacency_matrix(m, weighted = TRUE) Output - -- -------------------------------------------------------------------- - i directed * weighted - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> edge: weight - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 + IGRAPH D-W- 2 1 -- + + attr: weight (e/n) + + edge: + [1] 2->1 Code graph_from_adjacency_matrix(m, weighted = "w") Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> edge: w - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 + IGRAPH D--- 2 1 -- + + attr: w (e/n) + + edge: + [1] 2->1 Code m2 <- structure(c(0, 0.00211360121966095, 0.00211360121966098, 0), dim = c(2L, 2L)) @@ -75,33 +56,26 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 0 edges + IGRAPH U--- 2 0 -- + + edges: Code graph_from_adjacency_matrix(1) Condition Warning: The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0. Output - -- -------------------------------------------------------------------- - i directed - i 1 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 1 + IGRAPH D--- 1 1 -- + + edge: + [1] 1->1 Code graph_from_adjacency_matrix(1, mode = "undirected") Condition Warning: The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0. Output - -- -------------------------------------------------------------------- - i undirected - i 1 vertices * 1 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 1 + IGRAPH U--- 1 1 -- + + edge: + [1] 1--1 # graph_from_adjacency_matrix() snapshot for sparse matrices @@ -120,12 +94,9 @@ Code graph_from_adjacency_matrix(m) Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 2 -> 1 + IGRAPH D--- 2 2 -- + + edges: + [1] 2->1 2->1 Code graph_from_adjacency_matrix(m, mode = "undirected") Condition @@ -133,45 +104,29 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 + IGRAPH U--- 2 2 -- + + edges: + [1] 1--2 1--2 Code graph_from_adjacency_matrix(m, mode = "max") Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 2 edges - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 2 + IGRAPH U--- 2 2 -- + + edges: + [1] 1--2 1--2 Code graph_from_adjacency_matrix(m, weighted = TRUE) Output - -- -------------------------------------------------------------------- - i directed * weighted - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> edge: weight - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 + IGRAPH D-W- 2 1 -- + + attr: weight (e/n) + + edge: + [1] 2->1 Code graph_from_adjacency_matrix(m, weighted = "w") Output - -- -------------------------------------------------------------------- - i directed - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> edge: w - - -- Edges ----------------------------------------------------------------------- - [1] 2 -> 1 + IGRAPH D--- 2 1 -- + + attr: w (e/n) + + edge: + [1] 2->1 Code m2 <- Matrix::sparseMatrix(2:1, 1:2, x = c(0.00211360121966095, 0.00211360121966098)) @@ -181,9 +136,8 @@ The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0. i Use mode = "max" to achieve the original behavior. Output - -- -------------------------------------------------------------------- - i undirected - i 2 vertices * 0 edges + IGRAPH U--- 2 0 -- + + edges: # graph_from_adjacency_matrix errors for NAs diff --git a/tests/testthat/_snaps/flow.md b/tests/testthat/_snaps/flow.md index c59a984beb6..e7fa818e87b 100644 --- a/tests/testthat/_snaps/flow.md +++ b/tests/testthat/_snaps/flow.md @@ -102,15 +102,15 @@ min_st_separators(g_note) Output [[1]] - -- 1/5 * named * from something + + 1/5 vertex, named: [1] 1 [[2]] - -- 2/5 * named * from something + + 2/5 vertices, named: [1] 2 4 [[3]] - -- 2/5 * named * from something + + 2/5 vertices, named: [1] 1 3 diff --git a/tests/testthat/_snaps/foreign.md b/tests/testthat/_snaps/foreign.md index 9efdd756d43..5ff13f89152 100644 --- a/tests/testthat/_snaps/foreign.md +++ b/tests/testthat/_snaps/foreign.md @@ -3,30 +3,20 @@ Code read_graph(ncol_path, "ncol") Output - -- -------------------------------------------------------------------- - i undirected * named - i 3 vertices * 2 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] 0 -- 1 1 -- 2 + IGRAPH UN-- 3 2 -- + + attr: name (v/c) + + edges (vertex names): + [1] 0--1 1--2 # reading graph in LGL format Code read_graph(lgl_path, "lgl") Output - -- -------------------------------------------------------------------- - i undirected * named - i 3 vertices * 2 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] 0 -- 1 1 -- 2 + IGRAPH UN-- 3 2 -- + + attr: name (v/c) + + edges (vertex names): + [1] 0--1 1--2 # reading graph, unused argument diff --git a/tests/testthat/_snaps/incidence.md b/tests/testthat/_snaps/incidence.md index e0e1030b4e1..dbb1ba9a91e 100644 --- a/tests/testthat/_snaps/incidence.md +++ b/tests/testthat/_snaps/incidence.md @@ -3,94 +3,60 @@ Code (g <- graph_from_biadjacency_matrix(inc)) Output - -- -------------------------------------------------------------------- - i undirected * named * bipartite - i 8 vertices * 7 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- c A -- d B -- b B -- c B -- e C -- b C -- d + IGRAPH UN-B 8 7 -- + + attr: type (v/l), name (v/c) + + edges (vertex names): + [1] A--c A--d B--b B--c B--e C--b C--d --- Code (weighted_g <- graph_from_biadjacency_matrix(inc, weighted = TRUE)) Output - -- -------------------------------------------------------------------- - i undirected * named * weighted * bipartite - i 8 vertices * 7 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - -> edge: weight - - -- Edges (vertex names) -------------------------------------------------------- - [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e + IGRAPH UNWB 8 7 -- + + attr: type (v/l), name (v/c), weight (e/n) + + edges (vertex names): + [1] B--b C--b A--c B--c A--d C--d B--e # graph_from_biadjacency_matrix() works -- dense + multiple Code (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE)) Output - -- -------------------------------------------------------------------- - i undirected * named * bipartite - i 8 vertices * 10 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- c A -- d A -- d A -- e B -- b B -- e C -- b C -- c C -- c - [10] C -- e + IGRAPH UN-B 8 10 -- + + attr: type (v/l), name (v/c) + + edges (vertex names): + [1] A--c A--d A--d A--e B--b B--e C--b C--c C--c C--e # graph_from_biadjacency_matrix() works -- sparse Code (g <- graph_from_biadjacency_matrix(inc)) Output - -- -------------------------------------------------------------------- - i undirected * named * bipartite - i 8 vertices * 7 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - - -- Edges (vertex names) -------------------------------------------------------- - [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e + IGRAPH UN-B 8 7 -- + + attr: type (v/l), name (v/c) + + edges (vertex names): + [1] B--b C--b A--c B--c A--d C--d B--e --- Code (weighted_g <- graph_from_biadjacency_matrix(inc, weighted = TRUE)) Output - -- -------------------------------------------------------------------- - i undirected * named * weighted * bipartite - i 8 vertices * 7 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - -> edge: weight - - -- Edges (vertex names) -------------------------------------------------------- - [1] B -- b C -- b A -- c B -- c A -- d C -- d B -- e + IGRAPH UNWB 8 7 -- + + attr: type (v/l), name (v/c), weight (e/n) + + edges (vertex names): + [1] B--b C--b A--c B--c A--d C--d B--e # graph_from_biadjacency_matrix() works -- sparse + multiple Code (g <- graph_from_biadjacency_matrix(inc, multiple = TRUE)) Output - -- -------------------------------------------------------------------- - i undirected * named * bipartite - i 8 vertices * 10 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: type , name - - -- Edges (vertex names) -------------------------------------------------------- - [1] B -- b C -- b A -- c C -- c C -- c A -- d A -- d A -- e B -- e - [10] C -- e + IGRAPH UN-B 8 10 -- + + attr: type (v/l), name (v/c) + + edges (vertex names): + [1] B--b C--b A--c C--c C--c A--d A--d A--e B--e C--e # graph_from_biadjacency_matrix() errors well diff --git a/tests/testthat/_snaps/iterators.md b/tests/testthat/_snaps/iterators.md index 8a36fd9788f..d01392169aa 100644 --- a/tests/testthat/_snaps/iterators.md +++ b/tests/testthat/_snaps/iterators.md @@ -3,82 +3,80 @@ Code vs Output - -- 10/10 ----------------------------------------------------- + + 10/10 vertices: [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - -- 10/10 ------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 5 -- 6 6 -- 7 7 -- 8 8 -- 9 - [9] 9 -- 10 1 -- 10 + + 10/10 edges: + [1] 1-- 2 2-- 3 3-- 4 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10 Code vs[1:5] Output - -- 5/10 ------------------------------------------------------ + + 5/10 vertices: [1] 1 2 3 4 5 Code es[1:5] Output - -- 5/10 -------------------------------------------------------- - [1] 1 -- 2 2 -- 3 3 -- 4 4 -- 5 5 -- 6 + + 5/10 edges: + [1] 1--2 2--3 3--4 4--5 5--6 Code vs[numeric()] Output - -- 0/10 ------------------------------------------------------ + + 0/10 vertices: --- Code es[numeric()] Output - -- 0/10 -------------------------------------------------------- + + 0/10 edges: # printing named connected vs/es works Code vs Output - -- 10/10 * named --------------------------------------------- + + 10/10 vertices, named: [1] a b c d e f g h i j Code es Output - -- 10/10 * vertex names ---------------------------------------- - [1] a -- b b -- c c -- d d -- e e -- f f -- g g -- h h -- i i -- j - [10] a -- j + + 10/10 edges (vertex names): + [1] a--b b--c c--d d--e e--f f--g g--h h--i i--j a--j Code vs[1:5] Output - -- 5/10 * named ---------------------------------------------- + + 5/10 vertices, named: [1] a b c d e Code es[1:5] Output - -- 5/10 * vertex names ----------------------------------------- - [1] a -- b b -- c c -- d d -- e e -- f + + 5/10 edges (vertex names): + [1] a--b b--c c--d d--e e--f Code vs[numeric()] Output - -- 0/10 * named ---------------------------------------------- + + 0/10 vertices, named: --- Code es[numeric()] Output - -- 0/10 * vertex names ----------------------------------------- + + 0/10 edges (vertex names): # printing unconnected vs/es works Code vs Output - -- 10/? * deleted -------------------------------------------- + + 10/? vertices (deleted): [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - -- 10/? * deleted ---------------------------------------------- + + 10/? edges (deleted): [1] 1 2 3 4 5 6 7 8 9 10 --- @@ -86,12 +84,12 @@ Code vs Output - -- 10/? * deleted -------------------------------------------- + + 10/? vertices (deleted): [1] 1 2 3 4 5 6 7 8 9 10 Code es Output - -- 10/? * vertex names * deleted ------------------------------- + + 10/? edges (deleted) (vertex names): [1] a|b b|c c|d d|e e|f f|g g|h h|i i|j a|j # logical indices are not recycled diff --git a/tests/testthat/_snaps/make.md b/tests/testthat/_snaps/make.md index 054643ae674..8fc69bf8504 100644 --- a/tests/testthat/_snaps/make.md +++ b/tests/testthat/_snaps/make.md @@ -46,175 +46,108 @@ Code graph_from_literal(A - B) Output - -- -------------------------------------------------------------------- - i undirected * named - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- B + IGRAPH UN-- 2 1 -- + + attr: name (v/c) + + edge (vertex names): + [1] A--B Code graph_from_literal(A - B - C) Output - -- -------------------------------------------------------------------- - i undirected * named - i 3 vertices * 2 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- B B -- C + IGRAPH UN-- 3 2 -- + + attr: name (v/c) + + edges (vertex names): + [1] A--B B--C Code graph_from_literal(A - B - C - A) Output - -- -------------------------------------------------------------------- - i undirected * named - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- B A -- C B -- C + IGRAPH UN-- 3 3 -- + + attr: name (v/c) + + edges (vertex names): + [1] A--B A--C B--C # graph_from_literal() and undirected explosion Code graph_from_literal(A:B:C - D:E, B:D - C:E) Output - -- -------------------------------------------------------------------- - i undirected * named - i 5 vertices * 8 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- D A -- E B -- C B -- D B -- E C -- D C -- E D -- E + IGRAPH UN-- 5 8 -- + + attr: name (v/c) + + edges (vertex names): + [1] A--D A--E B--C B--D B--E C--D C--E D--E Code graph_from_literal(A:B:C - D:E - F:G:H - I - J:K:L:M) Output - -- -------------------------------------------------------------------- - i undirected * named - i 13 vertices * 19 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -- D A -- E B -- D B -- E C -- D C -- E D -- F D -- G D -- H - [10] E -- F E -- G E -- H F -- I G -- I H -- I I -- J I -- K I -- L - [19] I -- M + IGRAPH UN-- 13 19 -- + + attr: name (v/c) + + edges (vertex names): + [1] A--D A--E B--D B--E C--D C--E D--F D--G D--H E--F E--G E--H F--I G--I H--I + [16] I--J I--K I--L I--M # graph_from_literal() and simple directed graphs Code graph_from_literal(A - +B) Output - -- -------------------------------------------------------------------- - i directed * named - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> B + IGRAPH DN-- 2 1 -- + + attr: name (v/c) + + edge (vertex names): + [1] A->B Code graph_from_literal(A - +B - +C) Output - -- -------------------------------------------------------------------- - i directed * named - i 3 vertices * 2 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> B B -> C + IGRAPH DN-- 3 2 -- + + attr: name (v/c) + + edges (vertex names): + [1] A->B B->C Code graph_from_literal(A - +B - +C - +A) Output - -- -------------------------------------------------------------------- - i directed * named - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> B B -> C C -> A + IGRAPH DN-- 3 3 -- + + attr: name (v/c) + + edges (vertex names): + [1] A->B B->C C->A Code graph_from_literal(A - +B + -C - +A) Output - -- -------------------------------------------------------------------- - i directed * named - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> B C -> A C -> B + IGRAPH DN-- 3 3 -- + + attr: name (v/c) + + edges (vertex names): + [1] A->B C->A C->B # graph_from_literal() and directed explosion Code graph_from_literal(A:B:C - +D:E, B:D + -C:E) Output - -- -------------------------------------------------------------------- - i directed * named - i 5 vertices * 9 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> D A -> E B -> D B -> E C -> B C -> D C -> E E -> B E -> D + IGRAPH DN-- 5 9 -- + + attr: name (v/c) + + edges (vertex names): + [1] A->D A->E B->D B->E C->B C->D C->E E->B E->D Code graph_from_literal(A:B:C - +D:E + -F:G:H - +I + -J:K:L:M) Output - -- -------------------------------------------------------------------- - i directed * named - i 13 vertices * 19 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] A -> D A -> E B -> D B -> E C -> D C -> E F -> D F -> E F -> I - [10] G -> D G -> E G -> I H -> D H -> E H -> I J -> I K -> I L -> I - [19] M -> I + IGRAPH DN-- 13 19 -- + + attr: name (v/c) + + edges (vertex names): + [1] A->D A->E B->D B->E C->D C->E F->D F->E F->I G->D G->E G->I H->D H->E H->I + [16] J->I K->I L->I M->I # graph_from_literal(simplify = FALSE) Code graph_from_literal(1 - 1, 1 - 2, 1 - 2) Output - -- -------------------------------------------------------------------- - i undirected * named - i 2 vertices * 1 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] 1 -- 2 + IGRAPH UN-- 2 1 -- + + attr: name (v/c) + + edge (vertex names): + [1] 1--2 Code graph_from_literal(1 - 1, 1 - 2, 1 - 2, simplify = FALSE) Output - -- -------------------------------------------------------------------- - i undirected * named - i 2 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> vertex: name - - -- Edges (vertex names) -------------------------------------------------------- - [1] 1 -- 1 1 -- 2 1 -- 2 + IGRAPH UN-- 2 3 -- + + attr: name (v/c) + + edges (vertex names): + [1] 1--1 1--2 1--2 # make_empty_graph gives an error for invalid arguments diff --git a/tests/testthat/_snaps/other.md b/tests/testthat/_snaps/other.md index 0b5dc90eb4a..5c2f5616b89 100644 --- a/tests/testthat/_snaps/other.md +++ b/tests/testthat/_snaps/other.md @@ -11,27 +11,17 @@ Code g Output - -- Ring graph --------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 1 + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1->2 2->3 3->1 Code gs Output - -- Ring graph --------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 1 + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l) + + edges: + [1] 1->2 2->3 3->1 # VS/ES require explicit conversion diff --git a/tests/testthat/_snaps/print.md b/tests/testthat/_snaps/print-classic.md similarity index 100% rename from tests/testthat/_snaps/print.md rename to tests/testthat/_snaps/print-classic.md diff --git a/tests/testthat/_snaps/structural-properties.md b/tests/testthat/_snaps/structural-properties.md index a2b0489cf8c..e006e10afcb 100644 --- a/tests/testthat/_snaps/structural-properties.md +++ b/tests/testthat/_snaps/structural-properties.md @@ -21,7 +21,7 @@ [1] "out" $order - -- 2/5 * named ----------------------------------------------- + + 2/5 vertices, named: [1] b c $rank @@ -29,17 +29,17 @@ 0 1 2 0 0 $parent - -- 5/5 * named ----------------------------------------------- + + 5/5 vertices, named: a b c z d b $pred - -- 5/5 * named ----------------------------------------------- + + 5/5 vertices, named: a b c z d b $succ - -- 5/5 * named ----------------------------------------------- + + 5/5 vertices, named: a b c z d c @@ -51,7 +51,7 @@ [1] "out" $father - -- 5/5 * named ----------------------------------------------- + + 5/5 vertices, named: a b c z d b diff --git a/tests/testthat/_snaps/trees.md b/tests/testthat/_snaps/trees.md index 72ad7519390..91a639c3a30 100644 --- a/tests/testthat/_snaps/trees.md +++ b/tests/testthat/_snaps/trees.md @@ -7,14 +7,9 @@ `subgraph.edges()` was deprecated in igraph 2.1.0. i Please use `subgraph_from_edges()` instead. Output - -- -------------------------------------------------------------------- - i undirected - i 13 vertices * 11 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name_1 , name_2 , loops_1 , loops_2 - - -- Edges ----------------------------------------------------------------------- - [1] 1 -- 2 1 -- 8 3 -- 6 3 -- 8 4 -- 5 5 -- 7 6 -- 7 - [8] 9 -- 11 9 -- 13 10 -- 13 12 -- 13 + IGRAPH U--- 13 11 -- + + attr: name_1 (g/c), name_2 (g/c), loops_1 (g/l), loops_2 (g/l) + + edges: + [1] 1-- 2 1-- 8 3-- 6 3-- 8 4-- 5 5-- 7 6-- 7 9--11 9--13 10--13 + [11] 12--13 diff --git a/tests/testthat/_snaps/versions.md b/tests/testthat/_snaps/versions.md index 7184cd347a6..27d877e05dd 100644 --- a/tests/testthat/_snaps/versions.md +++ b/tests/testthat/_snaps/versions.md @@ -56,17 +56,10 @@ i Call `igraph::upgrade_graph()` on it to use with the current igraph version. For now we convert it on the fly... Output - -- Ring graph --------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - -> vertex: bar - -> edge: foo - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 1 + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) + + edges: + [1] 1->2 2->3 3->1 Code graph_version(g) Output @@ -117,32 +110,18 @@ i Call `igraph::upgrade_graph()` on it to use with the current igraph version. For now we convert it on the fly... Output - -- Ring graph --------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - -> vertex: bar - -> edge: foo - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 1 + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) + + edges: + [1] 1->2 2->3 3->1 --- Code s[["1.5.0"]] Output - -- Ring graph --------------------------------------------------------- - i directed - i 3 vertices * 3 edges - - -- Attributes ------------------------------------------------------------------ - -> graph: name , mutual , circular - -> vertex: bar - -> edge: foo - - -- Edges ----------------------------------------------------------------------- - [1] 1 -> 2 2 -> 3 3 -> 1 + IGRAPH D--- 3 3 -- Ring graph + + attr: name (g/c), mutual (g/l), circular (g/l), bar (v/c), foo (e/c) + + edges: + [1] 1->2 2->3 3->1 diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R new file mode 100644 index 00000000000..dff9e0adf9e --- /dev/null +++ b/tests/testthat/setup.R @@ -0,0 +1,6 @@ +# Pin print options for the whole test suite so output is deterministic and +# independent of the package defaults. `print.style = "classic"` keeps the +# historical `IGRAPH ... DNW-` output that most snapshots assert against; the +# cli-styled output is exercised explicitly in test-print-cli.R. `print.id` +# is pinned off because the 7-character graph id is non-deterministic. +igraph_options(print.style = "classic", print.id = FALSE) diff --git a/tests/testthat/test-aaa-auto.R b/tests/testthat/test-aaa-auto.R index bcd8fd14fff..11554ed7304 100644 --- a/tests/testthat/test-aaa-auto.R +++ b/tests/testthat/test-aaa-auto.R @@ -13,7 +13,6 @@ skip_on_cran() # 1. empty_impl test_that("empty_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(empty_impl()) expect_snapshot(empty_impl( @@ -40,7 +39,6 @@ test_that("empty_impl basic", { test_that("empty_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(empty_impl( n = -1 )) @@ -50,7 +48,6 @@ test_that("empty_impl errors", { test_that("add_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 3 ) @@ -72,7 +69,6 @@ test_that("add_edges_impl basic", { test_that("add_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(add_edges_impl( graph = NULL, edges = c(1, 2) @@ -83,7 +79,6 @@ test_that("add_edges_impl errors", { test_that("copy_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 2 ) @@ -104,7 +99,6 @@ test_that("copy_impl basic", { test_that("copy_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(copy_impl( from = NULL )) @@ -114,7 +108,6 @@ test_that("copy_impl errors", { test_that("delete_vertices_idx_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 3 ) @@ -137,7 +130,6 @@ test_that("delete_vertices_idx_impl basic", { test_that("delete_vertices_idx_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(delete_vertices_idx_impl( graph = NULL, vertices = 1 @@ -148,7 +140,6 @@ test_that("delete_vertices_idx_impl errors", { test_that("vcount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 4 ) @@ -168,7 +159,6 @@ test_that("vcount_impl basic", { test_that("vcount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(vcount_impl( graph = NULL )) @@ -178,7 +168,6 @@ test_that("vcount_impl errors", { test_that("degree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 3 ) @@ -202,7 +191,6 @@ test_that("degree_impl basic", { test_that("degree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(degree_impl( graph = NULL )) @@ -212,7 +200,6 @@ test_that("degree_impl errors", { test_that("get_all_eids_between_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- empty_impl( n = 2 ) @@ -234,7 +221,6 @@ test_that("get_all_eids_between_impl basic", { test_that("get_all_eids_between_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_all_eids_between_impl( graph = NULL, from = 1, @@ -246,7 +232,6 @@ test_that("get_all_eids_between_impl errors", { test_that("wheel_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(wheel_impl( n = 5 )) @@ -265,7 +250,6 @@ test_that("wheel_impl basic", { test_that("wheel_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(wheel_impl( n = -1 )) @@ -275,7 +259,6 @@ test_that("wheel_impl errors", { test_that("hypercube_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(hypercube_impl( n = 3 )) @@ -293,7 +276,6 @@ test_that("hypercube_impl basic", { test_that("hypercube_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hypercube_impl( n = 10000 )) @@ -303,7 +285,6 @@ test_that("hypercube_impl errors", { test_that("square_lattice_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(square_lattice_impl( dimvector = c(2, 2) )) @@ -324,7 +305,6 @@ test_that("square_lattice_impl basic", { test_that("square_lattice_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(square_lattice_impl( dimvector = -1 )) @@ -334,7 +314,6 @@ test_that("square_lattice_impl errors", { test_that("triangular_lattice_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(triangular_lattice_impl( dimvector = c(2, 2) )) @@ -353,7 +332,6 @@ test_that("triangular_lattice_impl basic", { test_that("triangular_lattice_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(triangular_lattice_impl( dimvector = -1 )) @@ -363,7 +341,6 @@ test_that("triangular_lattice_impl errors", { test_that("path_graph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(path_graph_impl( n = 5 )) @@ -382,7 +359,6 @@ test_that("path_graph_impl basic", { test_that("path_graph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(path_graph_impl( n = -1 )) @@ -392,7 +368,6 @@ test_that("path_graph_impl errors", { test_that("cycle_graph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(cycle_graph_impl( n = 5 )) @@ -411,7 +386,6 @@ test_that("cycle_graph_impl basic", { test_that("cycle_graph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(cycle_graph_impl( n = -1 )) @@ -421,7 +395,6 @@ test_that("cycle_graph_impl errors", { test_that("symmetric_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(symmetric_tree_impl( branches = 3 )) @@ -439,7 +412,6 @@ test_that("symmetric_tree_impl basic", { test_that("symmetric_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(symmetric_tree_impl( branches = -1 )) @@ -449,7 +421,6 @@ test_that("symmetric_tree_impl errors", { test_that("regular_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(regular_tree_impl( h = 2 )) @@ -468,7 +439,6 @@ test_that("regular_tree_impl basic", { test_that("regular_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(regular_tree_impl( h = -1 )) @@ -478,7 +448,6 @@ test_that("regular_tree_impl errors", { test_that("full_citation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(full_citation_impl( n = 5 )) @@ -496,7 +465,6 @@ test_that("full_citation_impl basic", { test_that("full_citation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(full_citation_impl( n = -1 )) @@ -506,7 +474,6 @@ test_that("full_citation_impl errors", { test_that("atlas_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(atlas_impl( number = 0 )) @@ -523,7 +490,6 @@ test_that("atlas_impl basic", { test_that("atlas_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(atlas_impl( number = -1 )) @@ -533,7 +499,6 @@ test_that("atlas_impl errors", { test_that("extended_chordal_ring_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(extended_chordal_ring_impl( nodes = 5, W = matrix(c(1, 2)) @@ -554,7 +519,6 @@ test_that("extended_chordal_ring_impl basic", { test_that("extended_chordal_ring_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(extended_chordal_ring_impl( nodes = -1, W = matrix(c(1, 2)) @@ -565,7 +529,6 @@ test_that("extended_chordal_ring_impl errors", { test_that("graph_power_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -590,7 +553,6 @@ test_that("graph_power_impl basic", { test_that("graph_power_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(graph_power_impl( graph = NULL, order = 2 @@ -601,7 +563,6 @@ test_that("graph_power_impl errors", { test_that("linegraph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -619,7 +580,6 @@ test_that("linegraph_impl basic", { test_that("linegraph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(linegraph_impl( graph = NULL )) @@ -628,7 +588,6 @@ test_that("linegraph_impl errors", { # 21. de_bruijn_impl test_that("de_bruijn_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(de_bruijn_impl( m = 2, n = 3 @@ -643,7 +602,6 @@ test_that("de_bruijn_impl basic", { }) test_that("de_bruijn_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(de_bruijn_impl( m = -1, n = 3 @@ -653,7 +611,6 @@ test_that("de_bruijn_impl errors", { # 22. kautz_impl test_that("kautz_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(kautz_impl( m = 2, n = 3 @@ -668,7 +625,6 @@ test_that("kautz_impl basic", { }) test_that("kautz_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(kautz_impl( m = -1, n = 3 @@ -678,7 +634,6 @@ test_that("kautz_impl errors", { # 23. lcf_vector_impl test_that("lcf_vector_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(lcf_vector_impl( n = 10, shifts = c(3, -3, 4), @@ -695,7 +650,6 @@ test_that("lcf_vector_impl basic", { }) test_that("lcf_vector_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(lcf_vector_impl( n = -1, shifts = c(3, -3, 4), @@ -706,7 +660,6 @@ test_that("lcf_vector_impl errors", { # 24. mycielski_graph_impl test_that("mycielski_graph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(mycielski_graph_impl( k = 3 )) @@ -719,7 +672,6 @@ test_that("mycielski_graph_impl basic", { }) test_that("mycielski_graph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(mycielski_graph_impl( k = -1 )) @@ -729,7 +681,6 @@ test_that("mycielski_graph_impl errors", { test_that("adjlist_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(adjlist_impl( adjlist = list(c(2, 3), c(1), c(1)), mode = "out" @@ -745,7 +696,6 @@ test_that("adjlist_impl basic", { test_that("adjlist_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(adjlist_impl( adjlist = -1, mode = "out" @@ -755,7 +705,6 @@ test_that("adjlist_impl errors", { # 26. full_bipartite_impl test_that("full_bipartite_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(full_bipartite_impl( n1 = 2, n2 = 3 @@ -776,7 +725,6 @@ test_that("full_bipartite_impl basic", { }) test_that("full_bipartite_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(full_bipartite_impl( n1 = -1, n2 = 3 @@ -786,7 +734,6 @@ test_that("full_bipartite_impl errors", { # 27. full_multipartite_impl test_that("full_multipartite_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(full_multipartite_impl( n = c(2, 3, 4) )) @@ -804,7 +751,6 @@ test_that("full_multipartite_impl basic", { }) test_that("full_multipartite_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(full_multipartite_impl( n = -1 )) @@ -813,7 +759,6 @@ test_that("full_multipartite_impl errors", { # 28. realize_degree_sequence_impl test_that("realize_degree_sequence_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(realize_degree_sequence_impl( out_deg = c(2, 2, 2) )) @@ -832,7 +777,6 @@ test_that("realize_degree_sequence_impl basic", { }) test_that("realize_degree_sequence_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(realize_degree_sequence_impl( out_deg = -1 )) @@ -841,7 +785,6 @@ test_that("realize_degree_sequence_impl errors", { # 29. realize_bipartite_degree_sequence_impl test_that("realize_bipartite_degree_sequence_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(realize_bipartite_degree_sequence_impl( degrees1 = c(2, 2), degrees2 = c(2, 2) @@ -862,7 +805,6 @@ test_that("realize_bipartite_degree_sequence_impl basic", { }) test_that("realize_bipartite_degree_sequence_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( realize_bipartite_degree_sequence_impl( degrees1 = -1, @@ -874,7 +816,6 @@ test_that("realize_bipartite_degree_sequence_impl errors", { # 30. circulant_impl test_that("circulant_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(circulant_impl( n = 5, shifts = c(1, 2) @@ -894,7 +835,6 @@ test_that("circulant_impl basic", { }) test_that("circulant_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(circulant_impl( n = -1, shifts = c(1, 2) @@ -904,7 +844,6 @@ test_that("circulant_impl errors", { # 31. generalized_petersen_impl test_that("generalized_petersen_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(generalized_petersen_impl( n = 5, k = 2 @@ -919,7 +858,6 @@ test_that("generalized_petersen_impl basic", { }) test_that("generalized_petersen_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(generalized_petersen_impl( n = -1, k = 2 @@ -929,7 +867,6 @@ test_that("generalized_petersen_impl errors", { # 32. turan_impl test_that("turan_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(turan_impl( n = 5, r = 2 @@ -944,7 +881,6 @@ test_that("turan_impl basic", { }) test_that("turan_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(turan_impl( n = -1, r = 2 @@ -954,7 +890,6 @@ test_that("turan_impl errors", { # 33. erdos_renyi_game_gnp_impl test_that("erdos_renyi_game_gnp_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(erdos_renyi_game_gnp_impl( n = 5, p = 0.5 @@ -975,7 +910,6 @@ test_that("erdos_renyi_game_gnp_impl basic", { }) test_that("erdos_renyi_game_gnp_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(erdos_renyi_game_gnp_impl( n = -1, p = 0.5 @@ -985,7 +919,6 @@ test_that("erdos_renyi_game_gnp_impl errors", { # 34. erdos_renyi_game_gnm_impl test_that("erdos_renyi_game_gnm_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(erdos_renyi_game_gnm_impl( n = 5, m = 3 @@ -1006,7 +939,6 @@ test_that("erdos_renyi_game_gnm_impl basic", { }) test_that("erdos_renyi_game_gnm_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(erdos_renyi_game_gnm_impl( n = -1, m = 3 @@ -1016,7 +948,6 @@ test_that("erdos_renyi_game_gnm_impl errors", { # 35. growing_random_game_impl test_that("growing_random_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(growing_random_game_impl( n = 5, m = 2 @@ -1037,7 +968,6 @@ test_that("growing_random_game_impl basic", { }) test_that("growing_random_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(growing_random_game_impl( n = -1, m = 2 @@ -1047,7 +977,6 @@ test_that("growing_random_game_impl errors", { # 36. preference_game_impl test_that("preference_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(preference_game_impl( nodes = 5, types = 2, @@ -1068,7 +997,6 @@ test_that("preference_game_impl basic", { }) test_that("preference_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( preference_game_impl( nodes = -1, @@ -1083,7 +1011,6 @@ test_that("preference_game_impl errors", { # 37. asymmetric_preference_game_impl test_that("asymmetric_preference_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(asymmetric_preference_game_impl( nodes = 5, out_types = 2, @@ -1104,7 +1031,6 @@ test_that("asymmetric_preference_game_impl basic", { }) test_that("asymmetric_preference_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( asymmetric_preference_game_impl( nodes = -1, @@ -1119,7 +1045,6 @@ test_that("asymmetric_preference_game_impl errors", { # 38. rewire_edges_impl test_that("rewire_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -1138,7 +1063,6 @@ test_that("rewire_edges_impl basic", { }) test_that("rewire_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(rewire_edges_impl( graph = NULL, prob = 0.5 @@ -1148,7 +1072,6 @@ test_that("rewire_edges_impl errors", { # 39. rewire_directed_edges_impl test_that("rewire_directed_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5, directed = TRUE @@ -1168,7 +1091,6 @@ test_that("rewire_directed_edges_impl basic", { }) test_that("rewire_directed_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(rewire_directed_edges_impl( graph = NULL, prob = 0.5 @@ -1178,7 +1100,6 @@ test_that("rewire_directed_edges_impl errors", { # 40. forest_fire_game_impl test_that("forest_fire_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(forest_fire_game_impl( nodes = 5, fw_prob = 0.5 @@ -1200,7 +1121,6 @@ test_that("forest_fire_game_impl basic", { }) test_that("forest_fire_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(forest_fire_game_impl( nodes = -1, fw_prob = 0.5 @@ -1210,7 +1130,6 @@ test_that("forest_fire_game_impl errors", { # 41. simple_interconnected_islands_game_impl test_that("simple_interconnected_islands_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(simple_interconnected_islands_game_impl( islands_n = 2, islands_size = 3, @@ -1229,7 +1148,6 @@ test_that("simple_interconnected_islands_game_impl basic", { }) test_that("simple_interconnected_islands_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( simple_interconnected_islands_game_impl( islands_n = -1, @@ -1243,7 +1161,6 @@ test_that("simple_interconnected_islands_game_impl errors", { # 42. chung_lu_game_impl test_that("chung_lu_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(chung_lu_game_impl( out_weights = c(2, 2, 2) )) @@ -1262,7 +1179,6 @@ test_that("chung_lu_game_impl basic", { }) test_that("chung_lu_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(chung_lu_game_impl( out_weights = -1 )) @@ -1271,7 +1187,6 @@ test_that("chung_lu_game_impl errors", { # 43. static_fitness_game_impl test_that("static_fitness_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(static_fitness_game_impl( no_of_edges = 3, fitness_out = c(1, 2, 3) @@ -1293,7 +1208,6 @@ test_that("static_fitness_game_impl basic", { }) test_that("static_fitness_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(static_fitness_game_impl( no_of_edges = -1, fitness_out = c(1, 2, 3) @@ -1303,7 +1217,6 @@ test_that("static_fitness_game_impl errors", { # 44. static_power_law_game_impl test_that("static_power_law_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(static_power_law_game_impl( no_of_nodes = 5, no_of_edges = 4, @@ -1329,7 +1242,6 @@ test_that("static_power_law_game_impl basic", { }) test_that("static_power_law_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(static_power_law_game_impl( no_of_nodes = -1, no_of_edges = 4, @@ -1341,7 +1253,6 @@ test_that("static_power_law_game_impl errors", { test_that("k_regular_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(k_regular_game_impl( no_of_nodes = 5, k = 2 @@ -1363,7 +1274,6 @@ test_that("k_regular_game_impl basic", { test_that("k_regular_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(k_regular_game_impl( no_of_nodes = -1, k = 2 @@ -1374,7 +1284,6 @@ test_that("k_regular_game_impl errors", { test_that("sbm_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(sbm_game_impl( n = 5, pref_matrix = matrix(0.5, 2, 2), @@ -1399,7 +1308,6 @@ test_that("sbm_game_impl basic", { test_that("sbm_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(sbm_game_impl( n = -1, pref_matrix = matrix(0.5, 2, 2), @@ -1411,7 +1319,6 @@ test_that("sbm_game_impl errors", { test_that("hsbm_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(hsbm_game_impl( n = 6, m = 2, @@ -1433,7 +1340,6 @@ test_that("hsbm_game_impl basic", { test_that("hsbm_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( hsbm_game_impl( n = -1, @@ -1449,7 +1355,6 @@ test_that("hsbm_game_impl errors", { test_that("hsbm_list_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) C <- matrix( c( 1, @@ -1485,7 +1390,6 @@ test_that("hsbm_list_game_impl basic", { test_that("hsbm_list_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( hsbm_list_game_impl( n = -1, @@ -1501,7 +1405,6 @@ test_that("hsbm_list_game_impl errors", { test_that("correlated_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -1521,7 +1424,6 @@ test_that("correlated_game_impl basic", { test_that("correlated_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(correlated_game_impl( old_graph = NULL, corr = 0.5 @@ -1532,7 +1434,6 @@ test_that("correlated_game_impl errors", { test_that("correlated_pair_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(correlated_pair_game_impl( n = 5, corr = 0.5, @@ -1556,7 +1457,6 @@ test_that("correlated_pair_game_impl basic", { test_that("correlated_pair_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(correlated_pair_game_impl( n = -1, corr = 0.5, @@ -1568,7 +1468,6 @@ test_that("correlated_pair_game_impl errors", { test_that("dot_product_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(dot_product_game_impl( vecs = matrix(0.5, 5, 2) )) @@ -1586,7 +1485,6 @@ test_that("dot_product_game_impl basic", { test_that("dot_product_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(dot_product_game_impl( vecs = NULL )) @@ -1596,7 +1494,6 @@ test_that("dot_product_game_impl errors", { test_that("sample_sphere_surface_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(sample_sphere_surface_impl( dim = 3, n = 5 @@ -1618,7 +1515,6 @@ test_that("sample_sphere_surface_impl basic", { test_that("sample_sphere_surface_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(sample_sphere_surface_impl( dim = -1, n = 5 @@ -1629,7 +1525,6 @@ test_that("sample_sphere_surface_impl errors", { test_that("sample_sphere_volume_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(sample_sphere_volume_impl( dim = 3, n = 5 @@ -1651,7 +1546,6 @@ test_that("sample_sphere_volume_impl basic", { test_that("sample_sphere_volume_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(sample_sphere_volume_impl( dim = -1, n = 5 @@ -1662,7 +1556,6 @@ test_that("sample_sphere_volume_impl errors", { test_that("sample_dirichlet_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(sample_dirichlet_impl( n = 5, alpha = c(1, 1, 1) @@ -1678,7 +1571,6 @@ test_that("sample_dirichlet_impl basic", { test_that("sample_dirichlet_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(sample_dirichlet_impl( n = -1, alpha = c(1, 1, 1) @@ -1689,7 +1581,6 @@ test_that("sample_dirichlet_impl errors", { test_that("are_adjacent_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1711,7 +1602,6 @@ test_that("are_adjacent_impl basic", { test_that("are_adjacent_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(are_adjacent_impl( graph = NULL, v1 = 1, @@ -1723,7 +1613,6 @@ test_that("are_adjacent_impl errors", { test_that("closeness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1746,7 +1635,6 @@ test_that("closeness_impl basic", { test_that("closeness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(closeness_impl( graph = NULL )) @@ -1756,7 +1644,6 @@ test_that("closeness_impl errors", { test_that("closeness_cutoff_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1782,7 +1669,6 @@ test_that("closeness_cutoff_impl basic", { test_that("closeness_cutoff_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(closeness_cutoff_impl( graph = NULL )) @@ -1792,7 +1678,6 @@ test_that("closeness_cutoff_impl errors", { test_that("get_shortest_path_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1814,7 +1699,6 @@ test_that("get_shortest_path_impl basic", { test_that("get_shortest_path_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_shortest_path_impl( graph = NULL, from = 1, @@ -1826,7 +1710,6 @@ test_that("get_shortest_path_impl errors", { test_that("get_shortest_path_bellman_ford_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1848,7 +1731,6 @@ test_that("get_shortest_path_bellman_ford_impl basic", { test_that("get_shortest_path_bellman_ford_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_shortest_path_bellman_ford_impl( graph = NULL, from = 1, @@ -1860,7 +1742,6 @@ test_that("get_shortest_path_bellman_ford_impl errors", { test_that("get_shortest_path_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1882,7 +1763,6 @@ test_that("get_shortest_path_dijkstra_impl basic", { test_that("get_shortest_path_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_shortest_path_dijkstra_impl( graph = NULL, from = 1, @@ -1894,7 +1774,6 @@ test_that("get_shortest_path_dijkstra_impl errors", { test_that("get_all_shortest_paths_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1916,7 +1795,6 @@ test_that("get_all_shortest_paths_impl basic", { test_that("get_all_shortest_paths_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_all_shortest_paths_impl( graph = NULL, from = 1, @@ -1928,7 +1806,6 @@ test_that("get_all_shortest_paths_impl errors", { test_that("get_all_shortest_paths_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1950,7 +1827,6 @@ test_that("get_all_shortest_paths_dijkstra_impl basic", { test_that("get_all_shortest_paths_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( get_all_shortest_paths_dijkstra_impl( graph = NULL, @@ -1964,7 +1840,6 @@ test_that("get_all_shortest_paths_dijkstra_impl errors", { test_that("voronoi_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -1990,7 +1865,6 @@ test_that("voronoi_impl basic", { test_that("voronoi_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(voronoi_impl( graph = NULL, generators = 1 @@ -2001,7 +1875,6 @@ test_that("voronoi_impl errors", { test_that("get_all_simple_paths_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2023,7 +1896,6 @@ test_that("get_all_simple_paths_impl basic", { test_that("get_all_simple_paths_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_all_simple_paths_impl( graph = NULL, from = 1, @@ -2035,7 +1907,6 @@ test_that("get_all_simple_paths_impl errors", { test_that("get_k_shortest_paths_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2059,7 +1930,6 @@ test_that("get_k_shortest_paths_impl basic", { test_that("get_k_shortest_paths_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_k_shortest_paths_impl( graph = NULL, from = 1, @@ -2072,7 +1942,6 @@ test_that("get_k_shortest_paths_impl errors", { test_that("get_widest_path_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2096,7 +1965,6 @@ test_that("get_widest_path_impl basic", { test_that("get_widest_path_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_widest_path_impl( graph = NULL, from = 1, @@ -2108,7 +1976,6 @@ test_that("get_widest_path_impl errors", { test_that("get_widest_paths_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2132,7 +1999,6 @@ test_that("get_widest_paths_impl basic", { test_that("get_widest_paths_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_widest_paths_impl( graph = NULL, from = 1, @@ -2144,7 +2010,6 @@ test_that("get_widest_paths_impl errors", { test_that("spanner_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2164,7 +2029,6 @@ test_that("spanner_impl basic", { test_that("spanner_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(spanner_impl( graph = NULL, stretch = 2 @@ -2175,7 +2039,6 @@ test_that("spanner_impl errors", { test_that("betweenness_cutoff_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2195,7 +2058,6 @@ test_that("betweenness_cutoff_impl basic", { test_that("betweenness_cutoff_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(betweenness_cutoff_impl( graph = NULL, cutoff = 2 @@ -2206,7 +2068,6 @@ test_that("betweenness_cutoff_impl errors", { test_that("betweenness_subset_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2224,7 +2085,6 @@ test_that("betweenness_subset_impl basic", { test_that("betweenness_subset_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(betweenness_subset_impl( graph = NULL )) @@ -2234,7 +2094,6 @@ test_that("betweenness_subset_impl errors", { test_that("edge_betweenness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2252,7 +2111,6 @@ test_that("edge_betweenness_impl basic", { test_that("edge_betweenness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(edge_betweenness_impl( graph = NULL )) @@ -2262,7 +2120,6 @@ test_that("edge_betweenness_impl errors", { test_that("edge_betweenness_cutoff_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2282,7 +2139,6 @@ test_that("edge_betweenness_cutoff_impl basic", { test_that("edge_betweenness_cutoff_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(edge_betweenness_cutoff_impl( graph = NULL, cutoff = 2 @@ -2293,7 +2149,6 @@ test_that("edge_betweenness_cutoff_impl errors", { test_that("edge_betweenness_subset_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2311,7 +2166,6 @@ test_that("edge_betweenness_subset_impl basic", { test_that("edge_betweenness_subset_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(edge_betweenness_subset_impl( graph = NULL )) @@ -2321,7 +2175,6 @@ test_that("edge_betweenness_subset_impl errors", { test_that("harmonic_centrality_cutoff_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2341,7 +2194,6 @@ test_that("harmonic_centrality_cutoff_impl basic", { test_that("harmonic_centrality_cutoff_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( harmonic_centrality_cutoff_impl( graph = NULL, @@ -2354,7 +2206,6 @@ test_that("harmonic_centrality_cutoff_impl errors", { test_that("personalized_pagerank_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2377,7 +2228,6 @@ test_that("personalized_pagerank_impl basic", { test_that("personalized_pagerank_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(personalized_pagerank_impl( graph = NULL )) @@ -2387,7 +2237,6 @@ test_that("personalized_pagerank_impl errors", { test_that("personalized_pagerank_vs_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2413,7 +2262,6 @@ test_that("personalized_pagerank_vs_impl basic", { test_that("personalized_pagerank_vs_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( personalized_pagerank_vs_impl( graph = NULL, @@ -2426,7 +2274,6 @@ test_that("personalized_pagerank_vs_impl errors", { test_that("induced_subgraph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2446,7 +2293,6 @@ test_that("induced_subgraph_impl basic", { test_that("induced_subgraph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(induced_subgraph_impl( graph = NULL, vids = 1:2 @@ -2457,7 +2303,6 @@ test_that("induced_subgraph_impl errors", { test_that("subgraph_from_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2477,7 +2322,6 @@ test_that("subgraph_from_edges_impl basic", { test_that("subgraph_from_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(subgraph_from_edges_impl( graph = NULL, eids = 1 @@ -2488,7 +2332,6 @@ test_that("subgraph_from_edges_impl errors", { test_that("reverse_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2506,7 +2349,6 @@ test_that("reverse_edges_impl basic", { test_that("reverse_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(reverse_edges_impl( graph = NULL )) @@ -2520,7 +2362,6 @@ test_that("reverse_edges_impl errors", { test_that("path_length_hist_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2542,7 +2383,6 @@ test_that("path_length_hist_impl basic", { test_that("path_length_hist_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(path_length_hist_impl( graph = NULL )) @@ -2552,7 +2392,6 @@ test_that("path_length_hist_impl errors", { test_that("simplify_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2575,7 +2414,6 @@ test_that("simplify_impl basic", { test_that("simplify_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(simplify_impl( graph = NULL )) @@ -2585,7 +2423,6 @@ test_that("simplify_impl errors", { test_that("transitivity_undirected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2607,7 +2444,6 @@ test_that("transitivity_undirected_impl basic", { test_that("transitivity_undirected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitivity_undirected_impl( graph = NULL )) @@ -2617,7 +2453,6 @@ test_that("transitivity_undirected_impl errors", { test_that("transitivity_local_undirected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2639,7 +2474,6 @@ test_that("transitivity_local_undirected_impl basic", { test_that("transitivity_local_undirected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitivity_local_undirected_impl( graph = NULL )) @@ -2649,7 +2483,6 @@ test_that("transitivity_local_undirected_impl errors", { test_that("transitivity_avglocal_undirected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2671,7 +2504,6 @@ test_that("transitivity_avglocal_undirected_impl basic", { test_that("transitivity_avglocal_undirected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitivity_avglocal_undirected_impl( graph = NULL )) @@ -2681,7 +2513,6 @@ test_that("transitivity_avglocal_undirected_impl errors", { test_that("transitivity_barrat_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2705,7 +2536,6 @@ test_that("transitivity_barrat_impl basic", { test_that("transitivity_barrat_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitivity_barrat_impl( graph = NULL )) @@ -2715,7 +2545,6 @@ test_that("transitivity_barrat_impl errors", { test_that("ecc_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -2739,7 +2568,6 @@ test_that("ecc_impl basic", { test_that("ecc_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(ecc_impl( graph = NULL )) @@ -2749,7 +2577,6 @@ test_that("ecc_impl errors", { test_that("reciprocity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2772,7 +2599,6 @@ test_that("reciprocity_impl basic", { test_that("reciprocity_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(reciprocity_impl( graph = NULL )) @@ -2782,7 +2608,6 @@ test_that("reciprocity_impl errors", { test_that("maxdegree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2805,7 +2630,6 @@ test_that("maxdegree_impl basic", { test_that("maxdegree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(maxdegree_impl( graph = NULL )) @@ -2815,7 +2639,6 @@ test_that("maxdegree_impl errors", { test_that("density_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2837,7 +2660,6 @@ test_that("density_impl basic", { test_that("density_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(density_impl( graph = NULL )) @@ -2847,7 +2669,6 @@ test_that("density_impl errors", { test_that("mean_degree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2869,7 +2690,6 @@ test_that("mean_degree_impl basic", { test_that("mean_degree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(mean_degree_impl( graph = NULL )) @@ -2879,7 +2699,6 @@ test_that("mean_degree_impl errors", { test_that("feedback_arc_set_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2901,7 +2720,6 @@ test_that("feedback_arc_set_impl basic", { test_that("feedback_arc_set_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(feedback_arc_set_impl( graph = NULL )) @@ -2911,7 +2729,6 @@ test_that("feedback_arc_set_impl errors", { test_that("feedback_vertex_set_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2929,7 +2746,6 @@ test_that("feedback_vertex_set_impl basic", { test_that("feedback_vertex_set_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(feedback_vertex_set_impl( graph = NULL )) @@ -2939,7 +2755,6 @@ test_that("feedback_vertex_set_impl errors", { test_that("is_loop_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2957,7 +2772,6 @@ test_that("is_loop_impl basic", { test_that("is_loop_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_loop_impl( graph = NULL )) @@ -2967,7 +2781,6 @@ test_that("is_loop_impl errors", { test_that("is_dag_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -2985,7 +2798,6 @@ test_that("is_dag_impl basic", { test_that("is_dag_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_dag_impl( graph = NULL )) @@ -2995,7 +2807,6 @@ test_that("is_dag_impl errors", { test_that("is_acyclic_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3013,7 +2824,6 @@ test_that("is_acyclic_impl basic", { test_that("is_acyclic_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_acyclic_impl( graph = NULL )) @@ -3023,7 +2833,6 @@ test_that("is_acyclic_impl errors", { test_that("is_simple_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3041,7 +2850,6 @@ test_that("is_simple_impl basic", { test_that("is_simple_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_simple_impl( graph = NULL )) @@ -3051,7 +2859,6 @@ test_that("is_simple_impl errors", { test_that("is_multiple_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3069,7 +2876,6 @@ test_that("is_multiple_impl basic", { test_that("is_multiple_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_multiple_impl( graph = NULL )) @@ -3079,7 +2885,6 @@ test_that("is_multiple_impl errors", { test_that("has_loop_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3097,7 +2902,6 @@ test_that("has_loop_impl basic", { test_that("has_loop_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(has_loop_impl( graph = NULL )) @@ -3107,7 +2911,6 @@ test_that("has_loop_impl errors", { test_that("has_multiple_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3125,7 +2928,6 @@ test_that("has_multiple_impl basic", { test_that("has_multiple_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(has_multiple_impl( graph = NULL )) @@ -3135,7 +2937,6 @@ test_that("has_multiple_impl errors", { test_that("count_loops_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3153,7 +2954,6 @@ test_that("count_loops_impl basic", { test_that("count_loops_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_loops_impl( graph = NULL )) @@ -3163,7 +2963,6 @@ test_that("count_loops_impl errors", { test_that("count_multiple_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3181,7 +2980,6 @@ test_that("count_multiple_impl basic", { test_that("count_multiple_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_multiple_impl( graph = NULL )) @@ -3191,7 +2989,6 @@ test_that("count_multiple_impl errors", { test_that("is_perfect_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3209,7 +3006,6 @@ test_that("is_perfect_impl basic", { test_that("is_perfect_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_perfect_impl( graph = NULL )) @@ -3219,7 +3015,6 @@ test_that("is_perfect_impl errors", { test_that("eigenvector_centrality_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3242,7 +3037,6 @@ test_that("eigenvector_centrality_impl basic", { test_that("eigenvector_centrality_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(eigenvector_centrality_impl( graph = NULL )) @@ -3252,7 +3046,6 @@ test_that("eigenvector_centrality_impl errors", { test_that("hub_and_authority_scores_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(5) expect_snapshot(hub_and_authority_scores_impl( graph = g @@ -3271,7 +3064,6 @@ test_that("hub_and_authority_scores_impl basic", { test_that("hub_and_authority_scores_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hub_and_authority_scores_impl( graph = NULL )) @@ -3281,7 +3073,6 @@ test_that("hub_and_authority_scores_impl errors", { test_that("unfold_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3306,7 +3097,6 @@ test_that("unfold_tree_impl basic", { test_that("unfold_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(unfold_tree_impl( graph = NULL, roots = 1 @@ -3317,7 +3107,6 @@ test_that("unfold_tree_impl errors", { test_that("is_mutual_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3339,7 +3128,6 @@ test_that("is_mutual_impl basic", { test_that("is_mutual_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_mutual_impl( graph = NULL )) @@ -3349,7 +3137,6 @@ test_that("is_mutual_impl errors", { test_that("has_mutual_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3371,7 +3158,6 @@ test_that("has_mutual_impl basic", { test_that("has_mutual_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(has_mutual_impl( graph = NULL )) @@ -3381,7 +3167,6 @@ test_that("has_mutual_impl errors", { test_that("maximum_cardinality_search_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3399,7 +3184,6 @@ test_that("maximum_cardinality_search_impl basic", { test_that("maximum_cardinality_search_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(maximum_cardinality_search_impl( graph = NULL )) @@ -3409,7 +3193,6 @@ test_that("maximum_cardinality_search_impl errors", { test_that("avg_nearest_neighbor_degree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3432,7 +3215,6 @@ test_that("avg_nearest_neighbor_degree_impl basic", { test_that("avg_nearest_neighbor_degree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(avg_nearest_neighbor_degree_impl( graph = NULL )) @@ -3442,7 +3224,6 @@ test_that("avg_nearest_neighbor_degree_impl errors", { test_that("degree_correlation_vector_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3466,7 +3247,6 @@ test_that("degree_correlation_vector_impl basic", { test_that("degree_correlation_vector_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(degree_correlation_vector_impl( graph = NULL )) @@ -3476,7 +3256,6 @@ test_that("degree_correlation_vector_impl errors", { test_that("rich_club_sequence_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3503,7 +3282,6 @@ test_that("rich_club_sequence_impl basic", { test_that("rich_club_sequence_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( rich_club_sequence_impl( graph = NULL, @@ -3516,7 +3294,6 @@ test_that("rich_club_sequence_impl errors", { test_that("strength_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3539,7 +3316,6 @@ test_that("strength_impl basic", { test_that("strength_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(strength_impl( graph = NULL )) @@ -3549,7 +3325,6 @@ test_that("strength_impl errors", { test_that("centralization_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(centralization_impl( scores = c(1, 2, 3) )) @@ -3568,7 +3343,6 @@ test_that("centralization_impl basic", { test_that("centralization_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(centralization_impl( scores = package_version("1.2.3") )) @@ -3578,7 +3352,6 @@ test_that("centralization_impl errors", { test_that("centralization_degree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3602,7 +3375,6 @@ test_that("centralization_degree_impl basic", { test_that("centralization_degree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(centralization_degree_impl( graph = NULL )) @@ -3612,7 +3384,6 @@ test_that("centralization_degree_impl errors", { test_that("centralization_degree_tmax_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(centralization_degree_tmax_impl( nodes = 3, loops = TRUE @@ -3633,7 +3404,6 @@ test_that("centralization_degree_tmax_impl basic", { test_that("centralization_degree_tmax_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( centralization_degree_tmax_impl( nodes = -1, @@ -3646,7 +3416,6 @@ test_that("centralization_degree_tmax_impl errors", { test_that("centralization_betweenness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3669,7 +3438,6 @@ test_that("centralization_betweenness_impl basic", { test_that("centralization_betweenness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(centralization_betweenness_impl( graph = NULL )) @@ -3679,7 +3447,6 @@ test_that("centralization_betweenness_impl errors", { test_that("centralization_betweenness_tmax_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(centralization_betweenness_tmax_impl( nodes = 3, directed = TRUE @@ -3699,7 +3466,6 @@ test_that("centralization_betweenness_tmax_impl basic", { test_that("centralization_betweenness_tmax_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( centralization_betweenness_tmax_impl( nodes = -1, @@ -3712,7 +3478,6 @@ test_that("centralization_betweenness_tmax_impl errors", { test_that("centralization_closeness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3735,7 +3500,6 @@ test_that("centralization_closeness_impl basic", { test_that("centralization_closeness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(centralization_closeness_impl( graph = NULL )) @@ -3745,7 +3509,6 @@ test_that("centralization_closeness_impl errors", { test_that("centralization_closeness_tmax_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(centralization_closeness_tmax_impl( nodes = 3 )) @@ -3763,7 +3526,6 @@ test_that("centralization_closeness_tmax_impl basic", { test_that("centralization_closeness_tmax_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(centralization_closeness_tmax_impl( nodes = -1 )) @@ -3773,7 +3535,6 @@ test_that("centralization_closeness_tmax_impl errors", { test_that("centralization_eigenvector_centrality_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3796,7 +3557,6 @@ test_that("centralization_eigenvector_centrality_impl basic", { test_that("centralization_eigenvector_centrality_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( centralization_eigenvector_centrality_impl( graph = NULL @@ -3808,7 +3568,6 @@ test_that("centralization_eigenvector_centrality_impl errors", { test_that("centralization_eigenvector_centrality_tmax_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(centralization_eigenvector_centrality_tmax_impl( nodes = 3 )) @@ -3826,7 +3585,6 @@ test_that("centralization_eigenvector_centrality_tmax_impl basic", { test_that("centralization_eigenvector_centrality_tmax_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( centralization_eigenvector_centrality_tmax_impl( nodes = -1 @@ -3838,7 +3596,6 @@ test_that("centralization_eigenvector_centrality_tmax_impl errors", { test_that("assortativity_nominal_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3864,7 +3621,6 @@ test_that("assortativity_nominal_impl basic", { test_that("assortativity_nominal_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(assortativity_nominal_impl( graph = NULL, types = c(1, 2, 1) @@ -3875,7 +3631,6 @@ test_that("assortativity_nominal_impl errors", { test_that("assortativity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3901,7 +3656,6 @@ test_that("assortativity_impl basic", { test_that("assortativity_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(assortativity_impl( graph = NULL, values = c(1, 2, 1) @@ -3912,7 +3666,6 @@ test_that("assortativity_impl errors", { test_that("assortativity_degree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3934,7 +3687,6 @@ test_that("assortativity_degree_impl basic", { test_that("assortativity_degree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(assortativity_degree_impl( graph = NULL )) @@ -3944,7 +3696,6 @@ test_that("assortativity_degree_impl errors", { test_that("joint_degree_matrix_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -3967,7 +3718,6 @@ test_that("joint_degree_matrix_impl basic", { test_that("joint_degree_matrix_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(joint_degree_matrix_impl( graph = NULL )) @@ -3977,7 +3727,6 @@ test_that("joint_degree_matrix_impl errors", { test_that("joint_degree_distribution_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4004,7 +3753,6 @@ test_that("joint_degree_distribution_impl basic", { test_that("joint_degree_distribution_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(joint_degree_distribution_impl( graph = NULL )) @@ -4014,7 +3762,6 @@ test_that("joint_degree_distribution_impl errors", { test_that("joint_type_distribution_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4041,7 +3788,6 @@ test_that("joint_type_distribution_impl basic", { test_that("joint_type_distribution_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( joint_type_distribution_impl( graph = NULL, @@ -4054,7 +3800,6 @@ test_that("joint_type_distribution_impl errors", { test_that("contract_vertices_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4074,7 +3819,6 @@ test_that("contract_vertices_impl basic", { test_that("contract_vertices_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(contract_vertices_impl( graph = NULL, mapping = c(1, 1, 2) @@ -4085,7 +3829,6 @@ test_that("contract_vertices_impl errors", { test_that("eccentricity_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4107,7 +3850,6 @@ test_that("eccentricity_dijkstra_impl basic", { test_that("eccentricity_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(eccentricity_dijkstra_impl( graph = NULL )) @@ -4117,7 +3859,6 @@ test_that("eccentricity_dijkstra_impl errors", { test_that("graph_center_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4139,7 +3880,6 @@ test_that("graph_center_dijkstra_impl basic", { test_that("graph_center_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(graph_center_dijkstra_impl( graph = NULL )) @@ -4149,7 +3889,6 @@ test_that("graph_center_dijkstra_impl errors", { test_that("radius_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4171,7 +3910,6 @@ test_that("radius_dijkstra_impl basic", { test_that("radius_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(radius_dijkstra_impl( graph = NULL )) @@ -4181,7 +3919,6 @@ test_that("radius_dijkstra_impl errors", { test_that("pseudo_diameter_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4207,7 +3944,6 @@ test_that("pseudo_diameter_impl basic", { test_that("pseudo_diameter_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(pseudo_diameter_impl( graph = NULL, start_vid = 1 @@ -4218,7 +3954,6 @@ test_that("pseudo_diameter_impl errors", { test_that("pseudo_diameter_dijkstra_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4244,7 +3979,6 @@ test_that("pseudo_diameter_dijkstra_impl basic", { test_that("pseudo_diameter_dijkstra_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( pseudo_diameter_dijkstra_impl( graph = NULL, @@ -4257,7 +3991,6 @@ test_that("pseudo_diameter_dijkstra_impl errors", { test_that("diversity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4276,7 +4009,6 @@ test_that("diversity_impl basic", { test_that("diversity_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(diversity_impl( graph = NULL )) @@ -4286,7 +4018,6 @@ test_that("diversity_impl errors", { test_that("random_walk_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4315,7 +4046,6 @@ test_that("random_walk_impl basic", { test_that("random_walk_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(random_walk_impl( graph = NULL, start = 1, @@ -4327,7 +4057,6 @@ test_that("random_walk_impl errors", { test_that("global_efficiency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4349,7 +4078,6 @@ test_that("global_efficiency_impl basic", { test_that("global_efficiency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(global_efficiency_impl( graph = NULL )) @@ -4359,7 +4087,6 @@ test_that("global_efficiency_impl errors", { test_that("local_efficiency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4382,7 +4109,6 @@ test_that("local_efficiency_impl basic", { test_that("local_efficiency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(local_efficiency_impl( graph = NULL )) @@ -4392,7 +4118,6 @@ test_that("local_efficiency_impl errors", { test_that("average_local_efficiency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4415,7 +4140,6 @@ test_that("average_local_efficiency_impl basic", { test_that("average_local_efficiency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(average_local_efficiency_impl( graph = NULL )) @@ -4425,7 +4149,6 @@ test_that("average_local_efficiency_impl errors", { test_that("transitive_closure_dag_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3, directed = TRUE @@ -4444,7 +4167,6 @@ test_that("transitive_closure_dag_impl basic", { test_that("transitive_closure_dag_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitive_closure_dag_impl( graph = NULL )) @@ -4454,7 +4176,6 @@ test_that("transitive_closure_dag_impl errors", { test_that("transitive_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4472,7 +4193,6 @@ test_that("transitive_closure_impl basic", { test_that("transitive_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(transitive_closure_impl( graph = NULL )) @@ -4482,7 +4202,6 @@ test_that("transitive_closure_impl errors", { test_that("trussness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4500,7 +4219,6 @@ test_that("trussness_impl basic", { test_that("trussness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(trussness_impl( graph = NULL )) @@ -4510,7 +4228,6 @@ test_that("trussness_impl errors", { test_that("is_graphical_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(is_graphical_impl( out_deg = c(2, 2, 2) )) @@ -4529,7 +4246,6 @@ test_that("is_graphical_impl basic", { test_that("is_graphical_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_graphical_impl( out_deg = "a" )) @@ -4539,7 +4255,6 @@ test_that("is_graphical_impl errors", { test_that("bfs_simple_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4564,7 +4279,6 @@ test_that("bfs_simple_impl basic", { test_that("bfs_simple_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bfs_simple_impl( graph = NULL, root = 1 @@ -4575,7 +4289,6 @@ test_that("bfs_simple_impl errors", { test_that("bipartite_projection_size_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -4594,7 +4307,6 @@ test_that("bipartite_projection_size_impl basic", { test_that("bipartite_projection_size_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bipartite_projection_size_impl( graph = NULL )) @@ -4604,7 +4316,6 @@ test_that("bipartite_projection_size_impl errors", { test_that("biadjacency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) m <- matrix(c(1, 0, 1, 0, 1, 1), nrow = 2) expect_snapshot(biadjacency_impl( incidence = m @@ -4625,7 +4336,6 @@ test_that("biadjacency_impl basic", { test_that("biadjacency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(biadjacency_impl( incidence = "a" )) @@ -4635,7 +4345,6 @@ test_that("biadjacency_impl errors", { test_that("get_biadjacency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4655,7 +4364,6 @@ test_that("get_biadjacency_impl basic", { test_that("get_biadjacency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( get_biadjacency_impl( graph = NULL, @@ -4668,7 +4376,6 @@ test_that("get_biadjacency_impl errors", { test_that("is_bipartite_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4686,7 +4393,6 @@ test_that("is_bipartite_impl basic", { test_that("is_bipartite_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_bipartite_impl( graph = NULL )) @@ -4696,7 +4402,6 @@ test_that("is_bipartite_impl errors", { test_that("bipartite_game_gnp_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(bipartite_game_gnp_impl( n1 = 2, n2 = 2, @@ -4721,7 +4426,6 @@ test_that("bipartite_game_gnp_impl basic", { test_that("bipartite_game_gnp_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bipartite_game_gnp_impl( n1 = -1, n2 = 2, @@ -4733,7 +4437,6 @@ test_that("bipartite_game_gnp_impl errors", { test_that("bipartite_game_gnm_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(bipartite_game_gnm_impl( n1 = 2, n2 = 2, @@ -4758,7 +4461,6 @@ test_that("bipartite_game_gnm_impl basic", { test_that("bipartite_game_gnm_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bipartite_game_gnm_impl( n1 = -1, n2 = 2, @@ -4770,7 +4472,6 @@ test_that("bipartite_game_gnm_impl errors", { test_that("get_laplacian_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4794,7 +4495,6 @@ test_that("get_laplacian_impl basic", { test_that("get_laplacian_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_laplacian_impl( graph = NULL )) @@ -4804,7 +4504,6 @@ test_that("get_laplacian_impl errors", { test_that("get_laplacian_sparse_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4828,7 +4527,6 @@ test_that("get_laplacian_sparse_impl basic", { test_that("get_laplacian_sparse_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_laplacian_sparse_impl( graph = NULL )) @@ -4838,7 +4536,6 @@ test_that("get_laplacian_sparse_impl errors", { test_that("connected_components_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4861,7 +4558,6 @@ test_that("connected_components_impl basic", { test_that("connected_components_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(connected_components_impl( graph = NULL )) @@ -4871,7 +4567,6 @@ test_that("connected_components_impl errors", { test_that("is_connected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4893,7 +4588,6 @@ test_that("is_connected_impl basic", { test_that("is_connected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_connected_impl( graph = NULL )) @@ -4903,7 +4597,6 @@ test_that("is_connected_impl errors", { test_that("articulation_points_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4921,7 +4614,6 @@ test_that("articulation_points_impl basic", { test_that("articulation_points_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(articulation_points_impl( graph = NULL )) @@ -4931,7 +4623,6 @@ test_that("articulation_points_impl errors", { test_that("biconnected_components_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4949,7 +4640,6 @@ test_that("biconnected_components_impl basic", { test_that("biconnected_components_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(biconnected_components_impl( graph = NULL )) @@ -4959,7 +4649,6 @@ test_that("biconnected_components_impl errors", { test_that("bridges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -4977,7 +4666,6 @@ test_that("bridges_impl basic", { test_that("bridges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bridges_impl( graph = NULL )) @@ -4987,7 +4675,6 @@ test_that("bridges_impl errors", { test_that("is_biconnected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5005,7 +4692,6 @@ test_that("is_biconnected_impl basic", { test_that("is_biconnected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_biconnected_impl( graph = NULL )) @@ -5015,7 +4701,6 @@ test_that("is_biconnected_impl errors", { test_that("count_reachable_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -5039,7 +4724,6 @@ test_that("count_reachable_impl basic", { test_that("count_reachable_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_reachable_impl( graph = NULL, mode = "out" @@ -5050,7 +4734,6 @@ test_that("count_reachable_impl errors", { test_that("bond_percolation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5068,7 +4751,6 @@ test_that("bond_percolation_impl basic", { test_that("bond_percolation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bond_percolation_impl( graph = NULL )) @@ -5078,7 +4760,6 @@ test_that("bond_percolation_impl errors", { test_that("site_percolation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5096,7 +4777,6 @@ test_that("site_percolation_impl basic", { test_that("site_percolation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(site_percolation_impl( graph = NULL )) @@ -5106,7 +4786,6 @@ test_that("site_percolation_impl errors", { test_that("edgelist_percolation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(edgelist_percolation_impl( edges = matrix(c(1, 2, 2, 3), ncol = 2) )) @@ -5120,7 +4799,6 @@ test_that("edgelist_percolation_impl basic", { test_that("edgelist_percolation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(edgelist_percolation_impl( edges = "a" )) @@ -5130,7 +4808,6 @@ test_that("edgelist_percolation_impl errors", { test_that("is_clique_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5155,7 +4832,6 @@ test_that("is_clique_impl basic", { test_that("is_clique_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_clique_impl( graph = NULL, candidate = 1:2 @@ -5166,7 +4842,6 @@ test_that("is_clique_impl errors", { test_that("cliques_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5189,7 +4864,6 @@ test_that("cliques_impl basic", { test_that("cliques_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(cliques_impl( graph = NULL )) @@ -5199,7 +4873,6 @@ test_that("cliques_impl errors", { test_that("clique_size_hist_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5222,7 +4895,6 @@ test_that("clique_size_hist_impl basic", { test_that("clique_size_hist_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(clique_size_hist_impl( graph = NULL )) @@ -5232,7 +4904,6 @@ test_that("clique_size_hist_impl errors", { test_that("largest_cliques_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5250,7 +4921,6 @@ test_that("largest_cliques_impl basic", { test_that("largest_cliques_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(largest_cliques_impl( graph = NULL )) @@ -5260,7 +4930,6 @@ test_that("largest_cliques_impl errors", { test_that("maximal_cliques_hist_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5283,7 +4952,6 @@ test_that("maximal_cliques_hist_impl basic", { test_that("maximal_cliques_hist_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(maximal_cliques_hist_impl( graph = NULL )) @@ -5293,7 +4961,6 @@ test_that("maximal_cliques_hist_impl errors", { test_that("clique_number_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5311,7 +4978,6 @@ test_that("clique_number_impl basic", { test_that("clique_number_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(clique_number_impl( graph = NULL )) @@ -5321,7 +4987,6 @@ test_that("clique_number_impl errors", { test_that("weighted_cliques_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5346,7 +5011,6 @@ test_that("weighted_cliques_impl basic", { test_that("weighted_cliques_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(weighted_cliques_impl( graph = NULL )) @@ -5356,7 +5020,6 @@ test_that("weighted_cliques_impl errors", { test_that("largest_weighted_cliques_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5378,7 +5041,6 @@ test_that("largest_weighted_cliques_impl basic", { test_that("largest_weighted_cliques_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(largest_weighted_cliques_impl( graph = NULL )) @@ -5388,7 +5050,6 @@ test_that("largest_weighted_cliques_impl errors", { test_that("weighted_clique_number_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5410,7 +5071,6 @@ test_that("weighted_clique_number_impl basic", { test_that("weighted_clique_number_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(weighted_clique_number_impl( graph = NULL )) @@ -5420,7 +5080,6 @@ test_that("weighted_clique_number_impl errors", { test_that("is_independent_vertex_set_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5440,7 +5099,6 @@ test_that("is_independent_vertex_set_impl basic", { test_that("is_independent_vertex_set_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_independent_vertex_set_impl( graph = NULL, candidate = 1:2 @@ -5451,7 +5109,6 @@ test_that("is_independent_vertex_set_impl errors", { test_that("layout_random_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5469,7 +5126,6 @@ test_that("layout_random_impl basic", { test_that("layout_random_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_random_impl( graph = NULL )) @@ -5479,7 +5135,6 @@ test_that("layout_random_impl errors", { test_that("layout_circle_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5501,7 +5156,6 @@ test_that("layout_circle_impl basic", { test_that("layout_circle_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_circle_impl( graph = NULL )) @@ -5511,7 +5165,6 @@ test_that("layout_circle_impl errors", { test_that("layout_star_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5543,7 +5196,6 @@ test_that("layout_star_impl basic", { test_that("layout_star_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_star_impl( graph = NULL )) @@ -5553,7 +5205,6 @@ test_that("layout_star_impl errors", { test_that("layout_grid_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5575,7 +5226,6 @@ test_that("layout_grid_impl basic", { test_that("layout_grid_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_grid_impl( graph = NULL )) @@ -5585,7 +5235,6 @@ test_that("layout_grid_impl errors", { test_that("layout_grid_3d_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5608,7 +5257,6 @@ test_that("layout_grid_3d_impl basic", { test_that("layout_grid_3d_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_grid_3d_impl( graph = NULL )) @@ -5618,7 +5266,6 @@ test_that("layout_grid_3d_impl errors", { test_that("roots_for_tree_layout_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5640,7 +5287,6 @@ test_that("roots_for_tree_layout_impl basic", { test_that("roots_for_tree_layout_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( roots_for_tree_layout_impl( graph = NULL, @@ -5654,7 +5300,6 @@ test_that("roots_for_tree_layout_impl errors", { test_that("layout_random_3d_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5672,7 +5317,6 @@ test_that("layout_random_3d_impl basic", { test_that("layout_random_3d_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_random_3d_impl( graph = NULL )) @@ -5682,7 +5326,6 @@ test_that("layout_random_3d_impl errors", { test_that("layout_sphere_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5700,7 +5343,6 @@ test_that("layout_sphere_impl basic", { test_that("layout_sphere_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_sphere_impl( graph = NULL )) @@ -5710,7 +5352,6 @@ test_that("layout_sphere_impl errors", { test_that("layout_sugiyama_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5736,7 +5377,6 @@ test_that("layout_sugiyama_impl basic", { test_that("layout_sugiyama_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_sugiyama_impl( graph = NULL )) @@ -5746,7 +5386,6 @@ test_that("layout_sugiyama_impl errors", { test_that("layout_mds_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5769,7 +5408,6 @@ test_that("layout_mds_impl basic", { test_that("layout_mds_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(layout_mds_impl( graph = NULL )) @@ -5779,7 +5417,6 @@ test_that("layout_mds_impl errors", { test_that("layout_bipartite_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5806,7 +5443,6 @@ test_that("layout_bipartite_impl basic", { test_that("layout_bipartite_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_bipartite_impl( graph = NULL, @@ -5819,7 +5455,6 @@ test_that("layout_bipartite_impl errors", { test_that("layout_gem_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5848,7 +5483,6 @@ test_that("layout_gem_impl basic", { test_that("layout_gem_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_gem_impl( graph = NULL, @@ -5861,7 +5495,6 @@ test_that("layout_gem_impl errors", { test_that("layout_davidson_harel_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5894,7 +5527,6 @@ test_that("layout_davidson_harel_impl basic", { test_that("layout_davidson_harel_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_davidson_harel_impl( graph = NULL, @@ -5907,7 +5539,6 @@ test_that("layout_davidson_harel_impl errors", { test_that("layout_umap_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5938,7 +5569,6 @@ test_that("layout_umap_impl basic", { test_that("layout_umap_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_umap_impl( graph = NULL, @@ -5951,7 +5581,6 @@ test_that("layout_umap_impl errors", { test_that("layout_umap_3d_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -5982,7 +5611,6 @@ test_that("layout_umap_3d_impl basic", { test_that("layout_umap_3d_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_umap_3d_impl( graph = NULL, @@ -5995,7 +5623,6 @@ test_that("layout_umap_3d_impl errors", { test_that("layout_umap_compute_weights_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6017,7 +5644,6 @@ test_that("layout_umap_compute_weights_impl basic", { test_that("layout_umap_compute_weights_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_umap_compute_weights_impl( graph = NULL, @@ -6031,7 +5657,6 @@ test_that("layout_umap_compute_weights_impl errors", { test_that("layout_align_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6051,7 +5676,6 @@ test_that("layout_align_impl basic", { test_that("layout_align_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( layout_align_impl( graph = NULL, @@ -6064,7 +5688,6 @@ test_that("layout_align_impl errors", { test_that("similarity_dice_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6088,7 +5711,6 @@ test_that("similarity_dice_impl basic", { test_that("similarity_dice_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(similarity_dice_impl( graph = NULL )) @@ -6098,7 +5720,6 @@ test_that("similarity_dice_impl errors", { test_that("similarity_dice_es_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6122,7 +5743,6 @@ test_that("similarity_dice_es_impl basic", { test_that("similarity_dice_es_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(similarity_dice_es_impl( graph = NULL )) @@ -6132,7 +5752,6 @@ test_that("similarity_dice_es_impl errors", { test_that("similarity_dice_pairs_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -6158,7 +5777,6 @@ test_that("similarity_dice_pairs_impl basic", { test_that("similarity_dice_pairs_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( similarity_dice_pairs_impl( graph = NULL, @@ -6171,7 +5789,6 @@ test_that("similarity_dice_pairs_impl errors", { test_that("similarity_inverse_log_weighted_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6194,7 +5811,6 @@ test_that("similarity_inverse_log_weighted_impl basic", { test_that("similarity_inverse_log_weighted_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(similarity_inverse_log_weighted_impl( graph = NULL )) @@ -6204,7 +5820,6 @@ test_that("similarity_inverse_log_weighted_impl errors", { test_that("similarity_jaccard_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6228,7 +5843,6 @@ test_that("similarity_jaccard_impl basic", { test_that("similarity_jaccard_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(similarity_jaccard_impl( graph = NULL )) @@ -6238,7 +5852,6 @@ test_that("similarity_jaccard_impl errors", { test_that("similarity_jaccard_es_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6262,7 +5875,6 @@ test_that("similarity_jaccard_es_impl basic", { test_that("similarity_jaccard_es_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(similarity_jaccard_es_impl( graph = NULL )) @@ -6272,7 +5884,6 @@ test_that("similarity_jaccard_es_impl errors", { test_that("similarity_jaccard_pairs_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -6298,7 +5909,6 @@ test_that("similarity_jaccard_pairs_impl basic", { test_that("similarity_jaccard_pairs_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( similarity_jaccard_pairs_impl( graph = NULL, @@ -6311,7 +5921,6 @@ test_that("similarity_jaccard_pairs_impl errors", { test_that("compare_communities_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(compare_communities_impl( comm1 = c(1, 2, 1), comm2 = c(2, 1, 2) @@ -6332,7 +5941,6 @@ test_that("compare_communities_impl basic", { test_that("compare_communities_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(compare_communities_impl( comm1 = "a", comm2 = c(2, 1, 2) @@ -6343,7 +5951,6 @@ test_that("compare_communities_impl errors", { test_that("modularity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6370,7 +5977,6 @@ test_that("modularity_impl basic", { test_that("modularity_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(modularity_impl( graph = NULL, membership = c(1, 2, 1) @@ -6381,7 +5987,6 @@ test_that("modularity_impl errors", { test_that("modularity_matrix_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6405,7 +6010,6 @@ test_that("modularity_matrix_impl basic", { test_that("modularity_matrix_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(modularity_matrix_impl( graph = NULL )) @@ -6415,7 +6019,6 @@ test_that("modularity_matrix_impl errors", { test_that("community_fluid_communities_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6435,7 +6038,6 @@ test_that("community_fluid_communities_impl basic", { test_that("community_fluid_communities_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( community_fluid_communities_impl( graph = NULL, @@ -6448,7 +6050,6 @@ test_that("community_fluid_communities_impl errors", { test_that("community_label_propagation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6473,7 +6074,6 @@ test_that("community_label_propagation_impl basic", { test_that("community_label_propagation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_label_propagation_impl( graph = NULL )) @@ -6483,7 +6083,6 @@ test_that("community_label_propagation_impl errors", { test_that("community_multilevel_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6506,7 +6105,6 @@ test_that("community_multilevel_impl basic", { test_that("community_multilevel_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_multilevel_impl( graph = NULL )) @@ -6516,7 +6114,6 @@ test_that("community_multilevel_impl errors", { test_that("community_optimal_modularity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6538,7 +6135,6 @@ test_that("community_optimal_modularity_impl basic", { test_that("community_optimal_modularity_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_optimal_modularity_impl( graph = NULL )) @@ -6548,7 +6144,6 @@ test_that("community_optimal_modularity_impl errors", { test_that("community_leiden_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6580,7 +6175,6 @@ test_that("community_leiden_impl basic", { test_that("community_leiden_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_leiden_impl( graph = NULL, resolution = 1 @@ -6591,7 +6185,6 @@ test_that("community_leiden_impl errors", { test_that("split_join_distance_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(split_join_distance_impl( comm1 = c(1, 2, 1), comm2 = c(2, 1, 2) @@ -6607,7 +6200,6 @@ test_that("split_join_distance_impl basic", { test_that("split_join_distance_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(split_join_distance_impl( comm1 = "a", comm2 = c(2, 1, 2) @@ -6618,7 +6210,6 @@ test_that("split_join_distance_impl errors", { test_that("community_infomap_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6642,7 +6233,6 @@ test_that("community_infomap_impl basic", { test_that("community_infomap_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_infomap_impl( graph = NULL )) @@ -6652,7 +6242,6 @@ test_that("community_infomap_impl errors", { test_that("graphlets_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6676,7 +6265,6 @@ test_that("graphlets_impl basic", { test_that("graphlets_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(graphlets_impl( graph = NULL )) @@ -6686,7 +6274,6 @@ test_that("graphlets_impl errors", { test_that("hrg_fit_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -6704,7 +6291,6 @@ test_that("hrg_fit_impl basic", { test_that("hrg_fit_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hrg_fit_impl( graph = NULL )) @@ -6715,7 +6301,6 @@ test_that("hrg_fit_impl errors", { test_that("hrg_sample_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(hrg_sample_impl( @@ -6732,7 +6317,6 @@ test_that("hrg_sample_impl basic", { test_that("hrg_sample_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: This test triggers an assertion failure in the C code when passing # NULL/empty HRG. The C code should validate input and return a proper error # message instead of an assertion failure. @@ -6746,7 +6330,6 @@ test_that("hrg_sample_impl errors", { test_that("hrg_sample_many_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(hrg_sample_many_impl( @@ -6765,7 +6348,6 @@ test_that("hrg_sample_many_impl basic", { test_that("hrg_sample_many_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: This test triggers an assertion failure in the C code when passing # NULL/empty HRG. The C code should validate input and return a proper error # message instead of an assertion failure. @@ -6780,7 +6362,6 @@ test_that("hrg_sample_many_impl errors", { test_that("hrg_game_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(hrg_game_impl( @@ -6797,7 +6378,6 @@ test_that("hrg_game_impl basic", { test_that("hrg_game_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: This test triggers an assertion failure in the C code when passing # NULL/empty HRG. The C code should validate input and return a proper error # message instead of an assertion failure. @@ -6819,7 +6399,6 @@ test_that("hrg_game_impl errors", { test_that("hrg_consensus_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hrg_consensus_impl( graph = NULL )) @@ -6838,7 +6417,6 @@ test_that("hrg_consensus_impl errors", { test_that("hrg_predict_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hrg_predict_impl( graph = NULL )) @@ -6848,7 +6426,6 @@ test_that("hrg_predict_impl errors", { test_that("hrg_create_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_tree(5) expect_snapshot(hrg_create_impl( graph = g, @@ -6865,7 +6442,6 @@ test_that("hrg_create_impl basic", { test_that("hrg_create_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(4, directed = TRUE) expect_snapshot_igraph_error(hrg_create_impl( graph = g, @@ -6878,7 +6454,6 @@ test_that("hrg_create_impl errors", { test_that("hrg_resize_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(hrg_resize_impl( @@ -6897,7 +6472,6 @@ test_that("hrg_resize_impl basic", { test_that("hrg_resize_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hrg_resize_impl( hrg = -1, newsize = 2 @@ -6909,7 +6483,6 @@ test_that("hrg_resize_impl errors", { test_that("hrg_size_impl basic", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(hrg_size_impl( @@ -6926,7 +6499,6 @@ test_that("hrg_size_impl basic", { test_that("hrg_size_impl errors", { skip_if(Sys.getenv("R_SANITIZER") == "true") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(hrg_size_impl( hrg = -1 )) @@ -6936,7 +6508,6 @@ test_that("hrg_size_impl errors", { test_that("from_hrg_dendrogram_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(10) hrg_model <- fit_hrg(g, hrg = NULL, start = FALSE, steps = 0) expect_snapshot(from_hrg_dendrogram_impl( @@ -6952,7 +6523,6 @@ test_that("from_hrg_dendrogram_impl basic", { test_that("from_hrg_dendrogram_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(from_hrg_dendrogram_impl( hrg = -1 )) @@ -6962,7 +6532,6 @@ test_that("from_hrg_dendrogram_impl errors", { test_that("get_adjacency_sparse_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -6986,7 +6555,6 @@ test_that("get_adjacency_sparse_impl basic", { test_that("get_adjacency_sparse_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_adjacency_sparse_impl( graph = NULL )) @@ -6996,7 +6564,6 @@ test_that("get_adjacency_sparse_impl errors", { test_that("get_stochastic_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7019,7 +6586,6 @@ test_that("get_stochastic_impl basic", { test_that("get_stochastic_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_stochastic_impl( graph = NULL )) @@ -7029,7 +6595,6 @@ test_that("get_stochastic_impl errors", { test_that("get_stochastic_sparse_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7052,7 +6617,6 @@ test_that("get_stochastic_sparse_impl basic", { test_that("get_stochastic_sparse_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(get_stochastic_sparse_impl( graph = NULL )) @@ -7062,7 +6626,6 @@ test_that("get_stochastic_sparse_impl errors", { test_that("to_directed_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7084,7 +6647,6 @@ test_that("to_directed_impl basic", { test_that("to_directed_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(to_directed_impl( graph = NULL )) @@ -7094,7 +6656,6 @@ test_that("to_directed_impl errors", { test_that("to_undirected_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7117,7 +6678,6 @@ test_that("to_undirected_impl basic", { test_that("to_undirected_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(to_undirected_impl( graph = NULL )) @@ -7127,7 +6687,6 @@ test_that("to_undirected_impl errors", { test_that("motifs_randesu_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7150,7 +6709,6 @@ test_that("motifs_randesu_impl basic", { test_that("motifs_randesu_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(motifs_randesu_impl( graph = NULL )) @@ -7160,7 +6718,6 @@ test_that("motifs_randesu_impl errors", { test_that("motifs_randesu_estimate_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 6 ) @@ -7189,7 +6746,6 @@ test_that("motifs_randesu_estimate_impl basic", { test_that("motifs_randesu_estimate_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( motifs_randesu_estimate_impl( graph = NULL, @@ -7203,7 +6759,6 @@ test_that("motifs_randesu_estimate_impl errors", { test_that("motifs_randesu_no_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7226,7 +6781,6 @@ test_that("motifs_randesu_no_impl basic", { test_that("motifs_randesu_no_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7244,7 +6798,6 @@ test_that("motifs_randesu_no_impl errors", { test_that("dyad_census_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7262,7 +6815,6 @@ test_that("dyad_census_impl basic", { test_that("dyad_census_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(dyad_census_impl( graph = NULL )) @@ -7272,7 +6824,6 @@ test_that("dyad_census_impl errors", { test_that("triad_census_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7292,7 +6843,6 @@ test_that("triad_census_impl basic", { test_that("triad_census_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(triad_census_impl( graph = NULL )) @@ -7302,7 +6852,6 @@ test_that("triad_census_impl errors", { test_that("count_adjacent_triangles_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7324,7 +6873,6 @@ test_that("count_adjacent_triangles_impl basic", { test_that("count_adjacent_triangles_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_adjacent_triangles_impl( graph = NULL )) @@ -7334,7 +6882,6 @@ test_that("count_adjacent_triangles_impl errors", { test_that("count_triangles_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7352,7 +6899,6 @@ test_that("count_triangles_impl basic", { test_that("count_triangles_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_triangles_impl( graph = NULL )) @@ -7362,7 +6908,6 @@ test_that("count_triangles_impl errors", { test_that("local_scan_0_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7385,7 +6930,6 @@ test_that("local_scan_0_impl basic", { test_that("local_scan_0_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(local_scan_0_impl( graph = NULL )) @@ -7395,7 +6939,6 @@ test_that("local_scan_0_impl errors", { test_that("local_scan_0_them_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7425,7 +6968,6 @@ test_that("local_scan_0_them_impl basic", { test_that("local_scan_0_them_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) them <- path_graph_impl( n = 3 ) @@ -7441,7 +6983,6 @@ test_that("local_scan_0_them_impl errors", { test_that("local_scan_1_ecount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7464,7 +7005,6 @@ test_that("local_scan_1_ecount_impl basic", { test_that("local_scan_1_ecount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(local_scan_1_ecount_impl( graph = NULL )) @@ -7474,7 +7014,6 @@ test_that("local_scan_1_ecount_impl errors", { test_that("local_scan_1_ecount_them_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7504,7 +7043,6 @@ test_that("local_scan_1_ecount_them_impl basic", { test_that("local_scan_1_ecount_them_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) them <- path_graph_impl( n = 3 ) @@ -7520,7 +7058,6 @@ test_that("local_scan_1_ecount_them_impl errors", { test_that("local_scan_k_ecount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7546,7 +7083,6 @@ test_that("local_scan_k_ecount_impl basic", { test_that("local_scan_k_ecount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(local_scan_k_ecount_impl( graph = NULL, k = 1 @@ -7557,7 +7093,6 @@ test_that("local_scan_k_ecount_impl errors", { test_that("local_scan_k_ecount_them_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7590,7 +7125,6 @@ test_that("local_scan_k_ecount_them_impl basic", { test_that("local_scan_k_ecount_them_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) them <- path_graph_impl( n = 3 ) @@ -7607,7 +7141,6 @@ test_that("local_scan_k_ecount_them_impl errors", { test_that("local_scan_neighborhood_ecount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -7632,7 +7165,6 @@ test_that("local_scan_neighborhood_ecount_impl basic", { test_that("local_scan_neighborhood_ecount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( local_scan_neighborhood_ecount_impl( graph = NULL, @@ -7645,7 +7177,6 @@ test_that("local_scan_neighborhood_ecount_impl errors", { test_that("local_scan_subset_ecount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -7670,7 +7201,6 @@ test_that("local_scan_subset_ecount_impl basic", { test_that("local_scan_subset_ecount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 4 ) @@ -7687,7 +7217,6 @@ test_that("local_scan_subset_ecount_impl errors", { test_that("list_triangles_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7705,7 +7234,6 @@ test_that("list_triangles_impl basic", { test_that("list_triangles_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(list_triangles_impl( graph = NULL )) @@ -7715,7 +7243,6 @@ test_that("list_triangles_impl errors", { test_that("join_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7739,7 +7266,6 @@ test_that("join_impl basic", { test_that("join_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) right <- path_graph_impl( n = 3 ) @@ -7753,7 +7279,6 @@ test_that("join_impl errors", { test_that("induced_subgraph_map_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7780,7 +7305,6 @@ test_that("induced_subgraph_map_impl basic", { test_that("induced_subgraph_map_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( induced_subgraph_map_impl( graph = NULL, @@ -7794,7 +7318,6 @@ test_that("induced_subgraph_map_impl errors", { test_that("mycielskian_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7816,7 +7339,6 @@ test_that("mycielskian_impl basic", { test_that("mycielskian_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(mycielskian_impl( graph = NULL )) @@ -7826,7 +7348,6 @@ test_that("mycielskian_impl errors", { test_that("product_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7855,7 +7376,6 @@ test_that("product_impl basic", { test_that("product_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g2 <- path_graph_impl( n = 3 ) @@ -7869,7 +7389,6 @@ test_that("product_impl errors", { test_that("rooted_product_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -7895,7 +7414,6 @@ test_that("rooted_product_impl basic", { test_that("rooted_product_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g2 <- path_graph_impl( n = 3 ) @@ -7912,7 +7430,6 @@ test_that("rooted_product_impl errors", { test_that("gomory_hu_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7934,7 +7451,6 @@ test_that("gomory_hu_tree_impl basic", { test_that("gomory_hu_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(gomory_hu_tree_impl( graph = NULL )) @@ -7944,7 +7460,6 @@ test_that("gomory_hu_tree_impl errors", { test_that("maxflow_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -7972,7 +7487,6 @@ test_that("maxflow_impl basic", { test_that("maxflow_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(maxflow_impl( graph = NULL, source = 1, @@ -7984,7 +7498,6 @@ test_that("maxflow_impl errors", { test_that("residual_graph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8006,7 +7519,6 @@ test_that("residual_graph_impl basic", { test_that("residual_graph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( residual_graph_impl( graph = NULL, @@ -8020,7 +7532,6 @@ test_that("residual_graph_impl errors", { test_that("reverse_residual_graph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8042,7 +7553,6 @@ test_that("reverse_residual_graph_impl basic", { test_that("reverse_residual_graph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( reverse_residual_graph_impl( graph = NULL, @@ -8056,7 +7566,6 @@ test_that("reverse_residual_graph_impl errors", { test_that("st_mincut_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8084,7 +7593,6 @@ test_that("st_mincut_impl basic", { test_that("st_mincut_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(st_mincut_impl( graph = NULL, source = 1, @@ -8096,7 +7604,6 @@ test_that("st_mincut_impl errors", { test_that("dominator_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3, directed = TRUE @@ -8122,7 +7629,6 @@ test_that("dominator_tree_impl basic", { test_that("dominator_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(dominator_tree_impl( graph = NULL, root = 1 @@ -8133,7 +7639,6 @@ test_that("dominator_tree_impl errors", { test_that("all_st_cuts_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3, directed = TRUE @@ -8156,7 +7661,6 @@ test_that("all_st_cuts_impl basic", { test_that("all_st_cuts_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(all_st_cuts_impl( graph = NULL, source = 1, @@ -8168,7 +7672,6 @@ test_that("all_st_cuts_impl errors", { test_that("all_st_mincuts_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3, directed = TRUE @@ -8197,7 +7700,6 @@ test_that("all_st_mincuts_impl basic", { test_that("all_st_mincuts_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( all_st_mincuts_impl( graph = NULL, @@ -8211,7 +7713,6 @@ test_that("all_st_mincuts_impl errors", { test_that("even_tarjan_reduction_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8229,7 +7730,6 @@ test_that("even_tarjan_reduction_impl basic", { test_that("even_tarjan_reduction_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(even_tarjan_reduction_impl( graph = NULL )) @@ -8239,7 +7739,6 @@ test_that("even_tarjan_reduction_impl errors", { test_that("is_separator_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8259,7 +7758,6 @@ test_that("is_separator_impl basic", { test_that("is_separator_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_separator_impl( graph = NULL, candidate = 1:2 @@ -8270,7 +7768,6 @@ test_that("is_separator_impl errors", { test_that("is_minimal_separator_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8290,7 +7787,6 @@ test_that("is_minimal_separator_impl basic", { test_that("is_minimal_separator_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_minimal_separator_impl( graph = NULL, candidate = 1:2 @@ -8301,7 +7797,6 @@ test_that("is_minimal_separator_impl errors", { test_that("all_minimal_st_separators_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8319,7 +7814,6 @@ test_that("all_minimal_st_separators_impl basic", { test_that("all_minimal_st_separators_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(all_minimal_st_separators_impl( graph = NULL )) @@ -8329,7 +7823,6 @@ test_that("all_minimal_st_separators_impl errors", { test_that("minimum_size_separators_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8347,7 +7840,6 @@ test_that("minimum_size_separators_impl basic", { test_that("minimum_size_separators_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(minimum_size_separators_impl( graph = NULL )) @@ -8357,7 +7849,6 @@ test_that("minimum_size_separators_impl errors", { test_that("isoclass_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8375,7 +7866,6 @@ test_that("isoclass_impl basic", { test_that("isoclass_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(isoclass_impl( graph = NULL )) @@ -8385,7 +7875,6 @@ test_that("isoclass_impl errors", { test_that("isomorphic_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8409,7 +7898,6 @@ test_that("isomorphic_impl basic", { test_that("isomorphic_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8423,7 +7911,6 @@ test_that("isomorphic_impl errors", { test_that("isoclass_subgraph_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 5 ) @@ -8443,7 +7930,6 @@ test_that("isoclass_subgraph_impl basic", { test_that("isoclass_subgraph_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(isoclass_subgraph_impl( graph = NULL, vids = 1:2 @@ -8454,7 +7940,6 @@ test_that("isoclass_subgraph_impl errors", { test_that("isoclass_create_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(isoclass_create_impl( size = 3, number = 1 @@ -8475,7 +7960,6 @@ test_that("isoclass_create_impl basic", { test_that("isoclass_create_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(isoclass_create_impl( size = "a", number = 1 @@ -8486,7 +7970,6 @@ test_that("isoclass_create_impl errors", { test_that("isomorphic_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8518,7 +8001,6 @@ test_that("isomorphic_vf2_impl basic", { test_that("isomorphic_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8535,7 +8017,6 @@ test_that("isomorphic_vf2_impl errors", { test_that("count_isomorphisms_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8567,7 +8048,6 @@ test_that("count_isomorphisms_vf2_impl basic", { test_that("count_isomorphisms_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8583,7 +8063,6 @@ test_that("count_isomorphisms_vf2_impl errors", { test_that("get_isomorphisms_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8615,7 +8094,6 @@ test_that("get_isomorphisms_vf2_impl basic", { test_that("get_isomorphisms_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8631,7 +8109,6 @@ test_that("get_isomorphisms_vf2_impl errors", { test_that("subisomorphic_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8655,7 +8132,6 @@ test_that("subisomorphic_impl basic", { test_that("subisomorphic_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8669,7 +8145,6 @@ test_that("subisomorphic_impl errors", { test_that("subisomorphic_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8701,7 +8176,6 @@ test_that("subisomorphic_vf2_impl basic", { test_that("subisomorphic_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8717,7 +8191,6 @@ test_that("subisomorphic_vf2_impl errors", { test_that("count_subisomorphisms_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8749,7 +8222,6 @@ test_that("count_subisomorphisms_vf2_impl basic", { test_that("count_subisomorphisms_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8765,7 +8237,6 @@ test_that("count_subisomorphisms_vf2_impl errors", { test_that("get_subisomorphisms_vf2_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8797,7 +8268,6 @@ test_that("get_subisomorphisms_vf2_impl basic", { test_that("get_subisomorphisms_vf2_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8813,7 +8283,6 @@ test_that("get_subisomorphisms_vf2_impl errors", { test_that("canonical_permutation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8836,7 +8305,6 @@ test_that("canonical_permutation_impl basic", { test_that("canonical_permutation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(canonical_permutation_impl( graph = NULL )) @@ -8846,7 +8314,6 @@ test_that("canonical_permutation_impl errors", { test_that("permute_vertices_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8866,7 +8333,6 @@ test_that("permute_vertices_impl basic", { test_that("permute_vertices_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(permute_vertices_impl( graph = NULL, permutation = 3:1 @@ -8877,7 +8343,6 @@ test_that("permute_vertices_impl errors", { test_that("isomorphic_bliss_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -8908,7 +8373,6 @@ test_that("isomorphic_bliss_impl basic", { test_that("isomorphic_bliss_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) graph2 <- path_graph_impl( n = 3 ) @@ -8922,7 +8386,6 @@ test_that("isomorphic_bliss_impl errors", { test_that("count_automorphisms_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8945,7 +8408,6 @@ test_that("count_automorphisms_impl basic", { test_that("count_automorphisms_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(count_automorphisms_impl( graph = NULL )) @@ -8955,7 +8417,6 @@ test_that("count_automorphisms_impl errors", { test_that("automorphism_group_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -8979,7 +8440,6 @@ test_that("automorphism_group_impl basic", { test_that("automorphism_group_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(automorphism_group_impl( graph = NULL )) @@ -8989,7 +8449,6 @@ test_that("automorphism_group_impl errors", { test_that("simplify_and_colorize_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9007,7 +8466,6 @@ test_that("simplify_and_colorize_impl basic", { test_that("simplify_and_colorize_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(simplify_and_colorize_impl( graph = NULL )) @@ -9017,7 +8475,6 @@ test_that("simplify_and_colorize_impl errors", { test_that("graph_count_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(graph_count_impl( n = 3 )) @@ -9035,7 +8492,6 @@ test_that("graph_count_impl basic", { test_that("graph_count_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(graph_count_impl( n = "a" )) @@ -9045,7 +8501,6 @@ test_that("graph_count_impl errors", { test_that("is_matching_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9070,7 +8525,6 @@ test_that("is_matching_impl basic", { test_that("is_matching_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_matching_impl( graph = NULL, matching = 1:2 @@ -9081,7 +8535,6 @@ test_that("is_matching_impl errors", { test_that("is_maximal_matching_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9106,7 +8559,6 @@ test_that("is_maximal_matching_impl basic", { test_that("is_maximal_matching_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_maximal_matching_impl( graph = NULL, matching = 1:2 @@ -9117,7 +8569,6 @@ test_that("is_maximal_matching_impl errors", { test_that("maximum_bipartite_matching_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9143,7 +8594,6 @@ test_that("maximum_bipartite_matching_impl basic", { test_that("maximum_bipartite_matching_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( maximum_bipartite_matching_impl( graph = NULL, @@ -9156,7 +8606,6 @@ test_that("maximum_bipartite_matching_impl errors", { test_that("adjacency_spectral_embedding_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9185,7 +8634,6 @@ test_that("adjacency_spectral_embedding_impl basic", { test_that("adjacency_spectral_embedding_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(adjacency_spectral_embedding_impl( graph = NULL, no = 2 @@ -9196,7 +8644,6 @@ test_that("adjacency_spectral_embedding_impl errors", { test_that("laplacian_spectral_embedding_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9216,7 +8663,6 @@ test_that("laplacian_spectral_embedding_impl basic", { test_that("laplacian_spectral_embedding_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(laplacian_spectral_embedding_impl( graph = NULL, no = 2 @@ -9227,7 +8673,6 @@ test_that("laplacian_spectral_embedding_impl errors", { test_that("eigen_adjacency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9253,7 +8698,6 @@ test_that("eigen_adjacency_impl basic", { test_that("eigen_adjacency_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(eigen_adjacency_impl( graph = NULL )) @@ -9263,7 +8707,6 @@ test_that("eigen_adjacency_impl errors", { test_that("power_law_fit_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(power_law_fit_impl( data = c(1, 2, 3) )) @@ -9282,7 +8725,6 @@ test_that("power_law_fit_impl basic", { test_that("power_law_fit_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(power_law_fit_impl( data = "a" )) @@ -9292,7 +8734,6 @@ test_that("power_law_fit_impl errors", { test_that("sir_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9320,7 +8761,6 @@ test_that("sir_impl basic", { test_that("sir_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(sir_impl( graph = NULL, beta = 0.1, @@ -9332,7 +8772,6 @@ test_that("sir_impl errors", { test_that("convex_hull_2d_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(convex_hull_2d_impl( data = matrix(1:6, ncol = 2) )) @@ -9346,7 +8785,6 @@ test_that("convex_hull_2d_impl basic", { test_that("convex_hull_2d_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(convex_hull_2d_impl( data = "a" )) @@ -9356,7 +8794,6 @@ test_that("convex_hull_2d_impl errors", { test_that("dim_select_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(dim_select_impl( sv = c(1, 2, 3) )) @@ -9370,7 +8807,6 @@ test_that("dim_select_impl basic", { test_that("dim_select_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(dim_select_impl( sv = NULL )) @@ -9380,7 +8816,6 @@ test_that("dim_select_impl errors", { test_that("solve_lsap_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(solve_lsap_impl( c = matrix(1:4, ncol = 2), n = 2 @@ -9396,7 +8831,6 @@ test_that("solve_lsap_impl basic", { test_that("solve_lsap_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(solve_lsap_impl( c = "a", n = 2 @@ -9407,7 +8841,6 @@ test_that("solve_lsap_impl errors", { test_that("find_cycle_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9429,7 +8862,6 @@ test_that("find_cycle_impl basic", { test_that("find_cycle_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(find_cycle_impl( graph = NULL )) @@ -9439,7 +8871,6 @@ test_that("find_cycle_impl errors", { test_that("simple_cycles_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9463,7 +8894,6 @@ test_that("simple_cycles_impl basic", { test_that("simple_cycles_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(simple_cycles_impl( graph = NULL )) @@ -9473,7 +8903,6 @@ test_that("simple_cycles_impl errors", { test_that("is_eulerian_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9491,7 +8920,6 @@ test_that("is_eulerian_impl basic", { test_that("is_eulerian_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_eulerian_impl( graph = NULL )) @@ -9501,7 +8929,6 @@ test_that("is_eulerian_impl errors", { test_that("eulerian_path_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9519,7 +8946,6 @@ test_that("eulerian_path_impl basic", { test_that("eulerian_path_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(eulerian_path_impl( graph = NULL )) @@ -9529,7 +8955,6 @@ test_that("eulerian_path_impl errors", { test_that("eulerian_cycle_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl( n = 3 ) @@ -9554,7 +8979,6 @@ test_that("eulerian_cycle_impl basic", { test_that("eulerian_cycle_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(eulerian_cycle_impl( graph = NULL )) @@ -9564,7 +8988,6 @@ test_that("eulerian_cycle_impl errors", { test_that("fundamental_cycles_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9590,7 +9013,6 @@ test_that("fundamental_cycles_impl basic", { test_that("fundamental_cycles_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(fundamental_cycles_impl( graph = NULL, start = 1 @@ -9601,7 +9023,6 @@ test_that("fundamental_cycles_impl errors", { test_that("minimum_cycle_basis_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9626,7 +9047,6 @@ test_that("minimum_cycle_basis_impl basic", { test_that("minimum_cycle_basis_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(minimum_cycle_basis_impl( graph = NULL )) @@ -9636,7 +9056,6 @@ test_that("minimum_cycle_basis_impl errors", { test_that("is_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9659,7 +9078,6 @@ test_that("is_tree_impl basic", { test_that("is_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_tree_impl( graph = NULL )) @@ -9669,7 +9087,6 @@ test_that("is_tree_impl errors", { test_that("is_forest_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9692,7 +9109,6 @@ test_that("is_forest_impl basic", { test_that("is_forest_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_forest_impl( graph = NULL )) @@ -9702,7 +9118,6 @@ test_that("is_forest_impl errors", { test_that("from_prufer_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(from_prufer_impl( prufer = 1:2 )) @@ -9716,7 +9131,6 @@ test_that("from_prufer_impl basic", { test_that("from_prufer_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(from_prufer_impl( prufer = "a" )) @@ -9726,7 +9140,6 @@ test_that("from_prufer_impl errors", { test_that("to_prufer_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9744,7 +9157,6 @@ test_that("to_prufer_impl basic", { test_that("to_prufer_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(to_prufer_impl( graph = NULL )) @@ -9754,7 +9166,6 @@ test_that("to_prufer_impl errors", { test_that("tree_from_parent_vector_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(tree_from_parent_vector_impl( parents = c(-1, 1, 2, 3) )) @@ -9772,7 +9183,6 @@ test_that("tree_from_parent_vector_impl basic", { test_that("tree_from_parent_vector_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(tree_from_parent_vector_impl( parents = "a" )) @@ -9782,7 +9192,6 @@ test_that("tree_from_parent_vector_impl errors", { test_that("is_complete_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9800,7 +9209,6 @@ test_that("is_complete_impl basic", { test_that("is_complete_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_complete_impl( graph = NULL )) @@ -9810,7 +9218,6 @@ test_that("is_complete_impl errors", { test_that("random_spanning_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9830,7 +9237,6 @@ test_that("random_spanning_tree_impl basic", { test_that("random_spanning_tree_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(random_spanning_tree_impl( graph = NULL, vid = 1 @@ -9841,7 +9247,6 @@ test_that("random_spanning_tree_impl errors", { test_that("tree_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(tree_game_impl( n = 3 )) @@ -9860,7 +9265,6 @@ test_that("tree_game_impl basic", { test_that("tree_game_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(tree_game_impl( n = "a" )) @@ -9870,7 +9274,6 @@ test_that("tree_game_impl errors", { test_that("vertex_coloring_greedy_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9892,7 +9295,6 @@ test_that("vertex_coloring_greedy_impl basic", { test_that("vertex_coloring_greedy_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(vertex_coloring_greedy_impl( graph = NULL )) @@ -9902,7 +9304,6 @@ test_that("vertex_coloring_greedy_impl errors", { test_that("is_vertex_coloring_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9922,7 +9323,6 @@ test_that("is_vertex_coloring_impl basic", { test_that("is_vertex_coloring_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( is_vertex_coloring_impl( graph = NULL, @@ -9945,7 +9345,6 @@ test_that("is_vertex_coloring_impl errors", { test_that("is_bipartite_coloring_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -9965,7 +9364,6 @@ test_that("is_bipartite_coloring_impl basic", { test_that("is_bipartite_coloring_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( is_bipartite_coloring_impl( graph = NULL, @@ -9978,7 +9376,6 @@ test_that("is_bipartite_coloring_impl errors", { test_that("is_edge_coloring_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10002,7 +9399,6 @@ test_that("is_edge_coloring_impl basic", { test_that("is_edge_coloring_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_edge_coloring_impl( graph = NULL, types = c(1, 2) @@ -10013,7 +9409,6 @@ test_that("is_edge_coloring_impl errors", { test_that("deterministic_optimal_imitation_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10045,7 +9440,6 @@ test_that("deterministic_optimal_imitation_impl basic", { test_that("deterministic_optimal_imitation_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( deterministic_optimal_imitation_impl( graph = NULL, @@ -10060,7 +9454,6 @@ test_that("deterministic_optimal_imitation_impl errors", { test_that("moran_process_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10086,7 +9479,6 @@ test_that("moran_process_impl basic", { test_that("moran_process_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( moran_process_impl( graph = NULL, @@ -10100,7 +9492,6 @@ test_that("moran_process_impl errors", { test_that("roulette_wheel_imitation_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10134,7 +9525,6 @@ test_that("roulette_wheel_imitation_impl basic", { test_that("roulette_wheel_imitation_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( roulette_wheel_imitation_impl( graph = NULL, @@ -10150,7 +9540,6 @@ test_that("roulette_wheel_imitation_impl errors", { test_that("stochastic_imitation_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10184,7 +9573,6 @@ test_that("stochastic_imitation_impl basic", { test_that("stochastic_imitation_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( stochastic_imitation_impl( graph = NULL, @@ -10200,7 +9588,6 @@ test_that("stochastic_imitation_impl errors", { test_that("invalidate_cache_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10218,7 +9605,6 @@ test_that("invalidate_cache_impl basic", { test_that("invalidate_cache_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(invalidate_cache_impl( graph = NULL )) @@ -10228,7 +9614,6 @@ test_that("invalidate_cache_impl errors", { test_that("vertex_path_from_edge_path_impl basic", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) g <- path_graph_impl( n = 3 ) @@ -10256,7 +9641,6 @@ test_that("vertex_path_from_edge_path_impl basic", { test_that("vertex_path_from_edge_path_impl errors", { withr::local_seed(12345) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error( vertex_path_from_edge_path_impl( graph = NULL, @@ -10294,7 +9678,6 @@ test_that("version_impl errors", { test_that("ecount_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_empty_graph(5) expect_snapshot(ecount_impl( graph = g @@ -10308,7 +9691,6 @@ test_that("ecount_impl basic", { test_that("ecount_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(ecount_impl( graph = NULL )) @@ -10318,7 +9700,6 @@ test_that("ecount_impl errors", { test_that("is_directed_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_empty_graph(5, directed = TRUE) expect_snapshot(is_directed_impl( graph = g @@ -10332,7 +9713,6 @@ test_that("is_directed_impl basic", { test_that("is_directed_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(is_directed_impl( graph = NULL )) @@ -10342,7 +9722,6 @@ test_that("is_directed_impl errors", { test_that("edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 4), n = 4, directed = TRUE) # Get all edges @@ -10360,7 +9739,6 @@ test_that("edges_impl basic", { test_that("edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(edges_impl( graph = NULL, eids = 1 @@ -10371,7 +9749,6 @@ test_that("edges_impl errors", { test_that("add_vertices_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_empty_graph(3) g_new <- add_vertices_impl( @@ -10383,7 +9760,6 @@ test_that("add_vertices_impl basic", { test_that("add_vertices_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(add_vertices_impl( graph = NULL, nv = 1 @@ -10394,7 +9770,6 @@ test_that("add_vertices_impl errors", { test_that("delete_edges_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 4), n = 4, directed = TRUE) g_new <- delete_edges_impl( @@ -10406,7 +9781,6 @@ test_that("delete_edges_impl basic", { test_that("delete_edges_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(delete_edges_impl( graph = NULL, edges = 1 @@ -10417,7 +9791,6 @@ test_that("delete_edges_impl errors", { test_that("delete_vertices_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 4), n = 4, directed = TRUE) g_new <- delete_vertices_impl( @@ -10429,7 +9802,6 @@ test_that("delete_vertices_impl basic", { test_that("delete_vertices_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(delete_vertices_impl( graph = NULL, vertices = 1 @@ -10440,7 +9812,7 @@ test_that("delete_vertices_impl errors", { test_that("incident_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE, return.vs_es = FALSE) + local_igraph_options(return.vs_es = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 1), n = 3, directed = TRUE) expect_snapshot(incident_impl( @@ -10462,7 +9834,6 @@ test_that("incident_impl basic", { test_that("incident_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(incident_impl( graph = NULL, vid = 1 @@ -10471,7 +9842,6 @@ test_that("incident_impl errors", { test_that("famous_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(famous_impl( name = "Zachary" )) @@ -10479,7 +9849,6 @@ test_that("famous_impl basic", { test_that("famous_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(famous_impl( name = "NonexistentGraph" )) @@ -10489,7 +9858,6 @@ test_that("famous_impl errors", { test_that("constraint_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 1), n = 3, directed = FALSE) result <- constraint_impl( graph = g @@ -10499,7 +9867,6 @@ test_that("constraint_impl basic", { test_that("constraint_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(constraint_impl( graph = NULL )) @@ -10509,7 +9876,6 @@ test_that("constraint_impl errors", { test_that("cocitation_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 1, 3, 2, 4, 3, 4), n = 4, directed = TRUE) result <- cocitation_impl( graph = g @@ -10519,7 +9885,6 @@ test_that("cocitation_impl basic", { test_that("cocitation_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(cocitation_impl( graph = NULL )) @@ -10529,7 +9894,6 @@ test_that("cocitation_impl errors", { test_that("bibcoupling_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 1, 3, 2, 4, 3, 4), n = 4, directed = TRUE) result <- bibcoupling_impl( graph = g @@ -10539,7 +9903,6 @@ test_that("bibcoupling_impl basic", { test_that("bibcoupling_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(bibcoupling_impl( graph = NULL )) @@ -10549,7 +9912,6 @@ test_that("bibcoupling_impl errors", { test_that("girth_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) result <- girth_impl( graph = g @@ -10559,7 +9921,6 @@ test_that("girth_impl basic", { test_that("girth_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(girth_impl( graph = NULL )) @@ -10569,7 +9930,6 @@ test_that("girth_impl errors", { test_that("coreness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(c(1, 2, 2, 3, 3, 1, 3, 4), n = 4, directed = FALSE) expect_snapshot(coreness_impl( graph = g @@ -10578,7 +9938,6 @@ test_that("coreness_impl basic", { test_that("coreness_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(coreness_impl( graph = NULL )) @@ -10588,7 +9947,6 @@ test_that("coreness_impl errors", { test_that("union_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_graph(c(1, 2, 2, 3), n = 3) g2 <- make_graph(c(1, 3, 3, 4), n = 4) expect_snapshot(union_impl( @@ -10599,7 +9957,6 @@ test_that("union_impl basic", { test_that("union_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(union_impl( left = NULL, right = NULL @@ -10610,7 +9967,6 @@ test_that("union_impl errors", { test_that("intersection_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_graph(c(1, 2, 2, 3, 1, 3), n = 3) g2 <- make_graph(c(1, 2, 2, 3), n = 3) expect_snapshot(intersection_impl( @@ -10621,7 +9977,6 @@ test_that("intersection_impl basic", { test_that("intersection_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(intersection_impl( left = NULL, right = NULL @@ -10635,7 +9990,6 @@ test_that("intersection_impl errors", { test_that("star_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(star_impl(n = 5, mode = "out", center = 0)) expect_snapshot(star_impl(n = 6, mode = "in", center = 1)) expect_snapshot(star_impl(n = 4, mode = "undirected", center = 0)) @@ -10643,7 +9997,6 @@ test_that("star_impl basic", { test_that("ring_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(ring_impl( n = 5, directed = FALSE, @@ -10660,14 +10013,12 @@ test_that("ring_impl basic", { test_that("full_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(full_impl(n = 4, directed = FALSE, loops = FALSE)) expect_snapshot(full_impl(n = 3, directed = TRUE, loops = FALSE)) }) test_that("kary_tree_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(kary_tree_impl( n = 7, children = 2, @@ -10684,7 +10035,6 @@ test_that("kary_tree_impl basic", { test_that("barabasi_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(barabasi_game_impl( n = 10, power = 1, @@ -10703,7 +10053,6 @@ test_that("barabasi_game_impl basic", { test_that("growing_random_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(growing_random_game_impl( n = 10, m = 1, @@ -10714,13 +10063,11 @@ test_that("growing_random_game_impl basic", { test_that("grg_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(grg_game_impl(nodes = 10, radius = 0.3, torus = FALSE)) }) test_that("watts_strogatz_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(watts_strogatz_game_impl( dim = 1, size = 10, @@ -10733,7 +10080,6 @@ test_that("watts_strogatz_game_impl basic", { test_that("distances_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(distances_impl( graph = g, @@ -10745,7 +10091,6 @@ test_that("distances_impl basic", { test_that("diameter_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(10) expect_snapshot(diameter_impl( graph = g, @@ -10756,7 +10101,6 @@ test_that("diameter_impl basic", { test_that("get_shortest_paths_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(get_shortest_paths_impl( graph = g, @@ -10768,7 +10112,6 @@ test_that("get_shortest_paths_impl basic", { test_that("subcomponent_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A-B-C, D-E-F) expect_snapshot(subcomponent_impl( graph = g, @@ -10781,14 +10124,12 @@ test_that("subcomponent_impl basic", { test_that("betweenness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") expect_snapshot(betweenness_impl(graph = g, vids = V(g), directed = FALSE)) }) test_that("closeness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(closeness_impl( graph = g, @@ -10799,7 +10140,6 @@ test_that("closeness_impl basic", { test_that("harmonic_centrality_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") expect_snapshot(harmonic_centrality_impl( graph = g, @@ -10810,7 +10150,6 @@ test_that("harmonic_centrality_impl basic", { test_that("pagerank_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5, directed = TRUE) expect_snapshot(pagerank_impl( graph = g, @@ -10822,7 +10161,6 @@ test_that("pagerank_impl basic", { test_that("hub_score_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") out <- hub_score_impl(graph = g, scale = TRUE, weights = NULL) # FIXME: out$vector unstable despite random seed @@ -10834,7 +10172,6 @@ test_that("hub_score_impl basic", { test_that("authority_score_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") out <- authority_score_impl(graph = g, scale = TRUE, weights = NULL) # FIXME: out$vector unstable despite random seed @@ -10848,28 +10185,24 @@ test_that("authority_score_impl basic", { test_that("community_walktrap_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A-B-C-A, D-E-F-D, A-D) expect_snapshot(community_walktrap_impl(graph = g, steps = 4)) }) test_that("community_fastgreedy_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A-B-C-A, D-E-F-D, A-D) expect_snapshot(community_fastgreedy_impl(graph = g)) }) test_that("community_edge_betweenness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A-B-C-A, D-E-F-D, A-D) expect_snapshot(community_edge_betweenness_impl(graph = g, directed = FALSE)) }) test_that("community_leading_eigenvector_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Test with a simple graph g <- make_graph("Zachary") @@ -10900,7 +10233,6 @@ test_that("community_leading_eigenvector_callback_closure_impl basic", { test_that("community_leading_eigenvector_callback_closure_impl with start", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph("Zachary") # Create initial membership (0-based for the impl function) @@ -10926,7 +10258,6 @@ test_that("community_leading_eigenvector_callback_closure_impl with start", { test_that("community_leading_eigenvector_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph("Zachary") @@ -10943,14 +10274,12 @@ test_that("community_leading_eigenvector_callback_closure_impl errors", { test_that("edge_connectivity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(edge_connectivity_impl(graph = g)) }) test_that("vertex_connectivity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(vertex_connectivity_impl(graph = g)) }) @@ -10959,7 +10288,6 @@ test_that("vertex_connectivity_impl basic", { test_that("layout_sphere_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(layout_sphere_impl(graph = g)) }) @@ -10968,7 +10296,6 @@ test_that("layout_sphere_impl basic", { test_that("create_bipartite_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(create_bipartite_impl( types = c(FALSE, FALSE, TRUE, TRUE), edges = c(0, 2, 0, 3, 1, 2, 1, 3), @@ -10978,7 +10305,6 @@ test_that("create_bipartite_impl basic", { test_that("bipartite_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(bipartite_game_impl( type = "gnp", n1 = 5, @@ -10999,14 +10325,12 @@ test_that("bipartite_game_impl basic", { test_that("decompose_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A-B-C, D-E) expect_snapshot(decompose_impl(graph = g, mode = c("weak", "strong"))) }) test_that("neighborhood_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(neighborhood_impl( graph = g, @@ -11018,7 +10342,6 @@ test_that("neighborhood_impl basic", { test_that("neighborhood_size_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(neighborhood_size_impl( graph = g, @@ -11032,7 +10355,6 @@ test_that("neighborhood_size_impl basic", { test_that("is_chordal_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Test with a chordal graph (complete graph is chordal) g <- make_full_graph(4) # alpha and alpham1 parameters must be provided as vectors matching vertex count @@ -11058,7 +10380,6 @@ test_that("is_chordal_impl basic", { test_that("get_adjacency_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(3) expect_snapshot(get_adjacency_impl( graph = g, @@ -11070,7 +10391,6 @@ test_that("get_adjacency_impl basic", { test_that("write_graph_edgelist_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(3) tmp <- tempfile() write_graph_edgelist_impl(graph = g, outstream = tmp) @@ -11081,7 +10401,6 @@ test_that("write_graph_edgelist_impl basic", { test_that("read_graph_edgelist_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) tmp <- tempfile() writeLines(c("0 1", "1 2", "2 0"), tmp) expect_snapshot(read_graph_edgelist_impl( @@ -11096,7 +10415,6 @@ test_that("read_graph_edgelist_impl basic", { test_that("compare_communities_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) comm1 <- c(1, 1, 2, 2, 3, 3) comm2 <- c(1, 1, 2, 2, 2, 3) expect_snapshot(compare_communities_impl( @@ -11110,7 +10428,6 @@ test_that("compare_communities_impl basic", { test_that("degree_sequence_game_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot(degree_sequence_game_impl( out_deg = c(2, 2, 2, 2), method = "configuration" @@ -11123,7 +10440,6 @@ test_that("degree_sequence_game_impl basic", { test_that("connect_neighborhood_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot_igraph(connect_neighborhood_impl( graph = g, @@ -11136,7 +10452,6 @@ test_that("connect_neighborhood_impl basic", { test_that("eccentricity_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(eccentricity_impl( graph = g, @@ -11147,21 +10462,18 @@ test_that("eccentricity_impl basic", { test_that("radius_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(radius_impl(graph = g, mode = c("out", "in", "all"))) }) test_that("graph_center_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") expect_snapshot(graph_center_impl(graph = g, mode = c("out", "in", "all"))) }) test_that("voronoi_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(10) expect_snapshot(voronoi_impl( graph = g, @@ -11174,7 +10486,6 @@ test_that("voronoi_impl basic", { test_that("spanner_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(spanner_impl(graph = g, stretch = 2)) }) @@ -11183,7 +10494,6 @@ test_that("spanner_impl basic", { test_that("edge_betweenness_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_star(5, mode = "undirected") expect_snapshot(edge_betweenness_impl(graph = g, directed = FALSE)) }) @@ -11192,14 +10502,12 @@ test_that("edge_betweenness_impl basic", { test_that("maximal_cliques_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(4) expect_snapshot(maximal_cliques_impl(graph = g, min_size = 1, max_size = 0)) }) test_that("independent_vertex_sets_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(5) expect_snapshot(independent_vertex_sets_impl( graph = g, @@ -11214,7 +10522,6 @@ test_that("independent_vertex_sets_impl basic", { test_that("bfs_closure_impl works", { withr::local_seed(20250125) - local_igraph_options(print.id = FALSE) g <- make_ring(10) @@ -11288,7 +10595,6 @@ test_that("bfs_closure_impl works", { test_that("dfs_closure_impl works", { withr::local_seed(20250125) - local_igraph_options(print.id = FALSE) g <- make_ring(10) @@ -11330,7 +10636,6 @@ test_that("dfs_closure_impl works", { test_that("motifs_randesu_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A - B - C - A) @@ -11368,7 +10673,6 @@ test_that("motifs_randesu_callback_closure_impl basic", { test_that("motifs_randesu_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_graph(~ A - B - C) @@ -11387,7 +10691,6 @@ test_that("motifs_randesu_callback_closure_impl errors", { test_that("cliques_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(4) @@ -11421,7 +10724,6 @@ test_that("cliques_callback_closure_impl basic", { test_that("cliques_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(4) @@ -11440,7 +10742,6 @@ test_that("cliques_callback_closure_impl errors", { test_that("maximal_cliques_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- sample_gnp(10, 0.3) @@ -11477,7 +10778,6 @@ test_that("maximal_cliques_callback_closure_impl basic", { test_that("maximal_cliques_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_full_graph(4) @@ -11496,7 +10796,6 @@ test_that("maximal_cliques_callback_closure_impl errors", { test_that("simple_cycles_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(4, directed = TRUE) @@ -11534,7 +10833,6 @@ test_that("simple_cycles_callback_closure_impl basic", { test_that("simple_cycles_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- make_ring(4, directed = TRUE) @@ -11554,7 +10852,6 @@ test_that("simple_cycles_callback_closure_impl errors", { test_that("get_isomorphisms_vf2_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_ring(5) g2 <- make_ring(5) @@ -11599,7 +10896,6 @@ test_that("get_isomorphisms_vf2_callback_closure_impl basic", { test_that("get_isomorphisms_vf2_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_ring(5) g2 <- make_ring(5) @@ -11622,7 +10918,6 @@ test_that("get_isomorphisms_vf2_callback_closure_impl errors", { test_that("get_subisomorphisms_vf2_callback_closure_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_full_graph(5) g2 <- make_ring(3) # triangle @@ -11667,7 +10962,6 @@ test_that("get_subisomorphisms_vf2_callback_closure_impl basic", { test_that("get_subisomorphisms_vf2_callback_closure_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- make_ring(3) g2 <- make_full_graph(5) @@ -11691,7 +10985,6 @@ test_that("get_subisomorphisms_vf2_callback_closure_impl errors", { test_that("sparse_adjacency_impl basic", { skip_if_not_installed("Matrix") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Create a simple sparse matrix M <- Matrix::sparseMatrix( @@ -11736,7 +11029,6 @@ test_that("sparse_adjacency_impl errors", { skip_if_not_installed("Matrix") skip_if_not(getRversion() >= "4.2") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Regular matrices are converted to sparse matrices automatically # This should work, not error @@ -11749,7 +11041,6 @@ test_that("sparse_adjacency_impl errors", { test_that("sparse_weighted_adjacency_impl basic", { skip_if_not_installed("Matrix") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Create a weighted sparse matrix M <- Matrix::sparseMatrix( @@ -11790,7 +11081,6 @@ test_that("sparse_weighted_adjacency_impl errors", { skip_if_not_installed("Matrix") skip_if_not(getRversion() >= "4.2") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Regular matrices are converted to sparse matrices automatically # This should work, not error @@ -11804,7 +11094,6 @@ test_that("sparse_weighted_adjacency_impl errors", { test_that("weighted_sparsemat_impl basic", { skip_if_not_installed("Matrix") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Create a weighted sparse matrix M <- Matrix::sparseMatrix( @@ -11839,7 +11128,6 @@ test_that("weighted_sparsemat_impl errors", { skip_if_not_installed("Matrix") skip_if_not(getRversion() >= "4.2") withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Regular matrices are converted to sparse matrices automatically # This should work, not error @@ -11856,7 +11144,6 @@ test_that("weighted_sparsemat_impl errors", { test_that("disjoint_union_many_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- empty_impl(n = 2) g2 <- empty_impl(n = 3) g3 <- empty_impl(n = 1) @@ -11875,7 +11162,6 @@ test_that("disjoint_union_many_impl basic", { test_that("union_many_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- empty_impl(n = 3) g2 <- add_edges_impl(g1, c(0, 1, 1, 2) + 1) g3 <- add_edges_impl(g1, c(0, 2) + 1) @@ -11894,7 +11180,6 @@ test_that("union_many_impl basic", { test_that("intersection_many_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- add_edges_impl(empty_impl(n = 3), c(0, 1, 1, 2, 0, 2) + 1) g2 <- add_edges_impl(empty_impl(n = 3), c(0, 1, 1, 2) + 1) g3 <- add_edges_impl(empty_impl(n = 3), c(0, 1) + 1) @@ -11913,7 +11198,6 @@ test_that("intersection_many_impl basic", { test_that("layout_merge_dla_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g1 <- path_graph_impl(n = 3) g2 <- path_graph_impl(n = 3) coords1 <- matrix(c(0, 0, 1, 0, 2, 0), ncol = 2, byrow = TRUE) @@ -11937,7 +11221,6 @@ test_that("layout_merge_dla_impl basic", { # get_eid_impl test_that("get_eid_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- add_edges_impl(empty_impl(n = 5), c(0, 1, 1, 2, 2, 3, 3, 4) + 1) expect_snapshot(get_eid_impl( @@ -11973,7 +11256,6 @@ test_that("get_eid_impl basic", { test_that("get_eid_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- add_edges_impl(empty_impl(n = 3), c(0, 1, 1, 2) + 1) expect_snapshot_igraph_error(get_eid_impl( @@ -11999,7 +11281,6 @@ test_that("get_eid_impl errors", { # community_voronoi_impl test_that("community_voronoi_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- add_edges_impl( empty_impl(n = 10), c(0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9) + 1 @@ -12022,7 +11303,6 @@ test_that("community_voronoi_impl basic", { test_that("community_voronoi_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) expect_snapshot_igraph_error(community_voronoi_impl( graph = NULL @@ -12032,7 +11312,6 @@ test_that("community_voronoi_impl errors", { # subisomorphic_lad_impl test_that("subisomorphic_lad_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: Add functionality tests once we understand the expected behavior # The function requires complex setup with pattern/target graphs and domains @@ -12046,7 +11325,6 @@ test_that("subisomorphic_lad_impl basic", { test_that("subisomorphic_lad_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) g <- add_edges_impl(empty_impl(n = 3), c(0, 1, 1, 2) + 1) expect_snapshot_igraph_error(subisomorphic_lad_impl( @@ -12070,7 +11348,6 @@ test_that("subisomorphic_lad_impl errors", { # eigen_matrix_impl test_that("eigen_matrix_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: Add functionality tests once we understand the expected behavior # The function requires complex matrix setup and understanding of eigenvalue computation @@ -12084,7 +11361,6 @@ test_that("eigen_matrix_impl basic", { test_that("eigen_matrix_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Test with invalid matrix dimensions expect_error(eigen_matrix_impl( @@ -12100,7 +11376,6 @@ test_that("eigen_matrix_impl errors", { # eigen_matrix_symmetric_impl test_that("eigen_matrix_symmetric_impl basic", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # FIXME: Add functionality tests once we understand the expected behavior # The function requires complex matrix setup and understanding of eigenvalue computation @@ -12114,7 +11389,6 @@ test_that("eigen_matrix_symmetric_impl basic", { test_that("eigen_matrix_symmetric_impl errors", { withr::local_seed(20250909) - local_igraph_options(print.id = FALSE) # Test with invalid matrix dimensions expect_error(eigen_matrix_symmetric_impl( diff --git a/tests/testthat/test-adjacency.R b/tests/testthat/test-adjacency.R index 56ff4d3d2d1..809009faeab 100644 --- a/tests/testthat/test-adjacency.R +++ b/tests/testthat/test-adjacency.R @@ -646,7 +646,6 @@ test_that("graph_from_adjacency_matrix() works -- dgCMatrix", { test_that("graph_from_adjacency_matrix() snapshot", { rlang::local_options(lifecycle_verbosity = "warning") - local_igraph_options(print.id = FALSE) expect_false(igraph_opt("print.id")) expect_snapshot({ @@ -677,7 +676,6 @@ test_that("graph_from_adjacency_matrix() snapshot for sparse matrices", { rlang::local_options(lifecycle_verbosity = "warning") - local_igraph_options(print.id = FALSE) expect_false(igraph_opt("print.id")) expect_snapshot({ diff --git a/tests/testthat/test-conversion.R b/tests/testthat/test-conversion.R index a497f9e4f82..01aab821ad0 100644 --- a/tests/testthat/test-conversion.R +++ b/tests/testthat/test-conversion.R @@ -45,14 +45,12 @@ test_that("as_directed keeps attributes", { }) test_that("as.directed() deprecation", { - local_igraph_options(print.id = FALSE) g <- sample_gnp(100, 2 / 100) expect_snapshot(is_directed(as.directed(g, mode = "mutual"))) }) test_that("as.undirected() deprecation", { - local_igraph_options(print.id = FALSE) g <- sample_gnp(100, 2 / 100) expect_snapshot(is_directed(as.undirected(g, mode = "collapse"))) diff --git a/tests/testthat/test-foreign.R b/tests/testthat/test-foreign.R index 4f2af7560c7..c97c8a096ee 100644 --- a/tests/testthat/test-foreign.R +++ b/tests/testthat/test-foreign.R @@ -27,7 +27,6 @@ test_that("reading GraphML file works", { }) test_that("reading graph in NCOL format", { - local_igraph_options(print.id = FALSE) ncol_path <- withr::local_tempfile(pattern = "testfile", fileext = ".ncol") g <- make_graph(c(1, 2, 2, 3)) @@ -36,7 +35,6 @@ test_that("reading graph in NCOL format", { }) test_that("reading graph in LGL format", { - local_igraph_options(print.id = FALSE) lgl_path <- withr::local_tempfile(pattern = "testfile", fileext = ".lgl") g <- make_graph(c(1, 2, 2, 3)) @@ -45,7 +43,6 @@ test_that("reading graph in LGL format", { }) test_that("reading graph, unused argument", { - local_igraph_options(print.id = FALSE) lgl_path <- withr::local_tempfile(pattern = "testfile", fileext = ".lgl") g <- make_graph(c(1, 2, 2, 3)) diff --git a/tests/testthat/test-games.R b/tests/testthat/test-games.R index 6400837cbdd..f06cfc8835d 100644 --- a/tests/testthat/test-games.R +++ b/tests/testthat/test-games.R @@ -393,7 +393,6 @@ test_that("sample_bipartite works -- undirected gnp", { }) test_that("sample_bipartite works -- directed gnp", { - local_igraph_options(print.style = "classic") g_rand_bip_dir <- sample_bipartite_gnp(10, 5, p = 0.1, directed = TRUE) expect_vcount(g_rand_bip_dir, 15) expect_ecount(g_rand_bip_dir, 6) @@ -419,7 +418,6 @@ test_that("sample_bipartite works -- undirected gnm", { expect_false(is_directed(g_rand_bip_gnm)) }) test_that("sample_bipartite works -- directed gnm", { - local_igraph_options(print.style = "classic") g_rand_bip_gnm_dir <- sample_bipartite_gnm(10, 5, m = 8, directed = TRUE) expect_vcount(g_rand_bip_gnm_dir, 15) expect_ecount(g_rand_bip_gnm_dir, 8) diff --git a/tests/testthat/test-incidence.R b/tests/testthat/test-incidence.R index 68b5fb34d03..e479ae76dec 100644 --- a/tests/testthat/test-incidence.R +++ b/tests/testthat/test-incidence.R @@ -1,5 +1,4 @@ test_that("graph_from_biadjacency_matrix() works -- dense", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:1, 15, repl = TRUE), 3, 5) @@ -17,7 +16,6 @@ test_that("graph_from_biadjacency_matrix() works -- dense", { test_that("graph_from_biadjacency_matrix() works -- dense + multiple", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:2, 15, repl = TRUE), 3, 5) @@ -30,7 +28,6 @@ test_that("graph_from_biadjacency_matrix() works -- dense + multiple", { test_that("graph_from_biadjacency_matrix() works - dense, modes", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:1, 15, repl = TRUE), 3, 5) @@ -57,7 +54,6 @@ test_that("graph_from_biadjacency_matrix() works - dense, modes", { }) test_that("graph_from_biadjacency_matrix() works - dense, modes, weighted", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:2, 15, repl = TRUE), 3, 5) @@ -110,7 +106,6 @@ test_that("graph_from_biadjacency_matrix() works - dense, modes, weighted", { }) test_that("graph_from_biadjacency_matrix() works -- sparse", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:1, 15, repl = TRUE), 3, 5) @@ -128,7 +123,6 @@ test_that("graph_from_biadjacency_matrix() works -- sparse", { }) test_that("graph_from_biadjacency_matrix() works -- sparse + multiple", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:2, 15, repl = TRUE), 3, 5) @@ -141,7 +135,6 @@ test_that("graph_from_biadjacency_matrix() works -- sparse + multiple", { }) test_that("graph_from_biadjacency_matrix() works - sparse, modes", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:1, 15, repl = TRUE), 3, 5) @@ -169,7 +162,6 @@ test_that("graph_from_biadjacency_matrix() works - sparse, modes", { }) test_that("graph_from_biadjacency_matrix() works - sparse, modes, weighted", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) inc <- matrix(sample(0:2, 15, repl = TRUE), 3, 5) diff --git a/tests/testthat/test-iterators.R b/tests/testthat/test-iterators.R index 4f1c792b084..e7b83c017a4 100644 --- a/tests/testthat/test-iterators.R +++ b/tests/testthat/test-iterators.R @@ -325,7 +325,6 @@ test_that("both edge and vertex names", { }) test_that("printing connected vs/es works", { - local_igraph_options(print.id = FALSE) g <- make_ring(10) vs <- V(g) @@ -345,7 +344,6 @@ test_that("printing connected vs/es works", { }) test_that("printing named connected vs/es works", { - local_igraph_options(print.id = FALSE) g <- make_ring(10) V(g)$name <- letters[1:10] @@ -366,7 +364,6 @@ test_that("printing named connected vs/es works", { }) test_that("printing unconnected vs/es works", { - local_igraph_options(print.id = FALSE) g <- make_ring(10) vs <- V(g) diff --git a/tests/testthat/test-make.R b/tests/testthat/test-make.R index 024f93b3c3e..245ee149e93 100644 --- a/tests/testthat/test-make.R +++ b/tests/testthat/test-make.R @@ -66,7 +66,6 @@ test_that("we pass arguments unevaluated", { }) test_that("graph_from_literal() and simple undirected graphs", { - local_igraph_options(print.id = FALSE) expect_snapshot({ graph_from_literal(A - B) graph_from_literal(A - B - C) @@ -75,7 +74,6 @@ test_that("graph_from_literal() and simple undirected graphs", { }) test_that("graph_from_literal() and undirected explosion", { - local_igraph_options(print.id = FALSE) expect_snapshot({ graph_from_literal(A:B:C - D:E, B:D - C:E) graph_from_literal(A:B:C - D:E - F:G:H - I - J:K:L:M) @@ -83,7 +81,6 @@ test_that("graph_from_literal() and undirected explosion", { }) test_that("graph_from_literal() and simple directed graphs", { - local_igraph_options(print.id = FALSE) expect_snapshot({ graph_from_literal(A -+ B) graph_from_literal(A -+ B -+ C) @@ -93,7 +90,6 @@ test_that("graph_from_literal() and simple directed graphs", { }) test_that("graph_from_literal() and directed explosion", { - local_igraph_options(print.id = FALSE) expect_snapshot({ graph_from_literal(A:B:C -+ D:E, B:D +- C:E) graph_from_literal(A:B:C -+ D:E +- F:G:H -+ I +- J:K:L:M) @@ -101,7 +97,6 @@ test_that("graph_from_literal() and directed explosion", { }) test_that("graph_from_literal(simplify = FALSE)", { - local_igraph_options(print.id = FALSE) expect_snapshot({ graph_from_literal(1 - 1, 1 - 2, 1 - 2) graph_from_literal(1 - 1, 1 - 2, 1 - 2, simplify = FALSE) diff --git a/tests/testthat/test-other.R b/tests/testthat/test-other.R index 533835127ee..b008b8fdf0c 100644 --- a/tests/testthat/test-other.R +++ b/tests/testthat/test-other.R @@ -49,7 +49,6 @@ test_that("R help contains guarantee on number of RNG bits", { }) test_that("serialization works", { - local_igraph_options(print.id = FALSE) g <- make_ring(3, directed = TRUE) gs <- unserialize(serialize(g, NULL)) diff --git a/tests/testthat/test-print.R b/tests/testthat/test-print-classic.R similarity index 89% rename from tests/testthat/test-print.R rename to tests/testthat/test-print-classic.R index 70362ad1995..58af98b70f1 100644 --- a/tests/testthat/test-print.R +++ b/tests/testthat/test-print-classic.R @@ -1,5 +1,5 @@ test_that("print.igraph() works", { - local_igraph_options(print.full = TRUE, print.style = "classic") + local_igraph_options(print.full = TRUE) withr::local_options(width = 76) g <- make_ring(5) @@ -72,7 +72,7 @@ test_that("print.igraph() works", { }) test_that("print.igraph() respects max.print for adjacency list formats", { - local_igraph_options(print.full = TRUE, print.style = "classic") + local_igraph_options(print.full = TRUE) withr::local_options(width = 76, max.print = 3) g <- make_full_graph(6) @@ -98,7 +98,7 @@ test_that("print.igraph() respects max.print for adjacency list formats", { }) test_that("print.igraph() omits no message when vcount <= max.print", { - local_igraph_options(print.full = TRUE, print.style = "classic") + local_igraph_options(print.full = TRUE) withr::local_options(width = 76, max.print = 10) g <- make_full_graph(6) @@ -111,7 +111,7 @@ test_that("print.igraph() omits no message when vcount <= max.print", { }) test_that("print.igraph() respects max.print in the adjlist wrapping branch", { - local_igraph_options(print.full = TRUE, print.style = "classic") + local_igraph_options(print.full = TRUE) withr::local_options(width = 40, max.print = 2) g <- make_full_graph(20) @@ -129,7 +129,6 @@ test_that("print.igraph() respects max.print in the adjlist wrapping branch", { }) test_that("print.igraph.es() uses vertex names", { - local_igraph_options(print.id = FALSE, print.style = "classic") g <- make_directed_graph(c("A", "B")) expect_snapshot({ @@ -139,7 +138,6 @@ test_that("print.igraph.es() uses vertex names", { test_that("vs printing", { - local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -156,7 +154,6 @@ test_that("vs printing", { }) test_that("vs printing, complex attributes", { - local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -172,7 +169,6 @@ test_that("vs printing, complex attributes", { }) test_that("es printing", { - local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) @@ -187,7 +183,6 @@ test_that("es printing", { }) test_that("es printing, complex attributes", { - local_igraph_options(print.id = FALSE, print.style = "classic") local_rng_version("3.5.0") withr::local_seed(42) diff --git a/tests/testthat/test-print-cli.R b/tests/testthat/test-print-cli.R index bbb6fd055a4..8a22b526c29 100644 --- a/tests/testthat/test-print-cli.R +++ b/tests/testthat/test-print-cli.R @@ -1,5 +1,5 @@ test_that("cli print.igraph: undirected unnamed ring", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(5) expect_snapshot(print(g)) @@ -7,7 +7,7 @@ test_that("cli print.igraph: undirected unnamed ring", { }) test_that("cli print.igraph: directed named weighted", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -18,7 +18,7 @@ test_that("cli print.igraph: directed named weighted", { }) test_that("cli print.igraph: bipartite", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_bipartite_graph( types = c(FALSE, FALSE, TRUE, TRUE), @@ -28,7 +28,7 @@ test_that("cli print.igraph: bipartite", { }) test_that("cli print.igraph: empty graph has no edges section", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) expect_snapshot(print(make_empty_graph(0))) expect_snapshot(print(make_empty_graph(3, directed = FALSE))) @@ -37,7 +37,6 @@ test_that("cli print.igraph: empty graph has no edges section", { test_that("cli print.igraph: full mode with all attribute sections", { local_igraph_options( print.style = "cli", - print.id = FALSE, print.full = TRUE, print.graph.attributes = TRUE, print.vertex.attributes = TRUE, @@ -52,7 +51,7 @@ test_that("cli print.igraph: full mode with all attribute sections", { }) test_that("cli print.igraph.vs: single and double bracket", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -66,7 +65,7 @@ test_that("cli print.igraph.vs: single and double bracket", { }) test_that("cli print.igraph.es: single and double bracket", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) |> @@ -80,7 +79,7 @@ test_that("cli print.igraph.es: single and double bracket", { }) test_that("cli print.igraph: ASCII fallback when cli.unicode = FALSE", { - local_igraph_options(print.style = "cli", print.id = FALSE) + local_igraph_options(print.style = "cli") withr::local_options(cli.num_colors = 1, cli.unicode = FALSE, cli.width = 80) g <- make_ring(3, directed = TRUE) |> set_vertex_attr("name", value = c("A", "B", "C")) @@ -92,7 +91,6 @@ test_that("cli print.igraph: ASCII fallback when cli.unicode = FALSE", { test_that("cli print.igraph: truncation in auto mode", { local_igraph_options( print.style = "cli", - print.id = FALSE, auto.print.lines = 3 ) withr::local_options(cli.num_colors = 1, cli.unicode = TRUE, cli.width = 80) diff --git a/tests/testthat/test-structural-properties.R b/tests/testthat/test-structural-properties.R index 0e93e26f3ed..e492b7b75e5 100644 --- a/tests/testthat/test-structural-properties.R +++ b/tests/testthat/test-structural-properties.R @@ -214,7 +214,6 @@ test_that("BFS callback does not blow up when another igraph function is raised }) test_that("bfs() works", { - local_igraph_options(print.id = FALSE) expect_snapshot({ g <- graph_from_literal(a -+ b -+ c, z -+ a, d) diff --git a/tests/testthat/test-trees.R b/tests/testthat/test-trees.R index e5a1b59bf33..862481d2b34 100644 --- a/tests/testthat/test-trees.R +++ b/tests/testthat/test-trees.R @@ -216,7 +216,6 @@ test_that("sample_spanning_tree works for disconnected graphs", { }) test_that("subgraph.edges deprecation", { - local_igraph_options(print.id = FALSE) withr::local_seed(42) g <- make_full_graph(8) %du% make_full_graph(5) diff --git a/tests/testthat/test-versions.R b/tests/testthat/test-versions.R index 0af0633de57..42e15a1649c 100644 --- a/tests/testthat/test-versions.R +++ b/tests/testthat/test-versions.R @@ -67,7 +67,6 @@ test_that("we can upgrade from 0.6 to 1.5.0, explicitly", { }) test_that("we can upgrade from 1.0.0 to 1.5.0, on the fly", { - local_igraph_options(print.id = FALSE) expect_snapshot({ g <- oldsample_1_0_0() @@ -92,7 +91,6 @@ test_that("we can upgrade from 1.0.0 to 1.5.0, explicitly", { }) test_that("reading of old igraph formats", { - local_igraph_options(print.id = FALSE) s <- oldsamples() expect_snapshot_igraph_error({ From eb4c196efe4e41cdd910760f55abeae9e6b8d4af Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 17:06:27 +0200 Subject: [PATCH 16/20] Extract classic vs/es printing into *_legacy dispatch functions Make print.igraph.vs() and print.igraph.es() pure dispatchers: guard on `!is_cli_style()` to delegate to the new print_igraph_vs_legacy() / print_igraph_es_legacy() (the former inline classic bodies), and fall through to the cli renderer otherwise. cli is the default style now, so treating it as the main path and legacy as the special case reads more naturally and keeps both branches as named functions. Co-Authored-By: Claude Opus 4.8 (1M context) --- R/iterators.R | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/R/iterators.R b/R/iterators.R index 70319d81ef7..51bbd9e5310 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -1422,10 +1422,19 @@ print.igraph.vs <- function( id = igraph_opt("print.id"), ... ) { - if (is_cli_style()) { - return(print_igraph_vs_cli(x, full = full, id = id, ...)) + if (!is_cli_style()) { + return(print_igraph_vs_legacy(x, full = full, id = id, ...)) } + print_igraph_vs_cli(x, full = full, id = id, ...) +} + +print_igraph_vs_legacy <- function( + x, + full = igraph_opt("print.full"), + id = igraph_opt("print.id"), + ... +) { graph <- get_vs_graph(x) if (!is.null(graph)) { vertices <- V(graph) @@ -1543,10 +1552,19 @@ print.igraph.es <- function( id = igraph_opt("print.id"), ... ) { - if (is_cli_style()) { - return(print_igraph_es_cli(x, full = full, id = id, ...)) + if (!is_cli_style()) { + return(print_igraph_es_legacy(x, full = full, id = id, ...)) } + print_igraph_es_cli(x, full = full, id = id, ...) +} + +print_igraph_es_legacy <- function( + x, + full = igraph_opt("print.full"), + id = igraph_opt("print.id"), + ... +) { graph <- get_es_graph(x) ml <- if (identical(full, TRUE)) NULL else igraph_opt("auto.print.lines") .print.edges.compressed( From aa8609f43d8e89aa8f4aea363b6aaa97c6610d74 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 4 Jun 2026 17:08:44 +0200 Subject: [PATCH 17/20] Extract classic graph printing into *_legacy dispatch functions Apply the same dispatch inversion as the vs/es printers to print.igraph() and summary.igraph(): guard on `!is_cli_style()` to delegate to the new print_igraph_legacy() / summary_igraph_legacy() (the former inline classic bodies), and fall through to the cli renderer otherwise. Co-Authored-By: Claude Opus 4.8 (1M context) --- R/print.R | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/R/print.R b/R/print.R index 00a284db25d..0727bfae8c7 100644 --- a/R/print.R +++ b/R/print.R @@ -603,8 +603,8 @@ print.igraph <- function( ) { ensure_igraph(x) - if (is_cli_style()) { - return(print_igraph_cli( + if (!is_cli_style()) { + return(print_igraph_legacy( x, full = full, graph.attributes = graph.attributes, @@ -617,6 +617,30 @@ print.igraph <- function( )) } + print_igraph_cli( + x, + full = full, + graph.attributes = graph.attributes, + vertex.attributes = vertex.attributes, + edge.attributes = edge.attributes, + names = names, + max.lines = max.lines, + id = id, + ... + ) +} + +print_igraph_legacy <- function( + x, + full = igraph_opt("print.full"), + graph.attributes = igraph_opt("print.graph.attributes"), + vertex.attributes = igraph_opt("print.vertex.attributes"), + edge.attributes = igraph_opt("print.edge.attributes"), + names = TRUE, + max.lines = igraph_opt("auto.print.lines"), + id = igraph_opt("print.id"), + ... +) { head_lines <- .print.header(x, id) if (is.logical(full) && full) { if (graph.attributes) { @@ -653,9 +677,13 @@ print.igraph <- function( #' @family print #' @export summary.igraph <- function(object, ...) { - if (is_cli_style()) { - return(summary_igraph_cli(object)) + if (!is_cli_style()) { + return(summary_igraph_legacy(object)) } + summary_igraph_cli(object) +} + +summary_igraph_legacy <- function(object, ...) { .print.header(object) invisible(object) } From 109182dc4a82e92e3b08d2f6c36e511468937ba6 Mon Sep 17 00:00:00 2001 From: schochastics Date: Thu, 4 Jun 2026 15:19:57 +0000 Subject: [PATCH 18/20] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/26960793072 --- tests/testthat/test-conversion.R | 2 -- tests/testthat/test-foreign.R | 3 --- tests/testthat/test-iterators.R | 3 --- tests/testthat/test-other.R | 1 - tests/testthat/test-print-classic.R | 5 ----- tests/testthat/test-structural-properties.R | 1 - tests/testthat/test-versions.R | 2 -- 7 files changed, 17 deletions(-) diff --git a/tests/testthat/test-conversion.R b/tests/testthat/test-conversion.R index 01aab821ad0..aa25f243b06 100644 --- a/tests/testthat/test-conversion.R +++ b/tests/testthat/test-conversion.R @@ -45,13 +45,11 @@ test_that("as_directed keeps attributes", { }) test_that("as.directed() deprecation", { - g <- sample_gnp(100, 2 / 100) expect_snapshot(is_directed(as.directed(g, mode = "mutual"))) }) test_that("as.undirected() deprecation", { - g <- sample_gnp(100, 2 / 100) expect_snapshot(is_directed(as.undirected(g, mode = "collapse"))) }) diff --git a/tests/testthat/test-foreign.R b/tests/testthat/test-foreign.R index c97c8a096ee..b1542f0334f 100644 --- a/tests/testthat/test-foreign.R +++ b/tests/testthat/test-foreign.R @@ -27,7 +27,6 @@ test_that("reading GraphML file works", { }) test_that("reading graph in NCOL format", { - ncol_path <- withr::local_tempfile(pattern = "testfile", fileext = ".ncol") g <- make_graph(c(1, 2, 2, 3)) write_graph(g, ncol_path, "ncol") @@ -35,7 +34,6 @@ test_that("reading graph in NCOL format", { }) test_that("reading graph in LGL format", { - lgl_path <- withr::local_tempfile(pattern = "testfile", fileext = ".lgl") g <- make_graph(c(1, 2, 2, 3)) write_graph(g, lgl_path, "lgl") @@ -43,7 +41,6 @@ test_that("reading graph in LGL format", { }) test_that("reading graph, unused argument", { - lgl_path <- withr::local_tempfile(pattern = "testfile", fileext = ".lgl") g <- make_graph(c(1, 2, 2, 3)) write_graph(g, lgl_path, "lgl") diff --git a/tests/testthat/test-iterators.R b/tests/testthat/test-iterators.R index e7b83c017a4..a65fcf1b56f 100644 --- a/tests/testthat/test-iterators.R +++ b/tests/testthat/test-iterators.R @@ -325,7 +325,6 @@ test_that("both edge and vertex names", { }) test_that("printing connected vs/es works", { - g <- make_ring(10) vs <- V(g) es <- E(g) @@ -344,7 +343,6 @@ test_that("printing connected vs/es works", { }) test_that("printing named connected vs/es works", { - g <- make_ring(10) V(g)$name <- letters[1:10] vs <- V(g) @@ -364,7 +362,6 @@ test_that("printing named connected vs/es works", { }) test_that("printing unconnected vs/es works", { - g <- make_ring(10) vs <- V(g) es <- E(g) diff --git a/tests/testthat/test-other.R b/tests/testthat/test-other.R index b008b8fdf0c..466cb539e5f 100644 --- a/tests/testthat/test-other.R +++ b/tests/testthat/test-other.R @@ -49,7 +49,6 @@ test_that("R help contains guarantee on number of RNG bits", { }) test_that("serialization works", { - g <- make_ring(3, directed = TRUE) gs <- unserialize(serialize(g, NULL)) diff --git a/tests/testthat/test-print-classic.R b/tests/testthat/test-print-classic.R index 58af98b70f1..5a849f282c7 100644 --- a/tests/testthat/test-print-classic.R +++ b/tests/testthat/test-print-classic.R @@ -129,7 +129,6 @@ test_that("print.igraph() respects max.print in the adjlist wrapping branch", { }) test_that("print.igraph.es() uses vertex names", { - g <- make_directed_graph(c("A", "B")) expect_snapshot({ E(g) @@ -138,7 +137,6 @@ test_that("print.igraph.es() uses vertex names", { test_that("vs printing", { - local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -154,7 +152,6 @@ test_that("vs printing", { }) test_that("vs printing, complex attributes", { - local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -169,7 +166,6 @@ test_that("vs printing, complex attributes", { }) test_that("es printing", { - local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -183,7 +179,6 @@ test_that("es printing", { }) test_that("es printing, complex attributes", { - local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% diff --git a/tests/testthat/test-structural-properties.R b/tests/testthat/test-structural-properties.R index e492b7b75e5..e418a16fa46 100644 --- a/tests/testthat/test-structural-properties.R +++ b/tests/testthat/test-structural-properties.R @@ -214,7 +214,6 @@ test_that("BFS callback does not blow up when another igraph function is raised }) test_that("bfs() works", { - expect_snapshot({ g <- graph_from_literal(a -+ b -+ c, z -+ a, d) bfs( diff --git a/tests/testthat/test-versions.R b/tests/testthat/test-versions.R index 42e15a1649c..35aee66b849 100644 --- a/tests/testthat/test-versions.R +++ b/tests/testthat/test-versions.R @@ -67,7 +67,6 @@ test_that("we can upgrade from 0.6 to 1.5.0, explicitly", { }) test_that("we can upgrade from 1.0.0 to 1.5.0, on the fly", { - expect_snapshot({ g <- oldsample_1_0_0() graph_version(g) @@ -91,7 +90,6 @@ test_that("we can upgrade from 1.0.0 to 1.5.0, explicitly", { }) test_that("reading of old igraph formats", { - s <- oldsamples() expect_snapshot_igraph_error({ s[["0.1.1"]] From 2c4455fafe02c9628b6498f13dad55ec63e46541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 8 Jun 2026 05:18:54 +0200 Subject: [PATCH 19/20] Try to avoid rename detection --- tests/testthat/_snaps/print-classic.md | 50 +++++++++++++------------- tests/testthat/test-print-classic.R | 18 +++++----- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/testthat/_snaps/print-classic.md b/tests/testthat/_snaps/print-classic.md index f2fa7386b87..9ed545005b4 100644 --- a/tests/testthat/_snaps/print-classic.md +++ b/tests/testthat/_snaps/print-classic.md @@ -1,4 +1,4 @@ -# print.igraph.es() uses vertex names +# classic: print.igraph.es() uses vertex names Code E(g) @@ -6,7 +6,7 @@ + 1/1 edge (vertex names): [1] A->B -# vs printing +# classic: vs printing Code V(g)[[1]] @@ -31,7 +31,7 @@ + 2/3 vertices, named: [1] B C -# vs printing, complex attributes +# classic: vs printing, complex attributes Code V(g)[[1]] @@ -39,41 +39,41 @@ + 1/3 vertex, named: $name [1] "A" - + $color [1] "red" - + $weight [1] 10 - + $cplx $cplx[[1]] [1] 1 2 3 4 - - + + Code V(g)[[2:3]] Output + 2/3 vertices, named: $name [1] "B" "C" - + $color [1] "red" "red" - + $weight [1] 9 3 - + $cplx $cplx[[1]] [1] 1 2 3 4 - + $cplx[[2]] [1] 1 2 3 4 - - -# es printing + + +# classic: es printing Code E(g)[[1]] @@ -89,7 +89,7 @@ 2 A C 1 3 red 9 3 B C 2 3 red 3 -# es printing, complex attributes +# classic: es printing, complex attributes Code E(g)[[1]] @@ -97,31 +97,31 @@ + 1/3 edge (vertex names): $color [1] "red" - + $weight [1] 10 - + $cmpx $cmpx[[1]] [1] 1 2 3 4 - - + + Code E(g)[[2:3]] Output + 2/3 edges (vertex names): $color [1] "red" "red" - + $weight [1] 9 3 - + $cmpx $cmpx[[1]] [1] 1 2 3 4 - + $cmpx[[2]] [1] 1 2 3 4 - - + + diff --git a/tests/testthat/test-print-classic.R b/tests/testthat/test-print-classic.R index 5a849f282c7..e4f1b85ffff 100644 --- a/tests/testthat/test-print-classic.R +++ b/tests/testthat/test-print-classic.R @@ -1,4 +1,4 @@ -test_that("print.igraph() works", { +test_that("classic: print.igraph() works", { local_igraph_options(print.full = TRUE) withr::local_options(width = 76) @@ -71,7 +71,7 @@ test_that("print.igraph() works", { expect_output(print(kite), "A -- ") }) -test_that("print.igraph() respects max.print for adjacency list formats", { +test_that("classic: print.igraph() respects max.print for adjacency list formats", { local_igraph_options(print.full = TRUE) withr::local_options(width = 76, max.print = 3) @@ -97,7 +97,7 @@ test_that("print.igraph() respects max.print for adjacency list formats", { expect_false(grepl("d -- ", joined)) }) -test_that("print.igraph() omits no message when vcount <= max.print", { +test_that("classic: print.igraph() omits no message when vcount <= max.print", { local_igraph_options(print.full = TRUE) withr::local_options(width = 76, max.print = 10) @@ -110,7 +110,7 @@ test_that("print.igraph() omits no message when vcount <= max.print", { expect_false(grepl("reached getOption", joined)) }) -test_that("print.igraph() respects max.print in the adjlist wrapping branch", { +test_that("classic: print.igraph() respects max.print in the adjlist wrapping branch", { local_igraph_options(print.full = TRUE) withr::local_options(width = 40, max.print = 2) @@ -128,7 +128,7 @@ test_that("print.igraph() respects max.print in the adjlist wrapping branch", { expect_false(any(grepl("^3 -- ", out))) }) -test_that("print.igraph.es() uses vertex names", { +test_that("classic: print.igraph.es() uses vertex names", { g <- make_directed_graph(c("A", "B")) expect_snapshot({ E(g) @@ -136,7 +136,7 @@ test_that("print.igraph.es() uses vertex names", { }) -test_that("vs printing", { +test_that("classic: vs printing", { local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -151,7 +151,7 @@ test_that("vs printing", { }) }) -test_that("vs printing, complex attributes", { +test_that("classic: vs printing, complex attributes", { local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -165,7 +165,7 @@ test_that("vs printing, complex attributes", { }) }) -test_that("es printing", { +test_that("classic: es printing", { local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% @@ -178,7 +178,7 @@ test_that("es printing", { }) }) -test_that("es printing, complex attributes", { +test_that("classic: es printing, complex attributes", { local_rng_version("3.5.0") withr::local_seed(42) g <- make_graph(~ A - A:B:C, B - A:B:C) %>% From 863e6c16c79675bf07fbd82cd6f1c21927cd4a61 Mon Sep 17 00:00:00 2001 From: krlmlr Date: Mon, 8 Jun 2026 03:28:12 +0000 Subject: [PATCH 20/20] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/27114071716 --- man/igraph_options.Rd | 8 ++++++ man/min_st_separators.Rd | 6 ++-- man/print.igraph.Rd | 7 +++-- tests/testthat/_snaps/print-classic.md | 40 +++++++++++++------------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/man/igraph_options.Rd b/man/igraph_options.Rd index 2e50ab2bd70..cc8af78745f 100644 --- a/man/igraph_options.Rd +++ b/man/igraph_options.Rd @@ -84,6 +84,14 @@ Logical constant, whether to print graph attributes when printing graphs. Defaul \item{print.vertex.attributes}{ Logical constant, whether to print vertex attributes when printing graphs. Defaults to \code{FALSE}. } +\item{print.style}{ +Character string controlling the visual style used by +\code{\link[=print.igraph]{print.igraph()}}, \code{\link[=summary.igraph]{summary.igraph()}}, \code{\link[=print.igraph.vs]{print.igraph.vs()}} and +\code{\link[=print.igraph.es]{print.igraph.es()}}. Possible values are \code{"cli"} (default, a +cli-styled output with section rules, Unicode arrows for edges and +typed attribute listings) and \code{"classic"} (the historical +\verb{IGRAPH ... DNW-} header relied on by tutorials and parsers). +} \item{return.vs.es}{ Whether functions that return a set or sequence of vertices/edges should return formal vertex/edge sequence objects. diff --git a/man/min_st_separators.Rd b/man/min_st_separators.Rd index 4e2a94c8b11..c6ee762652b 100644 --- a/man/min_st_separators.Rd +++ b/man/min_st_separators.Rd @@ -38,15 +38,15 @@ min_st_separators(g) }\if{html}{\out{}} \if{html}{\out{
}}\preformatted{#> [[1]] -#> + 1/5 vertex, named: +#> -- 1/5 * named ----------------------------------------------- #> [1] 1 #> #> [[2]] -#> + 2/5 vertices, named: +#> -- 2/5 * named ----------------------------------------------- #> [1] 2 4 #> #> [[3]] -#> + 2/5 vertices, named: +#> -- 2/5 * named ----------------------------------------------- #> [1] 1 3 }\if{html}{\out{
}} } diff --git a/man/print.igraph.Rd b/man/print.igraph.Rd index 30457b239ce..c3326c9fff2 100644 --- a/man/print.igraph.Rd +++ b/man/print.igraph.Rd @@ -101,9 +101,10 @@ As of igraph 0.4 \code{print_all()} and \code{print.igraph()} use the As of igraph 1.1.1, the \code{str.igraph} function is defunct, use \code{print_all()}. -Set \code{igraph_options(print.style = "cli")} to switch to a cli-styled -output with section rules, typed attribute listings and Unicode arrows -for edges. The default \code{"classic"} keeps the historical +Output style is controlled by the \code{print.style} igraph option. The default +\code{"cli"} produces cli-styled output with section rules, typed attribute +listings and Unicode arrows for edges. Set +\code{igraph_options(print.style = "classic")} for the historical \verb{IGRAPH ... DNW-} header relied on by parsers and tutorials. } \section{Related documentation in the C library}{ diff --git a/tests/testthat/_snaps/print-classic.md b/tests/testthat/_snaps/print-classic.md index 9ed545005b4..9b64b838d56 100644 --- a/tests/testthat/_snaps/print-classic.md +++ b/tests/testthat/_snaps/print-classic.md @@ -39,39 +39,39 @@ + 1/3 vertex, named: $name [1] "A" - + $color [1] "red" - + $weight [1] 10 - + $cplx $cplx[[1]] [1] 1 2 3 4 - - + + Code V(g)[[2:3]] Output + 2/3 vertices, named: $name [1] "B" "C" - + $color [1] "red" "red" - + $weight [1] 9 3 - + $cplx $cplx[[1]] [1] 1 2 3 4 - + $cplx[[2]] [1] 1 2 3 4 - - + + # classic: es printing @@ -97,31 +97,31 @@ + 1/3 edge (vertex names): $color [1] "red" - + $weight [1] 10 - + $cmpx $cmpx[[1]] [1] 1 2 3 4 - - + + Code E(g)[[2:3]] Output + 2/3 edges (vertex names): $color [1] "red" "red" - + $weight [1] 9 3 - + $cmpx $cmpx[[1]] [1] 1 2 3 4 - + $cmpx[[2]] [1] 1 2 3 4 - - + +