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

CP-65208: Implementation of OutEdges(TVertex v) for BidirectionalGraph is (I think) wrong #156

Open
fubar-coder opened this issue Jun 11, 2018 · 2 comments

Comments

@fubar-coder
Copy link
Contributor

From unknown CodePlex user on Thursday, 01 September 2016 00:41:20

Here is the implementation for BidirectionalGraph :

        public IEnumerable<TEdge> OutEdges(TVertex v)
        {
            IEnumerable<TEdge> result;
            if (this.TryGetInEdges(v, out result))
                return result;
            else
                return Enumerable.Empty<TEdge>();
        }

I think it should not use the method "TryGetInEdges".

A symptom of this problem is that the algoritms have a weird behaviour. For exemple, is i have the following graph:

v1->v2
^    |
|    v
v4<-v3

and if I use the StronglyConnectedComponents algorithm on this graph, the algorithm will output that there is 4 components (we should have only one component). I think, this is because the StronglyConnectedComponents algorithm use the OutEdges method, and since it is wrong, the algorithm actually see the following graph:

|-----|   |-----|   |-----|    |-----|
v1<---|   v2<---|   v3<---|    v4<---|

(each vertex has a self-loop, and there is no other edge excepts these loops)

@ktnr
Copy link

ktnr commented Nov 5, 2018

As far as I can see this issue is fixed, the current implementation is:

public IEnumerable<TEdge> OutEdges(TVertex v)
{
    return this.vertexOutEdges[v];
}

I see you branched from another QuickGraph fork (https://github.com/YaccConstructor/QuickGraph/), which seems to be more active.

Can you tell me what the purpose of this project is? Also, if I wanted to contribute, should I contribute to that other fork? Unfortunately, the other team has not added the archived issues and discussions.

@fubar-coder
Copy link
Contributor Author

@ktnr I suggest that you contribute to the other project instead of this one. I opened an issue explaining the current situation: #162.

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

No branches or pull requests

2 participants