51#include <lal/definitions.hpp>
52#include <lal/graphs/graph.hpp>
53#include <lal/graphs/undirected_graph.hpp>
146 (
node s,
node t,
bool norm = true,
bool check_norm = true) noexcept;
185 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
214 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
235 (
node s,
node t,
bool norm = false,
bool check_norm = true) noexcept;
259 (const std::vector<
edge>& edges,
bool norm = true,
bool check_norm = true)
282 (
node u,
bool norm = true,
bool check_norm = true)
375 (
bool norm =
true,
bool check =
true) const noexcept;
383 virtual
void _init(uint32_t n) noexcept;
Directed graph class.
Definition directed_graph.hpp:68
std::vector< neighbourhood > m_in_adjacency_list
In-neighbours for every node.
Definition directed_graph.hpp:379
virtual directed_graph & add_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Adds a list of directed edges to the graph.
std::vector< edge_pair > get_Q() const noexcept
Returns all independent pairs of edges of this graph.
uint32_t get_degree(node u) const noexcept
Returns the in-degree plus the out-degree of this vertex.
Definition directed_graph.hpp:340
void move_full_directed_graph(directed_graph &&d) noexcept
Moves all members of this class and the parent class.
const neighbourhood & get_out_neighbours(node u) const noexcept
Returns the out-neighbours of node u.
Definition directed_graph.hpp:314
directed_graph() noexcept
Empty constructor.
Definition directed_graph.hpp:73
void remove_single_edge(node u, node v, neighbourhood &out_u, neighbourhood &in_v) noexcept
Removes a single edge.
void copy_full_directed_graph(const directed_graph &d) noexcept
Copies all members of this class and the parent class.
directed_graph(const directed_graph &g) noexcept
Copy constructor.
Definition directed_graph.hpp:85
const neighbourhood & get_in_neighbours(node u) const noexcept
Returns the in-neighbours of node u.
Definition directed_graph.hpp:325
void disjoint_union(const directed_graph &g) noexcept
Disjoint union of graphs.
bool is_directed() const noexcept
Returns whether this graph is directed or not.
Definition directed_graph.hpp:358
virtual directed_graph & remove_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Remove an edge from this graph.
bool has_edge(node u, node v) const noexcept
Returns true if the edge exists in the graph.
bool is_undirected() const noexcept
Returns whether this graph is undirected or not.
Definition directed_graph.hpp:359
virtual void _clear() noexcept
Clears the memory of directed_graph and graph classes.
virtual directed_graph & remove_edge(node s, node t, bool norm=false, bool check_norm=true) noexcept
Remove an edge from this graph.
bool check_normalised() noexcept
Checks if the graph is normalised.
directed_graph(uint32_t n) noexcept
Constructor with number of nodes.
Definition directed_graph.hpp:78
directed_graph & add_edge_bulk(node s, node t) noexcept
Adds an edge to the graph.
directed_graph & operator=(const directed_graph &g) noexcept
Copy assignment operator.
Definition directed_graph.hpp:107
undirected_graph to_undirected(bool norm=true, bool check=true) const noexcept
Converts this directed graph into an undirected graph.
uint32_t get_in_degree(node u) const noexcept
Returns the in-degree of a node.
Definition directed_graph.hpp:351
virtual directed_graph & remove_edges_incident_to(node u, bool norm=true, bool check_norm=true) noexcept
Remove all edges incident to a given vertex.
virtual ~directed_graph() noexcept
Destructor.
Definition directed_graph.hpp:98
virtual directed_graph & add_edge(node s, node t, bool norm=true, bool check_norm=true) noexcept
Adds a directed edge to the graph.
virtual directed_graph & set_edges(const std::vector< edge > &edges, bool norm=true, bool check_norm=true) noexcept
Sets the list of edges to the graph.
void finish_bulk_add(bool norm=true, bool check=true) noexcept
Completes the inner structure of the graph after adding a bulk of edges.
directed_graph(directed_graph &&g) noexcept
Move constructor.
Definition directed_graph.hpp:93
virtual void _init(uint32_t n) noexcept
Initialises memory of directed_graph and graph classes.
void normalise() noexcept
Normalises the graph.
uint32_t get_out_degree(node u) const noexcept
Returns the out-degree of a node.
Definition directed_graph.hpp:344
std::vector< edge > get_edges() const noexcept
Returns all edges of this graph.
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
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