Exemple #1
0
def test_bfs(graph: Graph):
    start_node = 0
    property_name = "NewProp"

    bfs_sync_pg(graph, start_node, property_name)

    verify_bfs(graph, start_node, property_name)

    stats = BfsStatistics(graph, property_name)
    assert stats.n_reached_nodes == 3
Exemple #2
0
def test_bfs(graph: Graph):
    start_node = 0
    property_name = "NewProp"

    bfs_sync_pg(graph, start_node, property_name)

    num_node_properties = len(graph.loaded_node_schema())
    new_property_id = num_node_properties - 1
    verify_bfs(graph, start_node, new_property_id)

    stats = BfsStatistics(graph, property_name)
    assert stats.n_reached_nodes == 3
Exemple #3
0
def test_busy_wait(graph: Graph):
    set_busy_wait()
    property_name = "NewProp"
    start_node = 0

    bfs(graph, start_node, property_name)

    node_schema: Schema = graph.loaded_node_schema()
    num_node_properties = len(node_schema)
    new_property_id = num_node_properties - 1
    assert node_schema.names[new_property_id] == property_name

    assert graph.get_node_property(property_name)[start_node].as_py() == 0

    bfs_assert_valid(graph, start_node, property_name)

    BfsStatistics(graph, property_name)

    # Verify with numba implementation of verifier as well
    verify_bfs(graph, start_node, new_property_id)
    set_busy_wait(0)