Advertisement
maxattax97

FragmentFrom

Jul 15th, 2021
1,301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     FragmentFrom(vertices)
  2.     {
  3.         // Create a new graph with only the desired vertices.
  4.         const g = new ServiceGraph(); // TODO: In the super class it's just `new Graph()` ...
  5.  
  6.         _.each(vertices, (vertex) =>
  7.         {
  8.             g.AddVertex(_.cloneDeep(vertex));
  9.         });
  10.  
  11.         // Prune edges with missing vertices.
  12.         g._prune();
  13.  
  14.         return g;
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement