cgrapht 1.0.0
A modern C++20 header-only graph library
Loading...
Searching...
No Matches
graph.hpp File Reference

This class represents a generic Directed Graph. More...

#include <unordered_set>
#include <functional>
#include <ranges>
#include <unordered_map>
#include "cgrapht/commons.hpp"
#include "models.hpp"
+ Include dependency graph for graph.hpp:

Go to the source code of this file.

Classes

struct  cgrapht::Edge< E >
 Edge record for a directed graph. More...
 
class  cgrapht::DirectedGraph< V, E >
 Directed graph with hashed vertex and edge ids. More...
 

Namespaces

namespace  cgrapht
 

Detailed Description

This class represents a generic Directed Graph.

@Detail This class provides a generic implementation of a directed graph with hashed vertex and edge ids. It provides interfaces for constructing a graph by adding vertices and edges. Adding any item in a graph like a vertex or edge returns an identifier that can be used later to retrieve the item.

Also, this graph operates on an identifier / query based approach. Any graph operations like fetching neighbouring vertices or getting a list of edges do not return the actual vertex or edge, but the said identifiers. You can use these identifiers to retrieve the actual vertex or edge from the graph.

Definition in file graph.hpp.