This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
8,119 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<p align="center">Министерство образования Республики Беларусь</p> | ||
<p align="center">Учреждение образования</p> | ||
<p align="center">«Брестский государственный технический университет»</p> | ||
<p align="center">Кафедра ИИТ</p> | ||
<br/><br/><br/><br/><br/> | ||
<p align="center">Лабораторная работа №3</p> | ||
<p align="center">За третий семестр</p> | ||
<p align="center">По дисциплине: «Общая теория интеллектуальных систем»</p> | ||
<p align="center">Тема: «Разработка редакторов графов»</p> | ||
<br/><br/><br/><br/><br/> | ||
<p align="right">Выполнила:</p> | ||
<p align="right">Студентка 2 курса</p> | ||
<p align="right">Группы ИИ-23</p> | ||
<p align="right">Волкогон Н.И.</p> | ||
<br/><br/> | ||
<p align="right">Проверил:</p> | ||
<p align="right">Иванюк Д.С.</p> | ||
|
||
<p align="center">Брест 2023 <br/> | ||
|
||
-- | ||
# В работе было реализованно: # | ||
1. Разработка и реализация программного продукта позволяющего | ||
редактировать графовые конструкции различных видов и производить над | ||
ними различные действия. | ||
|
||
2. Редактор позволяет: | ||
a) одновременно работать с несколькими графами (MDI); | ||
b) **[\*]** выделение одновременно нескольких элементов графа, копирование | ||
выделенного фрагмента в clipboard и восстановление из него; | ||
c) задавать имена графам; | ||
d) сохранять и восстанавливать граф во внутреннем формате программы; | ||
e) экспортировать и импортировать граф в текстовый формат (описание | ||
см. ниже); | ||
f) создавать, удалять, именовать, переименовывать, перемещать узлы; | ||
g) создавать неориентированные дуги, удалять дуги; | ||
h) добавлять, удалять и редактировать содержимое узла (содержимое в | ||
виде текста и ссылки на файл); | ||
i) задавать цвет дуги и узла, образ узла; | ||
j) **[\*]** создавать и отображать петли; | ||
k) **[\*]** создавать и отображать кратные дуги. | ||
|
||
3. Программный продукт позволяет выполнять следующие операции: | ||
a) выводить информацию о графе; | ||
b) поиск всех путей (маршрутов) между двумя узлами и кратчайших; | ||
c) вычисление расстояния между двумя узлами; | ||
d) **[\*]** раскраска графа; | ||
e) нахождения эйлеровых циклов. | ||
|
||
4. Отчет по выполненной лабораторной работе в .md формате (readme.md). Разместить его в следующем каталоге: **trunk\ii0xxyy\task_03\doc** (где **xx** - номер группы, **yy** - номер студента, например **ii02302**). | ||
|
||
5. Исходный код разработанной программы разместить в каталоге: **trunk\ii0xxyy\task_03\src**. | ||
nk\ii0xxyy\task_04\doc. | ||
|
||
![Снимок экрана (1)](1.png) | ||
![Снимок экрана (2)](2.png) | ||
![Снимок экрана (3)](3.png) | ||
![Снимок экрана (4)](4.png) | ||
![Снимок экрана (5)](5.png) | ||
![Снимок экрана (6)](6.png) | ||
![Снимок экрана (7)](7.png) | ||
![Снимок экрана (8)](8.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(otis_3) | ||
|
||
set(SOURCES | ||
Source.cpp | ||
library.cpp | ||
) | ||
|
||
set(HEADERS | ||
header.h | ||
) | ||
|
||
add_executable(OTIS_03 ${SOURCES} ${HEADERS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <vector> | ||
#include "..\Graph_lib\Header.h"; | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
string str; | ||
cout << "Enter file's name: "; | ||
cin >> str; | ||
ifstream fin(str); | ||
int vertexCount, edgesCount; | ||
fin >> vertexCount >> edgesCount; | ||
|
||
int** matrix = new int* [vertexCount]; | ||
for (int i = 0; i < vertexCount; i++) | ||
matrix[i] = new int[vertexCount]; | ||
vector<bool> used(vertexCount); | ||
int res; | ||
int* path = new int[vertexCount]; | ||
int* f = new int[vertexCount]; | ||
//menu | ||
int go; | ||
do | ||
{ | ||
cout << "1. Fill Matrix\n"; | ||
cout << "2. Paint Matrix\n"; | ||
cout << "\nlab1\n3. bfs\n"; | ||
cout << "4. dfs\n"; | ||
cout << "\nlab2\n5. Gamilton\n"; | ||
cout << "6. Euler\n"; | ||
cout << "\nlab3\n7. Dijkstra\n"; | ||
cout << "8. Floyd\n"; | ||
cout << "\nlab5\n9. Prim\n"; | ||
cout << "10.Kruskal\n"; | ||
cout << "\nlab4\n11. Kali\n"; | ||
cout << "12. Permutation\n"; | ||
cout << "\nlab6\n13. Strong connectivity\n"; | ||
cout << "14.Biconnected Components\n"; | ||
cout << "0. End\n"; | ||
cout << "Choise: "; | ||
cin >> go; | ||
switch (go) | ||
{ | ||
case 1://Fill | ||
system("cls"); | ||
Fill_Matrix(matrix, vertexCount, edgesCount, str); | ||
break; | ||
|
||
case 2://Paint | ||
system("cls"); | ||
Paint_Matrix(matrix, vertexCount); | ||
break; | ||
|
||
case 3://bfs | ||
system("cls"); | ||
res = 0; | ||
for (int i = 0; i < vertexCount; i++) | ||
if (!used[i]) | ||
{ | ||
res++; | ||
bfs(matrix, vertexCount, i, used); | ||
} | ||
cout << endl << "Number of connectivity components: " << res << endl; | ||
break; | ||
|
||
case 4://dfs | ||
system("cls"); | ||
res = 0; | ||
for (int i = 0; i < vertexCount; i++) | ||
if (!used[i]) | ||
{ | ||
res++; | ||
dfs(matrix, vertexCount, i, used); | ||
} | ||
cout << endl << "Number of connectivity components: " << res << endl; | ||
break; | ||
|
||
case 5://Gamilton | ||
system("cls"); | ||
int v0; | ||
cout << "Enter firts vertex: "; | ||
cin >> v0; | ||
v0--; | ||
for (int i = 0; i < vertexCount; i++) | ||
f[i] = -1; | ||
f[v0] = v0; | ||
path[0] = v0; | ||
if (Gamilton(matrix, path, f, vertexCount, 1, v0)) | ||
{ | ||
Print_Path(path, vertexCount); | ||
cout << endl; | ||
} | ||
else cout << "No results\n"; | ||
break; | ||
|
||
case 6://Euler | ||
system("cls"); | ||
|
||
if ( res > 1) | ||
cout << "Wrong\n"; | ||
else | ||
{ | ||
|
||
int check = 0; | ||
int buf; | ||
for (int i = 0; i < vertexCount; i++) | ||
{ | ||
buf = 0; | ||
for (int j = 0; j < vertexCount; j++) | ||
buf += matrix[i][j]; | ||
if (buf % 2) | ||
check++; | ||
} | ||
if (check) | ||
cout << "Wrong\n"; | ||
else | ||
{ | ||
|
||
vector<int>path; | ||
Euler(matrix, path, vertexCount); | ||
for (int i = 1; i < path.size(); i++) | ||
cout << path[i] + 1 << " "; | ||
cout << endl; | ||
break; | ||
} | ||
} | ||
|
||
case 7: | ||
system("cls"); | ||
Dijkstra(matrix,vertexCount); | ||
break; | ||
|
||
case 8: | ||
system("cls"); | ||
Floyd(matrix, vertexCount); | ||
break; | ||
|
||
case 9: | ||
system("cls"); | ||
Prim(matrix, vertexCount); | ||
break; | ||
|
||
case 10: | ||
system("cls"); | ||
main_kruskal(matrix,vertexCount, edgesCount,str); | ||
break; | ||
|
||
case 11: | ||
system("cls"); | ||
Kali(); | ||
break | ||
; | ||
case 12: | ||
system("cls"); | ||
Permutation(str); | ||
break; | ||
|
||
case 13: | ||
system("cls"); | ||
StrongConnectedComponents(matrix, vertexCount); | ||
break; | ||
case 14: | ||
system("cls"); | ||
FindArtPointsAndBridges(matrix, vertexCount); | ||
break; | ||
} | ||
} while (go); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using namespace std; | ||
#pragma once | ||
void dfs(int**, int, int, vector<bool>&); | ||
void bfs(int**, int, int, vector<bool>&); | ||
void Fill_Matrix(int**&, int, int, string); | ||
void Paint_Matrix(int**&, int); | ||
bool Gamilton(int**&, int*&, int*&, int, int, int); | ||
void Print_Path(int*&, int); | ||
void Euler(int**&, vector<int>&, int); | ||
void Dijkstra(int**&, int); | ||
void Floyd(int**&, int); | ||
void Prim(int**&, int); | ||
int parent(int*, int); | ||
void union_find(int*, int, int); | ||
void Kruskal(pair<int, pair <int, int>>*, int*, int**&, int, int); | ||
void main_kruskal(int**&, int, int, string); | ||
void Kali(); | ||
void Permutation(string); | ||
void StrongConnectedComponents(int**&, int); | ||
//void findBiconnectedComponents(int**&, int); | ||
void FindArtPointsAndBridges(int**&, int); |
Oops, something went wrong.