void ModelAddItem(int i){ /* int j; DModel *m= (DModel*)&(models[i]); m->len++; if (m->nc>0){ j= m->children[m->nc-1]; insertItem(j); }*/ points[newpoints]=i; newpoints++; if(newpoints>15) { Incremental(); } }
void DynDSAddRem::Construct(bool use_add_only_graph) { assert(!use_add_only_graph); // Not used DSResult result; if (graph_.num_edges() == 0) { // Nothing to do return; } /*if (use_add_only_graph) { // When there is a node of > max_iter level and few removals Incremental(graph_only_add_, beta_, epsilon_, densest_subgraph_set_.begin(), densest_subgraph_set_.end(), &result, &level_map_, &orientation_); densest_subgraph_set_.clear(); densest_subgraph_set_.insert(result.subgraph.begin(), result.subgraph.end()); if (density(graph_, result.subgraph.begin(), result.subgraph.end()) < (beta_ / (1.0 + epsilon_original_))) { // This should not happen cerr << "WARNING: Low density after > MAX_ITER and few removal" << std::endl; } }*/ Incremental(graph_, 0.25 / (2.0 * (1 + epsilon_)), epsilon_, densest_subgraph_set_.begin(), densest_subgraph_set_.end(), &result, &level_map_, &orientation_); densest_subgraph_set_.clear(); densest_subgraph_set_.insert(result.subgraph.begin(), result.subgraph.end()); pair<unsigned int, unsigned long long> pair_num = num_nodes_and_edges_induced(graph_, densest_subgraph_set_.begin(), densest_subgraph_set_.end()); edges_in_densest_subgraph_ = pair_num.second; assert( (unsigned int ) pair_num.first == (unsigned int ) densest_subgraph_set_.size()); assert(result.density >= 0); beta_ = result.density * (1 + epsilon_); removals_last_ = 0; //graph_only_add_.clear(); //graph_only_add_.assign(graph_);//TODO //threshold_removals_ = ceil( // (epsilon_original_ * graph_.num_edges() * log1p(epsilon_original_)) // / (6 * log(graph_.num_nodes()) * pow((1.0 + epsilon_), 3))); //cout << "[IN CONSTR] Dens:" << result.density << endl; //cout << "[IN CONSTR] BETA:" << beta_ << endl; //cout << "[IN CONSTR] |S|:" << densest_subgraph_set_.size() << endl; //cout << "[IN CONSTR] |E[S]|:" << edges_in_densest_subgraph_ << endl; double upperbound = min((double) orientation_.max_in_deg_upperbound(), beta_ * 2.0 * (1 + epsilon_)); assert(result.density * 2.0 * pow(1.0 + epsilon_, 3) >= upperbound); assert(edges_in_densest_subgraph_ > 0 || graph_.num_edges() == 0); }