I am trying to use the networkx package in python to find the lowest common ancestor for 2 nodes in a graph. When I use the built in method for this it only retrieves one LCA when there are multiple. Any ideas of how to retrieve all LCAs?
Example:
G = nx.DiGraph()
G.add_node(1)
G.add_node(2)
G.add_node(3)
G.add_node(4)
G.add_edge(1,3)
G.add_edge(1,2)
nx.all_pairs_lowest_common_ancestor(G, 2,3) # returns 1
G.add_edge(4,3)
G.add_edge(4,2)
nx.all_pairs_lowest_common_ancestor(G, 2,3) # returns 4 # desired return should be 1 and 4

