Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graph *GraphGenerator::copyGraph(Graph *graph){
- queue <node*> queue;
- set<node*> nodSet;
- set<Edge*> edgSet;
- node *nod = new node;
- node *n = nod;
- queue.push(graph->getInitialNode());
- while(!queue.empty()){
- node* orgnod = queue.front();
- queue.pop();
- for(int i = 0; i < orgnod->getEdgeOutList().size(); i++){
- if(edgSet.find(orgnod->getEdgeOutList()[i]) != edgSet.end()){
- //check for node,push
- //create one
- //set as copy
- //add to set
- }//else
- //get node copy, push
- //create edge
- //add to set
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement