diff --git a/.gitignore b/.gitignore index c87012e..76bdf3a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ # Building build *.swp +.vs diff --git a/src/algorithm.cpp b/src/algorithm.cpp index 6d2ff85..fe959c8 100644 --- a/src/algorithm.cpp +++ b/src/algorithm.cpp @@ -59,7 +59,7 @@ void PrintSolution(std::vector solution) { std::cout << std::endl; } -std::vector UCBFS(Graph graph, int start) { +void UCBFS(Graph graph, int start) { std::queue setds; std::vector dist(graph.nodeCount + 1, -1); setds.push(start); @@ -68,7 +68,6 @@ std::vector UCBFS(Graph graph, int start) { { int tmp = setds.front(); setds.pop(); - std::cout << "tmp: " << tmp << std::endl; for (Edge i : graph.vertices.at(tmp).edges) { int v = i.destination->nodeNumber; diff --git a/src/algorithm.hpp b/src/algorithm.hpp index 9c446b7..936dfa5 100644 --- a/src/algorithm.hpp +++ b/src/algorithm.hpp @@ -30,7 +30,7 @@ struct Graph { Graph ReadInGraph(std::string fileLocation); void PrintSolution(std::vector solution); -std::vector UCBFS(Graph graph, int start); +void UCBFS(Graph graph, int start); std::vector BFS(Graph graph, int start, int end); std::vector DFS(Graph graph, int start, int end); diff --git a/src/main.cpp b/src/main.cpp index 41e0653..02ed746 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,12 +7,18 @@ int main(int argc, char* argv[]) { return 1; } Graph newGraph = ReadInGraph(argv[1]); + std::cout << "BFS" << std::endl; + std::cout << "---" << std::endl; for (int i = 1; i < newGraph.nodeCount + 1; i++) { PrintSolution(BFS(newGraph, 1, i)); } + std::cout << "DFS" << std::endl; + std::cout << "---" << std::endl; for (int i = 1; i < newGraph.nodeCount + 1; i++) { PrintSolution(DFS(newGraph, 1, i)); } - PrintSolution(UCBFS(newGraph, 1)); + std::cout << "UCBFS" << std::endl; + std::cout << "---" << std::endl; + UCBFS(newGraph, 1); return 0; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dc49f2f..1fb45b4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,3 @@ -find_package(Catch2 REQUIRED) include_directories("${CMAKE_CURRENT_SOURCE_DIR}") add_executable(testing ./test-main.cpp @@ -6,4 +5,3 @@ add_executable(testing ../src/algorithm.cpp ) set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX) -target_link_libraries(testing Catch2::Catch2)