Skip to main content

optimize_plan

Function optimize_plan 

Source
pub fn optimize_plan(
    blueprint: &AuditBlueprint,
    overlay: &GenerationOverlay,
    preconditions: &HashMap<String, Vec<String>>,
    constraints: &ResourceConstraints,
) -> OptimizedPlan
Expand description

Select an optimal subset of procedures under resource constraints.

ยงAlgorithm

  1. Collect all procedures from the blueprint.
  2. Build a lookup by procedure id.
  3. Expand must_include with transitive preconditions (BFS).
  4. Remove must_exclude (warn if it is a dependency of a must-include).
  5. If the mandatory set already exceeds the budget, return it as-is.
  6. Score remaining procedures by discriminator coverage per hour and greedily add while budget allows.
  7. Compute coverage, critical path, and role hours.