Skip to content

nspo/graphs-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphs with modern C++

General

  • Code for graph problems
  • uses modern C++ instead of new and other dated patterns; e.g.
    • std::vector
    • std::unique_ptr
  • this is an example project and not a huge library

Compilation

  • Manually: g++ -std=c++17 -O3 main.cpp -o graphs_test
  • or with cmake:
    mkdir build
    cd build/
    cmake ..
    make

Graph.h

main.cpp

  • Basic test of Graph.h functionality
  • Reads graphs from standard input (./graphs_test < tinyG.txt) or file given as program argument (./graphs_test tinyG.txt)

References

  • Algorithms, Part II by Princeton University (Robert Sedgewick, Kevin Wayne)