45#include <gtest/gtest.h>
63 std::vector<Node*>
nodes;
64 for (
size_t i = 0; i < n; ++i)
66 for (
size_t i = 0; i < n - 1; ++i)
74 std::vector<Node*>
nodes;
75 for (
size_t i = 0; i < n; ++i)
77 for (
size_t i = 0; i < n; ++i)
333 for (
auto a : arc_list) {
444 for (
typename GT::Node_Iterator it(
blk); it.has_curr(); it.next())
512 std::vector<Node*>
nodes;
513 for (
int i = 0; i < 4; ++i)
517 for (
int i = 0; i < 4; ++i)
518 for (
int j = 0; j < 4; ++j)
606 const size_t N = 500;
608 std::vector<Node*>
nodes;
609 for (
size_t i = 0; i <
N; ++i)
613 for (
size_t i = 0; i <
N; ++i)
663 const size_t N = 100;
664 std::vector<Node*>
nodes;
666 for (
size_t i = 0; i <
N; ++i)
670 for (
size_t i = 0; i <
N; ++i)
671 for (
size_t j = 0; j <
N; ++j)
704 for (
size_t i = 0; i <
N; ++i)
719 std::vector<Node*>
nodes;
720 for (
int i = 0; i < 5; ++i)
724 for (
size_t i = 0; i < 4; ++i) {
756 ::testing::InitGoogleTest(&
argc,
argv);
Tarjan's algorithm for strongly connected components.
WeightedDigraph::Node Node
Generic directed graph (digraph) wrapper template.
typename BaseGraph::Arc Arc
typename BaseGraph::Node Node
Dynamic singly linked list with functional programming support.
T & get_first() const
Return the first item of the list.
size_t size() const noexcept
Count the number of elements of the list.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
DynArray< Graph::Node * > nodes
void kosaraju_connected_components(const GT &g, DynList< GT > &blk_list, DynList< typename GT::Arc * > &arc_list)
Compute strongly connected components using Kosaraju's algorithm.
size_t kosaraju_scc_count(const GT &g)
Count the number of strongly connected components.
bool is_strongly_connected(const GT &g)
Check if a directed graph is strongly connected.
Kosaraju's algorithm for finding strongly connected components.
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
Arc of graph implemented with double-linked adjacency lists.
Functor wrapper for Kosaraju's algorithm.
size_t count_total_nodes(const DynList< DynList< Node * > > &sccs)
GT create_cycle(size_t n)
GT create_chain(size_t n)
Generic graph and digraph implementations.