liyafan82 opened a new pull request #2007:
URL: https://github.com/apache/calcite/pull/2007


   Currently, we have `Graphs#makeImmutable` to compute the shortest paths 
between all pairs of nodes. For many scenarios, however, we do not need the 
exact paths between nodes. Instead, we are only interested in the lengths of 
the shortest paths.
   
   To get the path length, we need to get the shortest path first, which is 
returned as a `List`, then we call the `List#size()` method. According to the 
current implementation, the returned list is of type `ConsList`. The time 
complexity of `ConsList#size` is O(p) (p is the number of vertices on the 
path), which is inefficient.
   
   In this issue, we revise the implementation of `ConsList#size` so that it 
takes O(1) time. In addition, we also give a utiltiy to get the shortest 
distances between nodes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to