Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Graphs need to reimplement #dup using deep copy #6

Closed
D4L opened this Issue · 0 comments

1 participant

Austin Lee
Austin Lee
Owner

When graphs have vertices, they'll need to implement #dup using deep copy, otherwise changing one graph's vertices will change any duplicates.

example test case:

graph = Graph.new
graph.add_vertex "MyVertex"
graphdup = graph.dup
graph.delete_vertex "MyVertex"
graphdup.has_vertex? "MyVertex" # => true

Note: Might need to add a dup for vertices, or any vertex container

Austin Lee D4L closed this in eae33f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.