9# include <gtest/gtest.h>
58 bool found =
bibfs(g, n0, n3, path);
74 bool found =
bibfs(g, n0, n0, path);
90 bool found =
bibfs(g, n0, n1, path);
105 bool found =
bibfs(g, n0, n0, path);
127 bool found =
bibfs(g, n0, n3, path);
153 bool found =
bibfs(g, n0, n3, path);
190 bool found =
bibfs(g, n0, n3, path);
208 bool found =
bibfs(g, n0, n1, path);
233 bool found =
bibfs(g, n0, n2, path);
254 bool found =
bibfs(g, n0, n2, path);
287 bool found =
bibfs(g, n0, n3, path);
359 for (
int i = 0; i <
N; ++i)
362 for (
int i = 0; i <
N - 1; ++i)
387 auto path =
bibfs(g, n0, n2);
412 bool found =
bibfs(g, n1, n4, path);
446 bool found =
bibfs(g, n3, n6, path);
458 auto n0 = g.insert_node(0);
459 auto n1 = g.insert_node(1);
460 auto n2 = g.insert_node(2);
462 g.insert_arc(n0, n1, 0);
463 g.insert_arc(n1, n2, 0);
468 bool found =
bibfs(g, n0, n2, path);
480 auto n0 = g.insert_node(0);
481 auto n1 = g.insert_node(1);
483 g.insert_arc(n0, n1, 0);
487 bool found =
bibfs(g, n1, n0, p2);
498 auto n0 = g.insert_node(0);
499 auto n1 = g.insert_node(1);
500 auto n2 = g.insert_node(2);
501 auto n3 = g.insert_node(3);
503 g.insert_arc(n0, n1, 0);
504 g.insert_arc(n1, n2, 0);
505 g.insert_arc(n2, n3, 0);
509 bool found =
bibfs(g, n0, n3, path);
582 bool found =
bibfs(g, n0, n4, path);
605 for (
int i = 0; i <
N; ++i)
609 for (
int i = 0; i <
N - 1; ++i)
616 for (
int start = 0; start <
N; start += 3)
617 for (
int end = start + 1; end <
N; end += 2)
627 <<
"Mismatch for start=" << start <<
" end=" << end;
630 <<
"Length mismatch for start=" << start <<
" end=" << end;
644 for (
int c = 0; c <
COLS; ++c)
648 for (
int c = 0; c <
COLS; ++c)
Bidirectional BFS for shortest unweighted path.
WeightedDigraph::Node Node
static Array create(size_t n)
Create an array with n logical elements.
Bidirectional BFS for finding shortest unweighted paths.
Generic directed graph (digraph) wrapper template.
typename BaseGraph::Arc Arc
typename BaseGraph::Node Node
bool has_curr() const noexcept
Return true if the iterator has current item.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Busca en amplitud un camino entre un par de nodos.
virtual Node * insert_node(Node *node) noexcept
Insertion of a node already allocated.
Graph_Node< int > Node
The graph type.
Graph_Arc< int > Arc
The node class type.
Arc * insert_arc(Node *src_node, Node *tgt_node, void *a)
Iterator on nodes and arcs of a path.
bool is_empty() const noexcept
Return true if the path is empty.
DynArray< Graph::Node * > nodes
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
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.
size_t path_edge_count(Path< G > &p)
Path finding algorithms in graphs.
Generic graph and digraph implementations.