[英]Large testcases involving graphs in C++ (using STL) throws std::bad_alloc
We are working on a graph (stored as adjacency list implementation) algorithm implementation which requires us to store the following : 我们正在研究一种图形(存储为邻接表实现)算法实现,该算法实现需要存储以下内容:
We tried testing on large graphs (>2^12 vertices) and this throws a std::bad_alloc after running for some time. 我们尝试在大型图(> 2 ^ 12顶点)上进行测试,并且在运行一段时间后会抛出std :: bad_alloc。 This is the case even when run on 8GB(Ubuntu 12.04) or 16GB using only 3GB of memory. 即使在仅使用3GB内存的8GB(Ubuntu 12.04)或16GB上运行时,也是如此。 Could you tell how we can get large test cases to work or are we going wrong somewhere? 您能否告诉我们如何使大型测试用例工作,或者我们在某个地方出错了?
尝试在64位操作系统上以64位模式编译代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.