51#include <lal/basic_types.hpp>
52#include <lal/graphs/graph.hpp>
53#include <lal/graphs/undirected_graph.hpp>
176 const bool norm =
true,
177 const bool check_norm =
true
201 const
bool norm = true,
202 const
bool check_norm = true
240 const std::vector<
edge>& edges,
241 const
bool norm = true,
242 const
bool check_norm = true
273 const std::vector<
edge>& edges,
274 const
bool norm = true,
275 const
bool check_norm = true
315 const
bool norm = true,
316 const
bool check_norm = true
337 (const std::vector<
edge>& edges, const
bool norm = true, const
bool check_norm = true)
358 (const
node u, const
bool norm = true, const
bool check_norm = true)
451 (
const bool norm =
true,
const bool check =
true)
470 virtual
void _init(const uint64_t n) noexcept {
Directed graph class.
Definition directed_graph.hpp:67
std::vector< neighbourhood > m_in_adjacency_list
In-neighbors for every node.
Definition directed_graph.hpp:459
std::vector< edge_pair > get_Q() const noexcept
Returns all independent pairs of edges of this graph.
void move_full_directed_graph(directed_graph &&d) noexcept
Moves all members of this class and the parent class.
Definition directed_graph.hpp:505
directed_graph() noexcept
Empty constructor.
Definition directed_graph.hpp:72
virtual void actions_after_add_edges(const edge_list &e) noexcept
Do some extra work after the addition of several edges.
virtual directed_graph & add_edges(const std::vector< edge > &edges, const bool norm=true, const bool check_norm=true) noexcept
Adds a list of directed edges to the graph.
void finish_bulk_add(const bool norm=true, const bool check=true) noexcept
Completes the inner structure of the graph after adding a bulk of edges.
bool check_normalized() noexcept
Checks if the graph is normalized.
uint64_t get_out_degree(const node u) const noexcept
Returns the out-degree of a node.
Definition directed_graph.hpp:420
directed_graph & add_edge_bulk(const node s, const node t) noexcept
Adds an edge to the graph.
void copy_full_directed_graph(const directed_graph &d) noexcept
Copies all members of this class and the parent class.
Definition directed_graph.hpp:497
virtual void actions_after_remove_edge(const node u, const node v) noexcept
Do some extra work after the removal of an edge.
virtual directed_graph & remove_edge(const node s, const node t, const bool norm=true, const bool check_norm=true) noexcept
Remove an edge from this graph.
directed_graph(const directed_graph &g) noexcept
Copy constructor.
Definition directed_graph.hpp:84
uint64_t get_degree(const node u) const noexcept
Returns the in-degree plus the out-degree of this vertex.
Definition directed_graph.hpp:416
virtual void actions_after_add_edges_bulk() noexcept
Do some extra work after the addition of several edges in bulk.
void reserve_in_degree(const node u, const uint64_t d) noexcept
Predicts that the in-degree of node u is d.
Definition directed_graph.hpp:128
virtual void _init(const uint64_t n) noexcept
Initializes the memory in the graph hierarchy.
Definition directed_graph.hpp:470
bool is_directed() const noexcept
Returns whether this graph is directed or not.
Definition directed_graph.hpp:434
void remove_single_edge(const node u, const node v, neighbourhood &out_u, neighbourhood &in_v) noexcept
Removes a single edge.
void normalize() noexcept
Normalizes the graph.
bool is_undirected() const noexcept
Returns whether this graph is undirected or not.
Definition directed_graph.hpp:435
virtual void _clear() noexcept
Clears the memory of directed_graph and graph classes.
Definition directed_graph.hpp:475
virtual directed_graph & set_edges(const std::vector< edge > &edges, const bool norm=true, const bool check_norm=true) noexcept
Sets the list of edges to the graph.
virtual directed_graph & remove_edge_bulk(const node s, const node t) noexcept
Removes an edge from the graph.
const neighbourhood & get_in_neighbors(const node u) const noexcept
Returns the in-neighbors of node u.
Definition directed_graph.hpp:401
virtual void actions_after_remove_node(const node u) noexcept
Do some work before the removal of a vertex.
virtual directed_graph & remove_edges(const std::vector< edge > &edges, const bool norm=true, const bool check_norm=true) noexcept
Remove an edge from this graph.
virtual directed_graph & remove_edges_incident_to(const node u, const bool norm=true, const bool check_norm=true) noexcept
Remove all edges incident to a given vertex.
directed_graph & operator=(const directed_graph &g) noexcept
Copy assignment operator.
Definition directed_graph.hpp:105
void finish_bulk_remove(const bool norm=true, const bool check=true) noexcept
Completes the inner structure of the graph after removing edges in bulk.
virtual void actions_after_remove_edges_bulk() noexcept
Do some extra work after the removal of several edges in bulk.
const neighbourhood & get_out_neighbors(const node u) const noexcept
Returns the out-neighbors of node u.
Definition directed_graph.hpp:390
virtual directed_graph & add_node() noexcept
Adds a node to the graph.
Definition directed_graph.hpp:154
virtual ~directed_graph() noexcept
Destructor.
Definition directed_graph.hpp:97
uint64_t get_in_degree(const node u) const noexcept
Returns the in-degree of a node.
Definition directed_graph.hpp:427
virtual directed_graph & remove_node(const node u, const bool norm=true, const bool check_norm=true) noexcept
Remove a node from this graph.
bool has_edge(const node u, const node v) const noexcept
Returns true if the edge exists in the graph.
virtual void actions_after_add_edge(const node u, const node v) noexcept
Do some extra work after the addition of an edge.
directed_graph & disjoint_union(const directed_graph &g) noexcept
Disjoint union of graphs.
directed_graph(const uint64_t n) noexcept
Constructor with number of nodes.
Definition directed_graph.hpp:77
directed_graph(directed_graph &&g) noexcept
Move constructor.
Definition directed_graph.hpp:92
virtual directed_graph & add_edge(const node s, const node t, const bool norm=true, const bool check_norm=true) noexcept
Adds a directed edge to the graph.
void reserve_out_degree(const node u, const uint64_t d) noexcept
Predicts that the out-degree of node u is d.
Definition directed_graph.hpp:142
undirected_graph to_undirected(const bool norm=true, const bool check=true) const noexcept
Converts this directed graph into an undirected graph.
std::vector< directed_graph > get_connected_components() const noexcept
Returns all the connected components of this graph as individual graphs.
virtual void actions_after_remove_edges(const edge_list &e) noexcept
Do some extra work after the removal of several edges.
std::vector< edge > get_edges() const noexcept
Returns all edges of this graph.
virtual void actions_before_remove_edges_incident_to(const node u) noexcept
Do some work before all edges incident to a node is removed.
Abstract class for graphs.
Definition graph.hpp:68
virtual void init(const uint64_t n) noexcept
Allocates the necessary memory for this class.
void copy_full_graph(const graph &g) noexcept
Copies all members of this class.
Definition graph.hpp:268
uint64_t get_num_nodes() const noexcept
Returns the number of ndoes.
Definition graph.hpp:207
virtual void _clear() noexcept
Clears memory for the graph class.
Definition graph.hpp:261
graph() noexcept
Empty constructor.
Definition graph.hpp:73
bool has_node(const node u) const noexcept
Returns true if node u is in this graph.
Definition graph.hpp:201
virtual void _init(const uint64_t n) noexcept
Initializes memory of graph class.
Definition graph.hpp:255
void move_full_graph(graph &&g) noexcept
Moves all members of this class.
Definition graph.hpp:274
std::vector< neighbourhood > m_adjacency_list
Data structure that implements the graph.
Definition graph.hpp:232
void __add_node() noexcept
Adds a node to the graph.
Definition graph.hpp:284
Undirected graph class.
Definition undirected_graph.hpp:66
Main namespace of the library.
Definition basic_types.hpp:48
std::pair< edge, edge > edge_pair
Edge pair type.
Definition basic_types.hpp:62
std::pair< node, node > edge
See Edge page for further details.
Definition basic_types.hpp:56
std::vector< edge > edge_list
See Edge list page for further details.
Definition basic_types.hpp:60
uint64_t node
Node type. See Node / Vertex page for further details.
Definition basic_types.hpp:51
std::vector< node > neighbourhood
List of nodes.
Definition basic_types.hpp:64