Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/aaa-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -4409,16 +4409,16 @@ biconnected_components_impl <- function(
graph
)
if (igraph_opt("return.vs.es")) {
res$tree.edges <- lapply(res$tree.edges, unsafe_create_es, graph = graph, es = E(graph))
res$tree_edges <- lapply(res$tree_edges, unsafe_create_es, graph = graph, es = E(graph))
}
if (igraph_opt("return.vs.es")) {
res$component.edges <- lapply(res$component.edges, unsafe_create_es, graph = graph, es = E(graph))
res$component_edges <- lapply(res$component_edges, unsafe_create_es, graph = graph, es = E(graph))
}
if (igraph_opt("return.vs.es")) {
res$components <- lapply(res$components, unsafe_create_vs, graph = graph, verts = V(graph))
}
if (igraph_opt("return.vs.es")) {
res$articulation.points <- create_vs(graph, res$articulation.points)
res$articulation_points <- create_vs(graph, res$articulation_points)
}
res
}
Expand Down
38 changes: 1 addition & 37 deletions R/components.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,45 +323,9 @@ bridges <- function(graph) {
#' @cdocs igraph_biconnected_components
biconnected_components <- function(graph) {
# Function call
res <- biconnected_components_impl(
biconnected_components_impl(
graph = graph
)

# TODO: Clean up after fixing "." / "_" problem.
# See https://github.com/igraph/rigraph/issues/1203

if (igraph_opt("return.vs.es")) {
res$tree_edges <- lapply(
res$tree_edges,
unsafe_create_es,
graph = graph,
es = E(graph)
)
res$tree.edges <- NULL
}

if (igraph_opt("return.vs.es")) {
res$component_edges <- lapply(
res$component_edges,
unsafe_create_es,
graph = graph,
es = E(graph)
)
res$component.edges <- NULL
}
if (igraph_opt("return.vs.es")) {
res$components <- lapply(
res$components,
unsafe_create_vs,
graph = graph,
verts = V(graph)
)
}
if (igraph_opt("return.vs.es")) {
res$articulation_points <- create_vs(graph, res$articulation_points)
res$articulation.points <- NULL
}
res
}

#' Check biconnectedness
Expand Down
22 changes: 9 additions & 13 deletions tests/testthat/_snaps/aaa-auto.md
Original file line number Diff line number Diff line change
Expand Up @@ -4257,18 +4257,22 @@

$tree_edges
$tree_edges[[1]]
[1] 2
+ 1/2 edge:
[1] 2--3

$tree_edges[[2]]
[1] 1
+ 1/2 edge:
[1] 1--2


$component_edges
$component_edges[[1]]
[1] 2
+ 1/2 edge:
[1] 2--3

$component_edges[[2]]
[1] 1
+ 1/2 edge:
[1] 1--2


$components
Expand All @@ -4282,17 +4286,9 @@


$articulation_points
+ 1/3 vertex:
[1] 2

$tree.edges
list()

$component.edges
list()

$articulation.points
+ 0/3 vertices:


# biconnected_components_impl errors

Expand Down
Loading