In QuickGraph - is there algorithm for find all parents (up to root vertex\'s) of a set of vertex\'s. In other words all vertex\'s which have somewhere under them (on the w
I used Doug's answer and found out that if there are more than one parent for a vertex, his solution only provides one of the parents. I am not sure why.
So, I created my own version which is as follows:
public IEnumerable GetParents(T vertexToFind)
{
IEnumerable parents = null;
if (this.graph.Edges != null)
{
parents = this.graph
.Edges
.Where(x => x.Target.Equals(vertexToFind))
.Select(x => x.Source);
}
return parents;
}