abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
Graph Search

Common graph search algorithms. More...

Files

file  bfs.h
file  dfs.h
file  max_cardinality_search.h
 Maximum cardinality search in undirected digraphs.

Classes

class  Bfs< GR , TR >
 BFS algorithm class. More...
class  BfsVisit< GR , VS , TR >
 BFS algorithm class with visitor interface. More...
class  Dfs< GR , TR >
 DFS algorithm class. More...
class  DfsVisit< GR , VS , TR >
 DFS algorithm class with visitor interface. More...
class  MaxCardinalitySearch< GR , CAP , TR >
 Maximum Cardinality Search algorithm class. More...

Functions

template< class GR >
BfsWizard< BfsWizardBase< GR > > bfs (const GR &digraph)
 Function-type interface for BFS algorithm.
template< class GR >
DfsWizard< DfsWizardBase< GR > > dfs (const GR &digraph)
 Function-type interface for DFS algorithm.

Detailed Description

This group contains the common graph search algorithms, namely breadth-first search (BFS) and depth-first search (DFS) [7].

Function Documentation

◆ bfs()

template< class GR >
BfsWizard< BfsWizardBase< GR > > bfs ( const GR & digraph)

Function-type interface for BFS algorithm.

This function also has several named parameters, they are declared as the members of class BfsWizard. The following examples show how to use these parameters.

// Compute shortest path from node s to each node
bfs( g ).predMap( preds ).distMap( dists ).run( s );
// Compute shortest path from s to t
bool reached = bfs( g ).path( p ).dist( d ).run( s , t );
BfsWizard< BfsWizardBase< GR > > bfs( const GR & digraph )
Function-type interface for BFS algorithm.
Definition bfs.h:1171
Warning
Don't forget to put the run() to the end of the parameter list.
See also
BfsWizard
Bfs

◆ dfs()

template< class GR >
DfsWizard< DfsWizardBase< GR > > dfs ( const GR & digraph)

Function-type interface for DFS algorithm.

This function also has several named parameters, they are declared as the members of class DfsWizard. The following examples show how to use these parameters.

// Compute the DFS tree
dfs( g ).predMap( preds ).distMap( dists ).run( s );
// Compute the DFS path from s to t
bool reached = dfs( g ).path( p ).dist( d ).run( s , t );
DfsWizard< DfsWizardBase< GR > > dfs( const GR & digraph )
Function-type interface for DFS algorithm.
Definition dfs.h:1100
Warning
Don't forget to put the run() to the end of the parameter list.
See also
DfsWizard
Dfs