Guest User

Untitled

a guest
Jan 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.52 KB | None | 0 0
  1. //WORK AREA: START
  2.  
  3.     {
  4.         VertexMap vertexMap;
  5.         vertexMap.clear();
  6.  
  7.         int n = boost::num_vertices(educt);
  8.         std::vector<int> useList(n, 0);
  9.         std::vector<std::vector<int> > assignmentMatrix(n, std::vector<int>(n, 0));
  10.  
  11.         bforeach(Vertex ev, boost::vertices(educt)){
  12.             bforeach(Vertex pv, boost::vertices(product)) {
  13.                 unsigned int evID = getVertexId(ev, educt);
  14.  
  15.                 if(getVertexLabel(ev, product) == getVertexLabel(pv, product)) {
  16.                     assignmentMatrix[ev][pv] = 1;
  17.                 }
  18.             }
  19.         }
  20.  
  21.         for (int i = 0; i < n; i++) {
  22.             for (int j = 0; j < n; j++) {
  23.                 if (assignmentMatrix[i][j] == 1) {
  24.                     std::vector<std::string> elist = neighbourList(i, educt);
  25.                     std::vector<std::string> plist = neighbourList(j, product);
  26.                     std::vector<std::vector<int> > matrix = matchMatrix(elist,plist);
  27.                     int k = matrix.size();
  28.                     if(!cover(matrix,k,0)){
  29.                         assignmentMatrix[i][j]=0;
  30.                     }
  31.                 }
  32.             }
  33.         }
  34.  
  35.  
  36.  
  37.  
  38.     //----------------------------------------------------------
  39.     //Find clever ways of pruning the space of legal assignments
  40.     //----------------------------------------------------------
  41.     // Printing out the Assignmentmatrix
  42.         std::cout << "Legal assignments\n";
  43.         std::cout << n + " \n";
  44.         for (int i = 0; i < n; i++) {
  45.             for (int j = 0; j < n; j++) {
  46.                 std::cout << assignmentMatrix[i][j] << " ";
  47.             }
  48.             std::cout << "\n";
  49.         }
  50.  
  51.         std::cout << "Done printing AM \n";
  52.         std::vector<int> used(n,0);
  53.         permuter(assignmentMatrix, used, vertexMap, 0, educt, product);
  54.         std::cout << "Done permuting \n";
Add Comment
Please, Sign In to add comment