model_server/edge/src/sugitopsort.cxx
/*
 *DepthSearchBottom
 *	Does a depth first search starting from the max level
 */
DepthSearchBottom
Does a depth first search starting from the max level
DepthSearchBottom Does a depth first search starting from the max level
void DepthSearchBottom(nlist* l, int level) {
  slist_iterator_forw iter2(*(slist*) l);
  node* p;
  while (p = (node*)iter2()) {
    if (!p->isreached()) {
      p->setreached(1);
      if (p->getlevel() < level) {
	p->setlevel(level);
        if (level > p->getbackgraph()->getmaxlevel())
                         p->getbackgraph()->setmaxlevel(level);
        DepthSearchBottom(p->getpredlist(), level + 1);
      }
      p->setreached(0);
    }
  }
}
void DepthSearchBottom ( nlist * l , int level ) { slist_iterator_forw iter2 ( * ( slist * ) l ) ; node * p ; while ( p = ( node * ) iter2 ( ) ) { if ( ! p -> isreached ( ) ) { p -> setreached ( 1 ) ; if ( p -> getlevel ( ) < level ) { p -> setlevel ( level ) ; if ( level > p -> getbackgraph ( ) -> getmaxlevel ( ) ) p -> getbackgraph ( ) -> setmaxlevel ( level ) ; DepthSearchBottom ( p -> getpredlist ( ) , level + 1 ) ; } p -> setreached ( 0 ) ; } } }
DepthSearchBottom
      Does a depth first search starting from the max level
DepthSearchBottom Does a depth first search starting from the max level
// mark this node as reached // else cycle detected;