Random access (or otherwise fast access) of edges in boost graph library
问题 I want to run Monte Carlo edge swaps, i.e., picking two existing edges in a graph uniformly at random and then (if some conditions are met) swap their end points. I am currently using boost::random_edge for selecting edges uniformly at random. #include <boost/graph/adjacency_list.hpp> #include <boost/graph/erdos_renyi_generator.hpp> #include <boost/random/mersenne_twister.hpp> #include <boost/random/variate_generator.hpp> #include <boost/graph/random.hpp> #include <boost/random/linear