File tree 2 files changed +26
-6
lines changed
2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 3.17 )
1
+ cmake_minimum_required (VERSION 3.10 )
2
2
project (graphs_cpp)
3
3
4
4
set (CMAKE_CXX_STANDARD 17)
9
9
add_compile_options (-Wall -Wextra -Wpedantic)
10
10
endif ()
11
11
12
- add_executable (graphs_test main.cpp)
12
+ add_executable (graphs_test main.cpp)
Original file line number Diff line number Diff line change 1
- # WIP: C++ code for graphs
1
+ # Graphs with modern C++
2
+
3
+ ## General
4
+ - Code for graph problems
5
+ - uses modern C++ instead of ` new ` and other dated patterns; e.g.
6
+ - ` std::vector `
7
+ - ` std::unique_ptr `
8
+ - this is an example project and not a huge library
9
+
10
+ ## Compilation
11
+ - Manually: ` g++ -std=c++17 -O3 main.cpp -o graphs_test `
12
+ - or with ` cmake ` :
13
+ ``` bash
14
+ mkdir build
15
+ cd build/
16
+ cmake ..
17
+ make
18
+ ```
2
19
3
20
## ` Graph.h `
4
21
- Simple ` Graph ` interface
5
22
- ` AdjacencyListGraph ` (https://en.wikipedia.org/wiki/Adjacency_list )
6
23
- Utility functions (a few)
7
- - Depth First Search
8
- - Breadth First Search
24
+ - Depth-first Search (DFS, https://en.wikipedia.org/wiki/Depth-first_search )
25
+ - Breadth-first Search (BFS, https://en.wikipedia.org/wiki/Breadth-first_search )
9
26
10
27
## ` main.cpp `
11
28
- Basic test of ` Graph.h ` functionality
12
- - Reads graphs from standard input or file given as program argument (` ./graphs_test < tinyG.txt ` )
29
+ - Reads graphs from standard input ( ` ./graphs_test < tinyG.txt ` ) or file given as program argument (` ./graphs_test tinyG.txt ` )
13
30
![ ] ( picTinyG.png )
31
+
32
+ ## References
33
+ - Algorithms, [ Part II] ( https://www.coursera.org/learn/algorithms-part2/home/welcome ) by Princeton University (Robert Sedgewick, Kevin Wayne)
You can’t perform that action at this time.
0 commit comments