src/GRAPHGEN/drag2optimal.cpp
// Recursive auxiliary function for the conversion of a DAG into DAG with no equivalent subgraphs
Recursive auxiliary function for the conversion of a DAG into DAG with no equivalent subgraphs
Recursive auxiliary function for the conversion of a DAG into DAG with no equivalent subgraphs
void Dag2DagUsingEquivalencesRec(BinaryDrag<conact>::node *n, BinaryDrag<conact>& t, std::map<BinaryDrag<conact>::node*, bool> &visited_n, bool considering_leaves) {
	std::map<BinaryDrag<conact>::node*, bool> visited_fl;
	if (!n->isleaf() || considering_leaves) {
		FindAndLinkEquivalencesDagRec(n, t.GetRoot(), visited_fl);
	}
	visited_n[n] = true;
	if (!n->isleaf()) {
		if (!visited_n[n->left])
			Dag2DagUsingEquivalencesRec(n->left, t, visited_n, considering_leaves);
		if (!visited_n[n->right])
			Dag2DagUsingEquivalencesRec(n->right, t, visited_n, considering_leaves);
	}
}
void Dag2DagUsingEquivalencesRec ( BinaryDrag < conact > :: node * n , BinaryDrag < conact > & t , std :: map < BinaryDrag < conact > :: node * , bool > & visited_n , bool considering_leaves ) { std :: map < BinaryDrag < conact > :: node * , bool > visited_fl ; if ( ! n -> isleaf ( ) || considering_leaves ) { FindAndLinkEquivalencesDagRec ( n , t . GetRoot ( ) , visited_fl ) ; } visited_n [ n ] = true ; if ( ! n -> isleaf ( ) ) { if ( ! visited_n [ n -> left ] ) Dag2DagUsingEquivalencesRec ( n -> left , t , visited_n , considering_leaves ) ; if ( ! visited_n [ n -> right ] ) Dag2DagUsingEquivalencesRec ( n -> right , t , visited_n , considering_leaves ) ; } }
Recursive auxiliary function for the conversion of a DAG into DAG with no equivalent subgraphs
Recursive auxiliary function for the conversion of a DAG into DAG with no equivalent subgraphs