![]() |
Graph Cpp
Helper Graph class for C++ with CMake support
|
In the second year of my MIPT DAFE/RSE education, as part of the Algorithms and Data Structures course in C++, we studied graph algorithms. For writing these, a separate Graph class was required.
At that moment, a crazy idea came to my mind: "What if I don't create a `Vertex` class, but create an `Edge` class and put it in the `private` field of the `Graph`?". And so I set out...
Over time, more and more such ideas emerged, and the lines of code grew at a doubled pace... And so this abnormal class was born, with eight static methods - pseudo-constructors, various auxiliary methods for deleting and searching for an edge or vertex, as well as templates for integer and string vertex types (more details - in the examples
folder).
Since the project uses CMake, it is easy to integrate it into projects with the same build system - just clone the project into one folder:
or
and import the subdirectory:
Output: