inline void
 clique(const Clique& c, Graph& g)
 {
     // Simply assert that each vertex in the clique is connected
     // to all others in the clique.
     typename Clique::const_iterator i, j, end = c.end();
     for(i = c.begin(); i != end; ++i) {
         for(j = c.begin(); j != end; ++j) {
             if(i != j) {
                 BOOST_ASSERT(edge(*i, *j, g).second);
             }
         }
     }
 }
 void clique(const Clique& c, const Graph& g)
 {
     // Iterate over the clique and print each vertex within it.
     typename Clique::const_iterator i, end = c.end();
     for(i = c.begin(); i != end; ++i) {
         os << g[*i].name << " ";
     }
     os << endl;
 }
Пример #3
0
    inline void
    clique (const Clique& c, Graph2& g)
    {

        if (c.size () >= min_size_)
        {
            BOOST_USING_STD_MAX();
            maximum_ = std::max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum_, c.size());

            //save clique...
            typename Clique::const_iterator i, end = c.end ();
            std::vector<size_t> * cc = new std::vector<size_t> (c.size ());
            cliques_.push_back (cc);
            size_t p;
            for (i = c.begin (); i != end; ++i, ++p)
                cc->at (p) = (*i);

            n_cliques_++;
        }
        else
            return;
    }
    inline void
    clique (const Clique& c, Graph2& g)
    {

        if (c.size () >= min_size)
        {
            BOOST_USING_STD_MAX();
            maximum = std::max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum, c.size());

            //save clique...
            typename Clique::const_iterator i, end = c.end ();
            //std::vector<void *> * cc = new std::vector<void *> (c.size ());
            std::vector<size_t> * cc = new std::vector<size_t> (c.size ());
            cliques.push_back (cc);
            size_t p;
            for (i = c.begin (); i != end; ++i, ++p)
            {
                //cc->at (p) = static_cast<void *> (*i);
                cc->at (p) = (*i);
            }

            n_cliques++;
        }
        else
        {
            return;
        }

        // Simply assert that each vertex in the clique is connected
        // to all others in the clique.
        /*typename Clique::const_iterator i, j, end = c.end();
         for(i = c.begin(); i != end; ++i) {
         for(j = c.begin(); j != end; ++j) {
         if(i != j) {
         BOOST_ASSERT(edge(*i, *j, g).second);
         }
         }
         }*/
    }