Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the method Graphs.endpoints() that does what you expect: returns …
…the endpoints corresponding to each edge in a graph. The whole "we print every edge in an undirected graph's toString() twice, and that's a feature not a bug *wink*" annoyed me. Also there's other cases, such as copyOf() and and getWeaklyConnectedComponents(), where we don't want to process each edge twice. In those particular cases they happen to be no-ops, but for cases where it's not, or where you do something computationally expensive, doubling up on undirected edges is bad :( ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=126884706
- Loading branch information
Showing
3 changed files
with
226 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.