Question

What is the best way to generate transitive closure of a set of tuples?

Example:

  • Input Set((1, 2), (2, 3), (3, 4), (5, 0))
  • Output Set((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4), (5, 0))

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top