Skip to main content

structural_component_count

Function structural_component_count 

Source
pub fn structural_component_count(
    n: usize,
    lines: &[Line],
    transformers: &[Transformer],
    outaged: &[bool],
) -> usize
Expand description

How many components the branch list forms, counting a branch as connecting exactly when build_ybus would give it a structural off-diagonal entry.

Deliberately mirrors what connected_components sees rather than what is physically connected: a half-open transformer counts here, because it counts there too. That makes the comparison between an intact count and an outaged one a sound test of “did this outage split anything”, which is what build_ybus_with_outages’s fast path needs.