-
-
Notifications
You must be signed in to change notification settings - Fork 206
feat: Add make_full_multipartite() and make_turan() graph constructors
#2406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add make_full_multipartite() and make_turan() graph constructors
#2406
Conversation
…turan() Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
make_full_multipartite() and make_turan() graph constructors
make_full_multipartite() and make_turan() graph constructorsmake_full_multipartite() and make_turan() graph constructors
|
@copilot: The build pipeline failed. Parse the log and fix it. |
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Fixed in 936a3cb. The build was failing due to a non-ASCII character (á) in the graph name string Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
R/make.R
Outdated
| #' direction is realized; `"all"` creates mutual edges. This parameter is | ||
| #' ignored for undirected graphs. | ||
| #' @return An igraph graph with a vertex attribute `type` storing the | ||
| #' partition index of each vertex (1-indexed). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "1-indexed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "Partition indices start from 1" for clarity in 0c3cd63.
R/make.R
Outdated
| #' @examples | ||
| #' # Create a multipartite graph with partitions of size 2, 3, and 4 | ||
| #' g <- make_full_multipartite(c(2, 3, 4)) | ||
| #' print(g, v = TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer plot instead of print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use plot() in 0c3cd63.
|
@copilot: Address comments. |
- Change "1-indexed" to "Partition indices start from 1" for clarity - Use plot() instead of print() in examples - Fix return value structure: return graph directly, not a list - Properly set graph attributes using set_graph_attr() Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
|
@copilot: Agent instructions are updated, adapt. Use |
- Added igraph_full_multipartite and igraph_turan entries to functions-R.yaml - Configured GATTR to set graph name automatically - Configured GATTR-PARAM to store function parameters as graph attributes - Configured DEPS to handle types output parameter - Updated wrapper functions to transfer attributes from impl result to graph - Simplified code by using Stimulus-generated attributes instead of manual setting Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Implemented in 85aaf29. Added entries to
The Stimulus system now automatically generates attribute-setting code in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Expose
make_full_multipartite()andmake_turan()Successfully implemented and tested two new graph constructor functions:
Implementation Details
make_full_multipartite(n, directed, mode)nis a vector specifying the number of vertices in each partitiontypestoring partition indices (starting from 1)make_turan(n, r)nvertices andrpartitionstypefor partition indices (starting from 1)Testing
make_()Code Quality
air formatThe implementation wraps existing C functions (
igraph_full_multipartiteandigraph_turan) that were already exposed through auto-generated_implfunctions. The functions now use the Stimulus code generation system for automatic graph attribute management, making this a clean integration with the igraph build system.Original prompt
make_full_multipartite()andmake_turan()#1562💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.