6#include <gtest/gtest.h>
320 const size_t n = 1000;
322 for (
size_t i = 0; i < n; ++i)
330 for (
size_t i = 0; i < n; i += 100)
341 const size_t n = 100;
342 std::vector<Node*>
nodes;
344 for (
size_t i = 0; i < n; ++i)
350 for (
size_t i = 0; i < n - 1; ++i)
363 std::vector<Node*>
nodes;
365 for (
size_t i = 0; i < n; ++i)
370 for (
size_t i = 0; i < n; ++i)
372 for (
size_t j = i + 1; j < n; ++j)
488 auto n2_g1 =
g1.insert_node(2);
491 auto n1_g2 =
g2.insert_node(1);
492 auto n2_g2 =
g2.insert_node(2);
516 auto n2_g1 =
g1.insert_node(2);
WeightedDigraph::Node Node
Builds node and arc indices for fast lookup and retrieval.
size_t get_num_arcs() const
Returns the number of arcs the index contains.
GT_Node * search_node(GT_Node *p)
Looks up a node in the index.
GT_Arc * search_arc(GT_Node *src, GT_Node *tgt)
Looks up an arc in the index given its two nodes.
void remove_node(GT_Node *p)
Removes node p from the graph and from the index.
size_t get_num_nodes() const
Returns the number of nodes the index contains.
GT_Node * insert_node(const GT_Node_Type &info)
Creates a new node and inserts it into the graph and the index.
void remove_arc(GT_Arc *a)
Removes arc a from the graph and from the index.
GT_Arc * insert_arc(GT_Node *src, GT_Node *tgt, const GT_Arc_Type &info=GT_Arc_Type())
Creates a new arc between two nodes and inserts it into the graph and the index.
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.
Minimal std::expected-style result type for C++20.
DynArray< Graph::Node * > nodes
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
List_Graph< Graph_Node< int >, Graph_Arc< int > > GT
TEST_F(IndexGraphTest, Construction)
Main namespace for Aleph-w library functions.
bool are_equal(const GT &g1, const GT &g2)
Fast graph comparison.
Arc of graph implemented with double-linked adjacency lists.
Generic graph and digraph implementations.
Graph indexing utilities for O(log n) node/arc lookup.