 							has_visited_flag = true;
 					}
 					//the neighbor seed is new!
-					if (!has_visited_flag)
+					if (!has_visited_flag && has_visited_nb < 90)
 					{
 						to_visit[idx][to_visit_pos++] = ns;
 						has_visited[has_visited_nb++] = ns;

	}

	void CudaRestrictedVoronoiDiagram::update_points(){
		x_->clear();

		for (int i = 0; i < points_nb_; ++i){
			double d = host_ret_[i * 4 + 3];
			if (fabs(host_ret_[i * 4 + 3]) > 1e-12){
				host_ret_[i * 4 + 0] /= host_ret_[i * 4 + 3];
				host_ret_[i * 4 + 1] /= host_ret_[i * 4 + 3];
				host_ret_[i * 4 + 2] /= host_ret_[i * 4 + 3];
			}
			else
			{
				double d = host_ret_[i * 4 + 3];
				i = i;
			}
			x_->add_vertexd(&host_ret_[i * 4], dimension_);
		}

		std::vector<int> sample_facet(points_nb_);

		
		for (index_t t = 0; t < iter_nb_; ++t){
			//
			if (t > 20) k_ = 10;
			knn_search(); 
				//CudaStopWatcher iter_watcher("iteration");
				//iter_watcher.start();
				cudaMemset(dev_ret_, 0, sizeof(double) * points_nb_ * 4);
				cudaMemcpy(dev_points_, points_, DOUBLE_SIZE * points_nb_ * dimension_, cudaMemcpyHostToDevice);
				cudaMemcpy(dev_points_nn_, points_nn_, sizeof(index_t) * points_nb_ * k_, cudaMemcpyHostToDevice);
