Лабораторная работа по Алгоритмам и структурам данных. Курсова работа по АиСД. Палунин Артем. Отчет по Курсовой работе по дисциплине Алгоритмы и структуры данных Тема Графы Студент гр. 9891 Палунин А. И. Преподаватель
Скачать 176.26 Kb.
|
} cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 5: \n"; swap(massive_temp_3[0][0], massive_temp_3[0][1]); swap(massive_temp_3[1][0], massive_temp_3[1][1]); swap(massive_temp_3[2][0], massive_temp_3[2][1]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 6: \n"; swap(massive_temp_3[0][1], massive_temp_3[0][2]); swap(massive_temp_3[1][1], massive_temp_3[1][2]); swap(massive_temp_3[2][1], massive_temp_3[2][2]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка столбцов завершена. \n";//вторая строка поменялась со третьей ///////////////////////////////////////////////////////////////////////////////////// cout << "Перестановка строки № 3 (первая со второй): \n"; swap(massive_temp_3[0][0], massive_temp_3[1][0]); swap(massive_temp_3[0][1], massive_temp_3[1][1]); swap(massive_temp_3[0][2], massive_temp_3[1][2]); if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 1: \n"; swap(massive_temp_3[0][0], massive_temp_3[0][1]); swap(massive_temp_3[1][0], massive_temp_3[1][1]); swap(massive_temp_3[2][0], massive_temp_3[2][1]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 2: \n"; swap(massive_temp_3[0][1], massive_temp_3[0][2]); swap(massive_temp_3[1][1], massive_temp_3[1][2]); swap(massive_temp_3[2][1], massive_temp_3[2][2]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 3: \n"; swap(massive_temp_3[0][0], massive_temp_3[0][1]); swap(massive_temp_3[1][0], massive_temp_3[1][1]); swap(massive_temp_3[2][0], massive_temp_3[2][1]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 4: \n"; swap(massive_temp_3[0][1], massive_temp_3[0][2]); swap(massive_temp_3[1][1], massive_temp_3[1][2]); swap(massive_temp_3[2][1], massive_temp_3[2][2]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 5: \n"; swap(massive_temp_3[0][0], massive_temp_3[0][1]); swap(massive_temp_3[1][0], massive_temp_3[1][1]); swap(massive_temp_3[2][0], massive_temp_3[2][1]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; goto exit; } cout << "Перестановка № 6: \n"; swap(massive_temp_3[0][1], massive_temp_3[0][2]); swap(massive_temp_3[1][1], massive_temp_3[1][2]); swap(massive_temp_3[2][1], massive_temp_3[2][2]); for (int i = 0; i < number_node_temp_2; i++) { for (int j = 0; j < number_edge_temp_2; j++) { cout << "|"; cout << setfill('_'); cout << setw(3) << massive_temp_3[i][j]; } cout << setw(3) << "|N_" << i + 1 << "\n"; } if (massive_2[0][0] == massive_temp_3[0][0] && massive_2[0][1] == massive_temp_3[0][1] && massive_2[0][2] == massive_temp_3[0][2] && massive_2[1][0] == massive_temp_3[1][0] && massive_2[1][1] == massive_temp_3[1][1] && massive_2[1][2] == massive_temp_3[1][2] && massive_2[2][0] == massive_temp_3[2][0] && massive_2[2][1] == massive_temp_3[2][1] && massive_2[2][2] == massive_temp_3[2][2]) { cout << "Данный граф является изоморфным. Поиск завершен\n"; |