id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13209,erdos_renyi_iterator hangs when n is 1,grievejia@…,Jeremiah Willcock,"Running the following program would result in an infinite loop: {{{ #include #include #include using Graph = boost::adjacency_list<>; using ERGen = boost::erdos_renyi_iterator; int main() { std::mt19937 gen; int n = 1; Graph g(ERGen(gen, n, 0.5), ERGen(), n); } }}} This is caused by the while loop inside erdos_renyi_iterator::next(). If n is 1 and allow_self_loops is false, the loop condition will be true forever. A simple change that makes an early exit for the n=1 case would fix the problem. ",Bugs,new,To Be Determined,graph,Boost Development Trunk,Problem,,,