Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_indexGraph.H File Reference

Graph indexing utilities for O(log n) node/arc lookup. More...

#include <tpl_indexNode.H>
#include <tpl_indexArc.H>
#include <ah-errors.H>
Include dependency graph for tpl_indexGraph.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::Index_Graph< GT, Compare, Tree >
 Construye índices de nodos y arcos para su rápida búsqueda y recuperación. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Functions

template<class GT >
bool Aleph::are_equal (const GT &g1, const GT &g2)
 Fast graph comparison.
 

Detailed Description

Graph indexing utilities for O(log n) node/arc lookup.

Example: Fast node lookup by value
using GT = List_Graph<Graph_Node<int>, Graph_Arc<int>>;
GT g;
Index_Graph<GT> idx(g);
// Insert nodes
auto n1 = idx.insert_node(100);
auto n2 = idx.insert_node(200);
auto n3 = idx.insert_node(300);
// O(log n) search by value
auto found = idx.search_node(200);
if (found)
cout << "Found node: " << found->get_info() << endl;
Example: Fast arc lookup
idx.insert_arc(n1, n2, 12);
// O(log n) arc search
auto arc = idx.search_arc(n1, n2);
if (arc)
cout << "Arc weight: " << arc->get_info() << endl;
Author
Leandro Rabindranath León

Definition in file tpl_indexGraph.H.