Skip to content

Commit

Permalink
refac/ Deep graph clone
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolnetto committed Jan 22, 2022
1 parent 6b21a02 commit adcc6ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data-structures/graph/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export default class Graph {
// DFS based function to find all bridges. It uses recursive
// function bridgeUtil()
bridges(){
let graph_ = this.isDirected ? this.retrieveUndirected() : structuredClone(this);
let graph_ = this.isDirected ? this.retrieveUndirected() : _.cloneDeep(this);

// Mark all the vertices as not visited
let n_vertices = graph_.getNumVertices()
Expand Down

0 comments on commit adcc6ae

Please sign in to comment.