Advanced graph operations on dependency graphs.
Builds on NPM.DepGraph's adjacency list to provide transitive closure, shortest path, depth analysis, and dependency impact scoring.
Summary
Functions
Computes impact score — how many packages transitively depend on a package.
Returns all leaf packages (no dependencies).
Computes the maximum depth of a package in the dependency tree.
Reverses the graph (all edges point the other direction).
Returns all root packages (nothing depends on them).
Finds the shortest path between two packages.
Computes the transitive closure — all reachable packages from a root.
Functions
@spec impact(map(), String.t()) :: non_neg_integer()
Computes impact score — how many packages transitively depend on a package.
Returns all leaf packages (no dependencies).
@spec max_depth(map(), String.t()) :: non_neg_integer()
Computes the maximum depth of a package in the dependency tree.
Reverses the graph (all edges point the other direction).
Returns all root packages (nothing depends on them).
Finds the shortest path between two packages.
Computes the transitive closure — all reachable packages from a root.