Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //WORK AREA: START
- {
- VertexMap vertexMap;
- vertexMap.clear();
- int n = boost::num_vertices(educt);
- std::vector<int> useList(n, 0);
- std::vector<std::vector<int> > assignmentMatrix(n, std::vector<int>(n, 0));
- bforeach(Vertex ev, boost::vertices(educt)){
- bforeach(Vertex pv, boost::vertices(product)) {
- unsigned int evID = getVertexId(ev, educt);
- if(getVertexLabel(ev, product) == getVertexLabel(pv, product)) {
- assignmentMatrix[ev][pv] = 1;
- }
- }
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- if (assignmentMatrix[i][j] == 1) {
- std::vector<std::string> elist = neighbourList(i, educt);
- std::vector<std::string> plist = neighbourList(j, product);
- std::vector<std::vector<int> > matrix = matchMatrix(elist,plist);
- int k = matrix.size();
- if(!cover(matrix,k,0)){
- assignmentMatrix[i][j]=0;
- }
- }
- }
- }
- //----------------------------------------------------------
- //Find clever ways of pruning the space of legal assignments
- //----------------------------------------------------------
- // Printing out the Assignmentmatrix
- std::cout << "Legal assignments\n";
- std::cout << n + " \n";
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- std::cout << assignmentMatrix[i][j] << " ";
- }
- std::cout << "\n";
- }
- std::cout << "Done printing AM \n";
- std::vector<int> used(n,0);
- permuter(assignmentMatrix, used, vertexMap, 0, educt, product);
- std::cout << "Done permuting \n";
Add Comment
Please, Sign In to add comment