Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ See the tidyverse guide on [how to create a great issue](https://code-review.tid

* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
Please add test cases for the change you are proposing, or ask us for help.

### Naming conventions

* Use `max` for maximal and `largest` for maximum.

### Test files

Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ export(max_cliques)
export(max_cohesion)
export(max_degree)
export(max_flow)
export(max_ivs)
export(maxcohesion)
export(maximal.cliques)
export(maximal.cliques.count)
Expand Down
31 changes: 23 additions & 8 deletions R/cliques.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `maximal.independent.vertex.sets()` was renamed to `maximal_ivs()` to create a more
#' `maximal.independent.vertex.sets()` was renamed to `max_ivs()` to create a more
#' consistent API.
#' @inheritParams maximal_ivs
#' @inheritParams max_ivs
#' @keywords internal
#' @export
maximal.independent.vertex.sets <- function(graph) { # nocov start
lifecycle::deprecate_soft("2.0.0", "maximal.independent.vertex.sets()", "maximal_ivs()")
maximal_ivs(graph = graph)
lifecycle::deprecate_soft("2.0.0", "maximal.independent.vertex.sets()", "max_ivs()")
max_ivs(graph = graph)
} # nocov end

#' Functions to find cliques, i.e. complete subgraphs in a graph
Expand Down Expand Up @@ -382,7 +382,7 @@ weighted_clique_num <- weighted_clique_number_impl
#' sets in the graph. An independent vertex set is largest if there is no
#' independent vertex set with more vertices.
#'
#' `maximal_ivs()` finds the maximal independent vertex
#' `max_ivs()` finds the maximal independent vertex
#' sets in the graph. An independent vertex set is maximal if it cannot be
#' extended to a larger independent vertex set. The largest independent vertex
#' sets are maximal, but the opposite is not always true.
Expand All @@ -401,7 +401,7 @@ weighted_clique_num <- weighted_clique_number_impl
#' vertex sets to find. `NULL` means no limit.
#' @return `ivs()`,
#' `largest_ivs()` and
#' `maximal_ivs()` return a list containing numeric
#' `max_ivs()` return a list containing numeric
#' vertex ids, each list element is an independent vertex set.
#'
#' `ivs_size()` returns an integer constant.
Expand All @@ -428,7 +428,7 @@ weighted_clique_num <- weighted_clique_number_impl
#' # Empty graph
#' induced_subgraph(g, largest_ivs(g)[[1]])
#'
#' length(maximal_ivs(g))
#' length(max_ivs(g))
ivs <- function(graph, min = NULL, max = NULL) {
ensure_igraph(graph)

Expand Down Expand Up @@ -472,7 +472,7 @@ largest_ivs <- function(graph) {

#' @rdname ivs
#' @export
maximal_ivs <- function(graph) {
max_ivs <- function(graph) {
ensure_igraph(graph)

on.exit(.Call(R_igraph_finalizer))
Expand All @@ -486,6 +486,21 @@ maximal_ivs <- function(graph) {
res
}

#' Maximal independent vertex sets in the graph
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `maximal_ivs()` was renamed to `max_ivs()` to create a more
#' consistent API.
#' @export
#' @inheritParams max_ivs
#' @keywords internal
maximal_ivs <- function(graph) {
lifecycle::deprecate_soft("2.0.4", "maximal_ivs()", "max_ivs()")
max_ivs(graph)
}

#' @rdname ivs
#' @export
ivs_size <- function(graph) {
Expand Down
2 changes: 1 addition & 1 deletion inst/lifecycle/deprecated.csv
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ list.vertex.attributes,<a href='https://r.igraph.org/reference/vertex_attr_names
maxcohesion,<a href='https://r.igraph.org/reference/cohesive_blocks.html'>igraph::max_cohesion</a>
maximal.cliques,<a href='https://r.igraph.org/reference/cliques.html'>igraph::max_cliques</a>
maximal.cliques.count,<a href='https://r.igraph.org/reference/cliques.html'>igraph::count_max_cliques</a>
maximal.independent.vertex.sets,<a href='https://r.igraph.org/reference/ivs.html'>igraph::maximal_ivs</a>
maximal.independent.vertex.sets,<a href='https://r.igraph.org/reference/ivs.html'>igraph::max_ivs</a>
minimal.st.separators,<a href='https://r.igraph.org/reference/min_st_separators.html'>igraph::min_st_separators</a>
maximum.bipartite.matching,<a href='https://r.igraph.org/reference/matching.html'>igraph::max_bipartite_match</a>
maximum.cardinality.search,<a href='https://r.igraph.org/reference/max_cardinality.html'>igraph::max_cardinality</a>
Expand Down
10 changes: 5 additions & 5 deletions man/ivs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/maximal.independent.vertex.sets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions man/maximal_ivs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.