Esempio n. 1
0
def test_louvain_clustering():
    property_graph = PropertyGraph(
        get_input("propertygraphs/rmat10_symmetric"))

    louvain_clustering(property_graph, "value", "output")

    louvain_clustering_assert_valid(property_graph, "value", "output")

    LouvainClusteringStatistics(property_graph, "value", "output")
Esempio n. 2
0
def run_louvain(property_graph: PropertyGraph, input_args):
    property_name = "NewProp"
    edge_prop_name = input_args["edge_wt"]

    with time_block("louvain"):
        louvain_plan = analytics.LouvainClusteringPlan.do_all(False, 0.0001, 0.0001, 10000, 100)
        analytics.louvain_clustering(property_graph, edge_prop_name, property_name, louvain_plan)

    check_schema(property_graph, property_name)

    analytics.louvain_clustering_assert_valid(property_graph, edge_prop_name, property_name)

    stats = analytics.LouvainClusteringStatistics(property_graph, edge_prop_name, property_name)
    print(f"STATS:\n{stats}")
    property_graph.remove_node_property(property_name)