当前位置: 首页>>代码示例>>C++>>正文


C++ ProgramState::maxCliqueAprox方法代码示例

本文整理汇总了C++中ProgramState::maxCliqueAprox方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramState::maxCliqueAprox方法的具体用法?C++ ProgramState::maxCliqueAprox怎么用?C++ ProgramState::maxCliqueAprox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgramState的用法示例。


在下文中一共展示了ProgramState::maxCliqueAprox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
				}
			}
		} else if (args_info->clustering_given) {
			int vertex_id = args_info->clustering_arg;
			double ret = state->clustering(vertex_id);
			if(ret != -1) {
				cout << "Clustering coefficient for vertex " + to_string(vertex_id) + " is: " + to_string(ret) + ".\n";
			} else {
				errorMessage("Invalid vertex id");
			}
		} else if (args_info->knn_given) {
			int vertex_id = args_info->knn_arg;
			double ret = state->clustering(vertex_id);
			if(ret != -1) {
				cout << "Nearest neighbors degree for vertex " + to_string(vertex_id) + " is: " + to_string(ret) + ".\n";
			} else {
				errorMessage("Invalid vertex id");
			}
		} else if (args_info->maxCliqueExact_given) {
			int max_time = args_info->maxCliqueExact_arg;
			std::list<int> ret = state->maxCliqueExact(max_time);
			
			if(!ret.empty()) {
				cout << "Max clique size is: " + to_string(ret.size()) + ".\n";
				cout << "Max clique is: ";
				for(std::list<int>::iterator iterator = ret.begin();iterator != ret.end();iterator++){
		        	cout << to_string<int>(*iterator).c_str() << " ";
		        }
		        cout << ".\n";
			} else {
				errorMessage("Time out.");
				ERROR_EXIT;
			}
		} else if (args_info->maxCliqueAprox_given) {
			std::list<int> ret = state->maxCliqueAprox();
			if(!ret.empty()) {
				cout << "Max clique size is: " + to_string(ret.size()) + ".\n";
				cout << "Max clique is:";
				for(std::list<int>::iterator iterator = ret.begin();iterator != ret.end();iterator++){
		        	cout << " " << to_string<int>(*iterator).c_str() ;
		        }
		        cout << ".\n";
			} else {
				errorMessage("Unknown error.");
			}
		}else if (args_info->shell_given) {
			int vertex_id = args_info->shell_arg;
			double ret = state->shellIndex(vertex_id);
			if(ret != -1) {
				cout << "Shell index for vertex " + to_string(vertex_id) + " is: " + to_string(ret) + ".\n";
			} else {
				errorMessage("Invalid vertex id");
			}
		}
		
		if (args_info->print_deg_given) {
		    if (args_info->erdos_given || args_info->barabasi_given || args_info->hot_given || args_info->molloy_given || args_info->hyperbolic_given
			|| args_info->input_file_given) {
			    state->printDegrees();
			} else {
			    usageErrorMessage("You have specified the print-deg options but no graph was loaded or generated. Ignoring.");
			}
		    
		}

		if (args_info->output_file_given) {
开发者ID:alemedve,项目名称:complexnets,代码行数:67,代码来源:main.cpp


注:本文中的ProgramState::maxCliqueAprox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。