本文整理汇总了C++中Tools::readTxt方法的典型用法代码示例。如果您正苦于以下问题:C++ Tools::readTxt方法的具体用法?C++ Tools::readTxt怎么用?C++ Tools::readTxt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools
的用法示例。
在下文中一共展示了Tools::readTxt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char * argv[]) {
std::string path = "/Users/JamesGuo/git_master/Algorithms/kargerMinCut.txt";
std::vector<std::vector<int>> graph;
int row, column;
size_t minimum = 19900;
Tools tool;
graph = tool.readTxt(path);
for (size_t i = 0; i < 80000; i++) {
srand((unsigned int)time(NULL));
uGraph undirectedGraph(graph, 200);
while (undirectedGraph.nbVertices > 2) {
row = rand() % undirectedGraph.adjacencyList.size();
column = rand() % undirectedGraph.adjacencyList[row].size();
if (column == 0) {
column = 1;
}
undirectedGraph.Contraction(row, column);
//std::cout << undirectedGraph.nbVertices << std::endl;
}
if (minimum > undirectedGraph.minCut()) {
minimum = undirectedGraph.minCut();
}
//std::cout << i << std::endl;
}
std::cout << minimum << std::endl;
return 0;
}