pub fn find_longest_chains(
graph: &HashMap<String, HashSet<String>>,
) -> Vec<ImportChain>Expand description
Find the longest import chains (dependency paths) in the graph.
Returns up to 5 chains (hard-coded limit), sorted by depth (longest first). Only chains with more than 3 nodes (depth > 3) are included.
Chains dominated by a suffix of a longer chain are removed: if chain B’s modules are a suffix of chain A’s modules, B is dropped. This keeps the result set non-redundant — each returned chain represents a unique root.
Uses DFS from each node with memoization to find the longest path, avoiding cycles.