Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjlist->delete_edge not working with is_directed=false #116

Open
ht-gong opened this issue Jul 21, 2022 · 0 comments
Open

Adjlist->delete_edge not working with is_directed=false #116

ht-gong opened this issue Jul 21, 2022 · 0 comments

Comments

@ht-gong
Copy link
Contributor

ht-gong commented Jul 21, 2022

Code to reproduce error:

#pragma omp parallel for
    for (int i = 0; i < THREAD_NUM; i++)
    {
        GraphBase* graph = myEngine.create_graph_handle();
        int ret = -1;
        if (i % 2 == 0)
        {
            graph->add_node(node{.id = i + 100});
            // graph->add_edge(edge{.src_id = i, .dst_id = 1}, false);
        }
        else
        {
            while (ret != 0)
            {
                ret = graph->add_edge(edge{.src_id = 1, .dst_id = i - 1 + 100},
                                      false);
            }
        }
        graph->close();
    }

#pragma omp parallel for
    for (int i = 0; i < THREAD_NUM; i++)
    {
        GraphBase* graph = myEngine.create_graph_handle();
        int ret = -1;
        if (i % 2 == 0)
        {
        }
        else
        {
            while (ret != 0)
            {
                ret = graph->delete_edge(1, i - 1 + 100);
            }
        }
        graph->close();
    }

After running the segement, in/out_degree on nodes becomes a large number (probably because the degrees got reduced into the negative range)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant