51#include <lal/definitions.hpp>
52#include <lal/graphs/graph.hpp>
139 (
node s,
node t,
bool norm =
true,
bool check_norm =
true) noexcept;
177 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
206 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
226 (
node s,
node t,
bool norm = false,
bool check_norm = true) noexcept;
249 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
272 (
node u,
bool norm = true,
bool check_norm = true)
328 virtual void _init(uint32_t n)
noexcept;
Abstract class for graphs.
Definition graph.hpp:69
bool has_node(node u) const noexcept
Returns true if node u is in this graph.
Definition graph.hpp:188
graph() noexcept
Empty constructor.
Definition graph.hpp:74
virtual void init(uint32_t n) noexcept
Allocates the necessary memory for this class.
std::vector< neighbourhood > m_adjacency_list
Data structure that implements the graph.
Definition graph.hpp:219
Undirected graph class.
Definition undirected_graph.hpp:67
void disjoint_union(const undirected_graph &g) noexcept
Disjoint union of graphs.
virtual void _clear() noexcept
Clears the memory of undirected_graph and graph classes.
void copy_full_undirected_graph(const undirected_graph &u) noexcept
Copies all members of this class and the parent class.
void move_full_undirected_graph(undirected_graph &&u) noexcept
Moves all members of this class and the parent class.
virtual undirected_graph & remove_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Remove an edge from this graph.
virtual undirected_graph & set_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Sets the edges to the graph.
bool is_undirected() const noexcept
Returns whether this graph is undirected or not.
Definition undirected_graph.hpp:324
bool has_edge(node u, node v) const noexcept
Returns true if the edge exists in the graph.
bool is_directed() const noexcept
Returns whether this graph is directed or not.
Definition undirected_graph.hpp:323
std::vector< edge_pair > get_Q() const noexcept
Returns all independent pairs of edges of this graph.
virtual undirected_graph & remove_edges_incident_to(node u, bool norm=true, bool check_norm=true) noexcept
Remove all edges incident to a given vertex.
virtual undirected_graph & add_edge(node s, node t, bool norm=true, bool check_norm=true) noexcept
Adds an edge to the graph.
undirected_graph(const undirected_graph &g) noexcept
Copy constructor.
Definition undirected_graph.hpp:84
virtual ~undirected_graph() noexcept
Destructor.
Definition undirected_graph.hpp:97
void remove_single_edge(node u, node v, neighbourhood &out_u, neighbourhood &in_v) noexcept
Removes a single edge.
virtual void _init(uint32_t n) noexcept
Initialises memory of undirected_graph and graph classes.
virtual undirected_graph & remove_edge(node s, node t, bool norm=false, bool check_norm=true) noexcept
Remove an edge from this graph.
std::vector< edge > get_edges() const noexcept
Returns all edges of this graph.
undirected_graph & operator=(const undirected_graph &g) noexcept
Copy assignment operator.
Definition undirected_graph.hpp:106
undirected_graph() noexcept
Empty constructor.
Definition undirected_graph.hpp:72
virtual undirected_graph & add_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Adds a list of edges to the graph.
undirected_graph(undirected_graph &&g) noexcept
Move constructor.
Definition undirected_graph.hpp:92
uint32_t get_degree(node u) const noexcept
Returns the number of neighbours of u.
Definition undirected_graph.hpp:313
const neighbourhood & get_neighbours(node u) const noexcept
Returns the neighbourhood of node u.
Definition undirected_graph.hpp:301
undirected_graph(uint32_t n) noexcept
Constructor with number of nodes.
Definition undirected_graph.hpp:77
void finish_bulk_add(bool norm=true, bool check=true) noexcept
Completes the inner structure of the graph after adding a bulk of edges.
undirected_graph & add_edge_bulk(node s, node t) noexcept
Adds an edge to the graph.
Main namespace of the library.
Definition definitions.hpp:48
std::pair< edge, edge > edge_pair
Edge pair type.
Definition definitions.hpp:77
std::pair< node, node > edge
Edge type.
Definition definitions.hpp:75
uint32_t node
Node type.
Definition definitions.hpp:51
std::vector< node > neighbourhood
List of nodes.
Definition definitions.hpp:79