1 |
francois |
481 |
#include "hypergraphlib_platform.h" |
2 |
francois |
283 |
|
3 |
francois |
481 |
#include "hypergraphlib_dfs.h" |
4 |
|
|
#include "hypergraphlib_node.h" |
5 |
|
|
#include "hypergraphlib_graph.h" |
6 |
francois |
283 |
|
7 |
|
|
using namespace HypergraphLib; |
8 |
|
|
|
9 |
|
|
HYPERGRAPHLIB_ITEM void |
10 |
|
|
HypergraphLib::dfs(Node *__n, std::set < Node * > & __depthFirstSearchNodes) |
11 |
|
|
{ |
12 |
|
|
std::set < Node * > adj; |
13 |
|
|
__n->AdjacentNodes( adj ); |
14 |
|
|
__depthFirstSearchNodes.insert (__n); |
15 |
|
|
for ( std::set < Node * >::const_iterator it = adj.begin(); |
16 |
|
|
it != adj.end() ; |
17 |
|
|
it++) |
18 |
|
|
if ( __depthFirstSearchNodes.find(*it) == __depthFirstSearchNodes.end()) |
19 |
|
|
HypergraphLib::dfs (*it, __depthFirstSearchNodes); |
20 |
|
|
} |
21 |
|
|
|