Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Jul 29, 2024

Implement a non-recursive version of Tarjan's Strongly Connected
Component algorithm that consumes and produces iterators for maximum
flexibility.

This will be used in an optimization that transforms the heap type graph
to use minimal recursion groups, which correspond to the strongly
connected components of the type graph.

Implement a non-recursive version of Tarjan's Strongly Connected
Component algorithm that consumes and produces iterators for maximum
flexibility.

This will be used in an optimization that transforms the heap type graph
to use minimal recursion groups, which correspond to the strongly
connected components of the type graph.
@tlively tlively requested a review from kripken July 29, 2024 21:49
std::unordered_map<T, size_t> indices;
// The smallest index of the elements reachable from each element through
// its subtree.
std::unordered_map<T, size_t> minReachable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these three perhaps be more efficient as a single map of a struct like this?

struct Info {
  size_t index;
  size_t lowlink;
  bool onStack;
};
std::unordered_map<T, Info> infoMap; 

(Also those names match the names in the paper.)

}

TEST(SCCTest, TwoAndOneRedundant) {
// 0 <-> 1 => 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

Suggested change
// 0 <-> 1 => 2
// 2 <- 0 <-> 1 -> 2

@tlively tlively merged commit e2f666a into main Jul 30, 2024
@tlively tlively deleted the tarjans-scc branch July 30, 2024 19:11
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants