Skip to content
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

Possible bug in Graph definition #95

Open
liuzhilide opened this issue Aug 21, 2018 · 1 comment
Open

Possible bug in Graph definition #95

liuzhilide opened this issue Aug 21, 2018 · 1 comment

Comments

@liuzhilide
Copy link

/** Deep copies **/
public Graph(Graph<T> g) {
    type = g.getType();

    // Copy the vertices which also copies the edges
    for (Vertex<T> v : g.getVertices())
        this.allVertices.add(new Vertex<T>(v));

    for (Vertex<T> v : this.getVertices()) {
        for (Edge<T> e : v.getEdges()) {
            this.allEdges.add(e);
        }
    }
}

I don't think it‘s a Deep copies. Although those new Vertices have associated with those Edges, but Edges still associated with old Vertices;

@Ikhideifidon
Copy link

Did you solve the deep copy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants