def run_cc(property_graph: PropertyGraph, _input_args): property_name = "NewProp" with time_block("connected components"): analytics.connected_components(property_graph, property_name) check_schema(property_graph, property_name) analytics.connected_components_assert_valid(property_graph, property_name) stats = analytics.ConnectedComponentsStatistics(property_graph, property_name) print(f"STATS:\n{stats}") property_graph.remove_node_property(property_name)
def test_connected_components(): property_graph = PropertyGraph( get_input("propertygraphs/rmat10_symmetric")) connected_components(property_graph, "output") stats = ConnectedComponentsStatistics(property_graph, "output") assert stats.total_components == 69 assert stats.total_non_trivial_components == 1 assert stats.largest_component_size == 957 assert stats.largest_component_ratio == approx(0.93457) connected_components_assert_valid(property_graph, "output")