Open fubar-coder opened 6 years ago
Form unknown CodePlex user on Wednesday, 29 September 2010 02:45:54
Hello, I have some news about this:
The reason why i have had this exception is that the FinishVertex event don't check if the current vertex is contained in the collection of pairs before trying to access to the edges. This bug wasn't detected by the Test because every vertices combination are added to the collection of pairs so every vertex is include in the collection of pairs. I have attached a corrected version of the Algorithm.
I have also found an other bug : if we use a pair (Vertex1->Vertex2) it don't give the same result as (Vertex2->Vertex1). I think that the problem come from the use of SEquatableEdge in order to represent the pairs, this class implement a comparison that compare source together and destination together but don't make a cross comparison.
I have also found a turnaround for this : Add every pairs in each order and make the search of the ancestor in both order.
From unknown CodePlex user on Tuesday, 28 September 2010 01:53:20
I am trying to use Tarjan Offfline Least Common Ancestor Algorithm , but a KeyNotFoundException is occurring. It seem that it search the root node in a graph made of the 2 vertex that are present in the pair.
Program.cs
TarjanOfflineLeastCommonAncestorAlgorithm.cs