1#ifndef GRAPHLIB_INTERNAL_ABSTRACT_UNDIRECTED_GRAPH_H
2#define GRAPHLIB_INTERNAL_ABSTRACT_UNDIRECTED_GRAPH_H
26namespace GraphLib::Internal {
41template <val
id_data_type D, val
id_
id_type I, val
id_edge_type<I> E>
66 throw std::invalid_argument(
"Node with ID from_id does not exist");
69 throw std::invalid_argument(
"Node with ID to_id does not exist");
71 if (!this->
adj_list_.has_edge(from_id, to_id) || !this->adj_list_.has_edge(to_id, from_id)) {
72 throw std::invalid_argument(
"Nodes don't have an edge");
75 this->
adj_list_.remove_edge(from_id, to_id);
76 this->
adj_list_.remove_edge(to_id, from_id);
Defines the generic abstract Graph class template supporting directed/undirected and weighted/unweigh...
Abstract base class for a generic graph structure.
bool node_exists(const id_type id) const
Check if a node with the specified ID exists.
AdjacencyList< id_type, edge_type > adj_list_
Stores edges as adjacency list.
A graph class representing undirected graphs.
void remove_edge(I from_id, I to_id) override
Removes an undirected edge between two nodes.
bool is_directed() const override
Indicates that this graph is undirected.
Defines C++20 concepts used for type constraints in the GraphLib library.