Defines the generic abstract Graph class template supporting directed/undirected and weighted/unweighted graphs. More...
#include <cstddef>#include <iostream>#include <limits>#include <ostream>#include <queue>#include <set>#include <stdexcept>#include <unordered_map>#include <vector>#include "GraphLib/internal/adjacency_list.h"#include "GraphLib/internal/concepts.h"Go to the source code of this file.
Classes | |
| class | GraphLib::Internal::Graph< D, I, E > |
| Abstract base class for a generic graph structure. More... | |
Functions | |
| template<valid_data_type D, valid_id_type I, valid_edge_type< I > E> | |
| std::ostream & | GraphLib::Internal::operator<< (std::ostream &os, const Graph< D, I, E > &graph) |
| Stream insertion operator for any valid graph type. | |
Defines the generic abstract Graph class template supporting directed/undirected and weighted/unweighted graphs.
This class provides a foundational graph data structure managing nodes with associated data, edges, and adjacency relationships. It includes functions for node/edge inspection, addition, removal, and basic graph queries.
Template Parameters:
The graph maintains a mapping from node IDs to their data and an adjacency list representation for edges.
Definition in file abstract_graph.h.
| std::ostream & GraphLib::Internal::operator<< | ( | std::ostream & | os, |
| const Graph< D, I, E > & | graph ) |
Stream insertion operator for any valid graph type.
Enables printing of the graph object by outputting its adjacency list to the provided ostream. This is the same as calling the print_adjacency_list method on the graph.
Format: NODE_ID : [EDGE, EDGE] with EDGE being either "NODE_ID" or "NODE_ID (WEIGHT)" depending on edge type.
| D | Type of the graph data that satisfies the valid_data_type concept. |
| I | Type of the graph id that satisfies the valid_id_type concept. |
| E | Type of the graph edge that satisfies the valid_edge_type concept. |
| os | Output stream to write the graph representation. |
| graph | Graph object to be printed. |
Definition at line 527 of file abstract_graph.h.