-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
19 lines (15 loc) · 922 Bytes
/
Copy pathmain.py
File metadata and controls
19 lines (15 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from classes import AvailableGraphs
from utils import Utils, GraphAlgorithms
print('Obligatorio TDC\n')
availableGraphs = AvailableGraphs.AvailableGraphs(Utils.GetGraphs())
for graph in availableGraphs.graphs:
print(graph)
print("BFS(0):", GraphAlgorithms.BreadthFirstSearch(graph, "0"))
print("DFS(0):", GraphAlgorithms.DepthFirstSearch(graph, "0"))
print("Connected Components:", GraphAlgorithms.GetConnectedComponents(graph))
print("Get is connected:", GraphAlgorithms.GetIsConnected(graph))
print("Get connected components amount:", GraphAlgorithms.GetConnectedComponentsAmount(graph))
print("Shortest Path:", GraphAlgorithms.GetShortestPath(graph, "0", "3"))
print("Shortest Path Length:", GraphAlgorithms.GetShortestPathLength(graph, "0", "3"))
print("Is Shortest Path?:", GraphAlgorithms.CompareShortestPaths(graph, ['0','2','5','3']))
print("-------------------------")