Skip to content

feat: expose igraph 0.10 functions - any_mutual(), invalidate_cache(), and 8 generator functions#2410

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/expose-new-functions-0-10
Draft

feat: expose igraph 0.10 functions - any_mutual(), invalidate_cache(), and 8 generator functions#2410
Copilot wants to merge 4 commits intomainfrom
copilot/expose-new-functions-0-10

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 26, 2025

Exposes priority 0 functions and new graph generators from igraph 0.10 for the first R release based on 0.10.

Functions Added

Priority 0:

  • any_mutual() - checks if directed graph has any mutual edges (wraps igraph_has_mutual)
  • invalidate_cache() - invalidates cached properties for debugging

Generators (with make_ prefix):

  • make_wheel() - wheel graph
  • make_circulant() - circulant graph
  • make_turan() - Turán graph
  • make_generalized_petersen() - generalized Petersen graph
  • make_full_multipartite() - complete multipartite graph
  • make_regular_tree() - regular tree
  • make_symmetric_tree() - symmetric tree with level-specific branching
  • make_triangular_lattice() - triangular lattice

Implementation

  • Added public wrappers in R/make.R, R/structural-properties.R, R/utils.R
  • Updated tools/stimulus/functions-R.yaml and regenerated bindings via Stimulus
  • Handled multi-return functions (make_turan, make_full_multipartite) that return both graph and vertex type attributes

Example

# Check for mutual edges
g <- make_graph(c(1, 2, 2, 1), directed = TRUE)
any_mutual(g)  # TRUE

# Create graph generators
wheel <- make_wheel(10)  # 10 vertices, 18 edges
turan <- make_turan(12, 3)  # 12 vertices split into 3 partitions
V(turan)$type  # partition membership

Not Included

  • make_hexagonal_lattice() - not yet in cigraph's interfaces/functions.yaml
  • Functions already exposed: is_forest(), is_acyclic(), graph_center(), hits_scores(), weighted radius()/eccentricity()
Original prompt

This section details on the original issue you should resolve

<issue_title>0.10 functions that should be exposed</issue_title>
<issue_description>## Priority 0

This is a list of functions that are new in 0.10 and should probably be exposed in the very first R/igraph release based on 0.10. Should be easy through auto-generation. The igraph_ part is omitted from function names.

  • is_forest and is_acyclic
  • has_mutual -> any_mutual
  • invalidate_cache — we need this for debugging
  • ... ?

Priority 1

These would be nice to expose soon though perhaps not in the first release. Several of these were requested by users. Auto-generation is not always possible.

  • hub_and_authority_scores to replace separate hub and authority score calculation
  • get_k_shortest_paths Add k_shortest_paths #972
  • graph_center
  • ... ?

Add support for extra features to existing functions. These are often a separate function in C, but should be integrated into the same function in R.

Generators (probably all of these can be auto-generated):

  • circulant
  • turan
  • wheel
  • full_multipartite
  • regular_tree
  • symmetric_tree
  • triangular_lattice
  • hexagonal_lattice
  • generalized_petersen
  • ... ?

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits October 26, 2025 11:42
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
…` and generator functions

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Expose new functions from version 0.10 of igraph feat: expose igraph 0.10 functions - any_mutual(), invalidate_cache(), and 8 generator functions Oct 26, 2025
Copilot AI requested a review from krlmlr October 26, 2025 12:08
@szhorvat
Copy link
Copy Markdown
Member

This is exposing stuff that there's already another PR for, such as full_multipartite.

Copy link
Copy Markdown
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot: Merge main, resolve conflicts, and obey updated instructions. Check which functions are covered by other issues or PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.10 functions that should be exposed

3 participants