diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..b4daea4 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +22s_pa03 \ No newline at end of file diff --git a/.idea/22s-pa03-girvan-newman-sanasimps.iml b/.idea/22s-pa03-girvan-newman-sanasimps.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/22s-pa03-girvan-newman-sanasimps.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e79e477 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index b0d764a..7bfe348 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project(22s_pa03) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS_RELEASE -O3) +set(BOOST_ROOT "/usr/local/Cellar/boost/1.78.0_1/include") +find_package(Boost 1.78.0) +include_directories(${BOOST_ROOT}) + #set(1 file1) #foreach(file IN LISTS 1) diff --git a/src/main.cpp b/src/main.cpp index 7b6f2b5..3cb82ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,17 +3,46 @@ // #include +#include +#include +#include +#include +#include -using namespace std; int main(int argc, char** argv) { - cout << "Hello CS3353, your arguments were: "; - for (int i = 1; i < argc; i++) { - cout << argv[i]; - if (i < argc - 1) - cout << ", "; - } - cout << endl << endl; +// cout << "Hello CS3353, your arguments were: "; +// for (int i = 1; i < argc; i++) { +// cout << argv[i]; +// if (i < argc - 1) +// cout << ", "; +// } +// cout << endl << endl; +// +// return 0; + + + // create a typedef for the Graph type + typedef boost::adjacency_list Graph; + + // Make convenient labels for the vertices + enum { A, B, C, D, E, N }; + const int num_vertices = N; + const char* name = "ABCDE"; + + // writing out the edges in the graph + typedef std::pair Edge; + Edge edge_array[] = + { Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C), + Edge(C,E), Edge(B,D), Edge(D,E) }; + const int num_edges = sizeof(edge_array)/sizeof(edge_array[0]); + + // declare a graph object + Graph g(num_vertices); + + // add the edges to the graph object + for (int i = 0; i < num_edges; ++i) + add_edge(edge_array[i].first, edge_array[i].second, g); return 0; } \ No newline at end of file