Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Graph *GraphGenerator::copyGraph(Graph *graph){
  2. queue <node*> queue;
  3. set<node*> nodSet;
  4. set<Edge*> edgSet;
  5. node *nod = new node;
  6. node *n = nod;
  7. queue.push(graph->getInitialNode());
  8. while(!queue.empty()){
  9. node* orgnod = queue.front();
  10. queue.pop();
  11. for(int i = 0; i < orgnod->getEdgeOutList().size(); i++){
  12. if(edgSet.find(orgnod->getEdgeOutList()[i]) != edgSet.end()){
  13. //check for node,push
  14. //create one
  15. //set as copy
  16. //add to set
  17.  
  18. }//else
  19. //get node copy, push
  20. //create edge
  21. //add to set
  22. }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement