Skip to main content

detect_coalitions

Function detect_coalitions 

Source
pub fn detect_coalitions<A>(
    framework: &BipolarFramework<A>,
) -> Vec<Coalition<A>>
where A: Clone + Eq + Hash,
Expand description

Detect all coalitions in a bipolar framework.

Builds a petgraph DiGraph from the support edges (ignoring attacks), runs Tarjan’s SCC algorithm, and returns one Coalition per SCC with a freshly-assigned CoalitionId.

Coalition ids are assigned in the order petgraph’s SCC iterator returns them, which is a reverse topological order over the condensation. Consumers should treat ids as opaque and use Coalition::members to identify coalitions semantically.