Skip to content
Snippets Groups Projects
Commit 3e7554ff authored by Kilian Verhetsel's avatar Kilian Verhetsel
Browse files

Fix LNS fragment selection failing for empty graphs

parent 914d1d0d
No related branches found
No related tags found
No related merge requests found
...@@ -772,6 +772,9 @@ template<typename Graph, typename WeightMap> ...@@ -772,6 +772,9 @@ template<typename Graph, typename WeightMap>
lns_fragment<Graph> fragment_selector(const lns_state<Graph, WeightMap> &state) { lns_fragment<Graph> fragment_selector(const lns_state<Graph, WeightMap> &state) {
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex; typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex;
if (boost::num_vertices(state.graph) == 0)
return lns_fragment<Graph>(std::set<vertex>());
std::random_device dev; std::random_device dev;
std::mt19937 gen(dev()); std::mt19937 gen(dev());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment