Skip to content

Combinatorics: added copy(::Graph)#5930

Open
YueRen wants to merge 1 commit intooscar-system:masterfrom
YueRen:yr/copyGraph
Open

Combinatorics: added copy(::Graph)#5930
YueRen wants to merge 1 commit intooscar-system:masterfrom
YueRen:yr/copyGraph

Conversation

@YueRen
Copy link
Copy Markdown
Member

@YueRen YueRen commented Apr 10, 2026

Many operations for graphs work inplace, so I think it would be nice if there was a copy command for graphs:

julia> G = graph_from_edges([[1,2]])
Undirected graph with 2 nodes and the following edges:
(2, 1)

julia> H = G
Undirected graph with 2 nodes and the following edges:
(2, 1)

julia> collect(edges(H))
1-element Vector{Edge}:
 Edge(2, 1)

julia> rem_edge!(G,1,2)
true

julia> collect(edges(H))
Edge[]

@YueRen YueRen added topic: combinatorics release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant