| Approach | Notes |
|---|---|
| Memoized DFS for descendant count | Caches subtree sizes to avoid recomputation across multiple top-K queries, but requires cache invalidation if the graph is mutable. |
| Monte Carlo simulation for Part 3 | Easier to implement and handles complex stochastic dependencies, but is approximate and slower than closed-form expected value computation. |