Mark Parncutt

Results 8 comments of Mark Parncutt

I am also +1 for replacing the existing LCA functions with the new ones from @dtekinoglu. The `naive_` functions provide correct results where the existing functions are incorrect. This is...

Related issues #4458 and #5547, related notebook networkx/nx-guides#66

@PraharshitaK-IS Yes, I'd be very happy for anyone to solve this! Please also see #5547 where someone is working on the same problem.

Also I should say that in the sample dataset I provided, there are actually two results that would be equally correct: **183** and **319**

I've also tried a few different inputs and have more incorrect results that may assist in debugging this issue: ### Inputs are a different number of generations from expected LCA...

The notes you quoted are from `tree_all_pairs_lowest_common_ancestor()` which is a specific implementation for trees. `lowest_common_ancestor()` calls through to a different function `all_pairs_lowest_common_ancestor()` which says it should work on all directed...

@dschult @dtekinoglu I've tried `naive_lowest_common_ancestor` using the same dataset and inputs as above. It gives the correct results for some of the inputs in my original post: (1082, 1096) and...

@dtekinoglu @dschult Thanks for the further analysis. I agree that the issue here is defining what LCA means for a DAG, rather than necessarily a bug in the code. [This...