Skip to content

Instantly share code, notes, and snippets.

@singularitti
Last active December 7, 2022 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singularitti/8d61192e4ffe87d97442c9c7bd287eda to your computer and use it in GitHub Desktop.
Save singularitti/8d61192e4ffe87d97442c9c7bd287eda to your computer and use it in GitHub Desktop.
Merge 2 graphs #Julia #graph
function merge(g, b)
a = copy(g)
add_vertices!(a, nv(b))
for e in edges(h)
add_edge!(a, src(e) + nv(g), dst(e) + nv(g))
end
return a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment