MCPcopy Create free account
hub / github.com/davisking/dlib / graph_is_connected

Function graph_is_connected

dlib/graph_utils/graph_utils.h:460–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 typename T
459 >
460 bool graph_is_connected (
461 const T& g
462 )
463 {
464 if (g.number_of_nodes() == 0)
465 return true;
466
467 set<unsigned long>::kernel_1b_c visited;
468 find_connected_nodes(g.node(0), visited);
469 return (visited.size() == g.number_of_nodes());
470 }
471
472// ----------------------------------------------------------------------------------------
473

Callers 8

run_test_on_graphsFunction · 0.85
graph_testFunction · 0.85
directed_graph_testFunction · 0.85
create_join_treeFunction · 0.85
is_join_treeFunction · 0.85

Calls 3

find_connected_nodesFunction · 0.85
number_of_nodesMethod · 0.45
sizeMethod · 0.45

Tested by 3

run_test_on_graphsFunction · 0.68
graph_testFunction · 0.68
directed_graph_testFunction · 0.68