Appendix F: Algorithm for determining inactive initiatives

This appendix defines a pure function \(\mathcal{A}\).

\(\mathcal{A}(I, \mathrm{IIR}, R)\) returns the subset of initiatives marked as inactive, where:

  • \(I\) is the set of all registered initiatives,
  • \(\mathrm{IIR} \subseteq I \times I\) is the Initiative Incompatibility Relation, an irreflexive, symmetric binary relation,
  • \(R(i)\) is the lexicographic ranking vector of initiative \(i\), as defined in Appendix E: Initiative ranking.

Definitions

Let \(L\) be the list of all initiatives in \(I\), sorted in descending order by the lexicographic ranking:

\[ L = (i_1, i_2, \dots, i_m) \quad\text{such that}\quad i_1 \succ i_2 \succ \cdots \succ i_m. \]

Define the compatibility predicate:

\[ \mathrm{compatible}(i, A) \;\;\text{iff}\;\; \forall j \in A,\; (i, j) \notin \mathrm{IIR}. \]

The algorithm constructs a set \(A\) of active initiatives. All other initiatives are inactive.

Algorithm

  1. Initialise the active set: \[ A_0 = \varnothing. \]
  2. For each initiative \(i_k\) in the sorted list \(L\), in order:
    • If \(\mathrm{compatible}(i_k, A_{k-1})\) is true, then \[ A_k = A_{k-1} \cup \{i_k\}. \]
    • Otherwise, \[ A_k = A_{k-1}. \] In this case, \(i_k\) is marked inactive.
  3. After processing all initiatives, the final active set is \[ A = A_m. \]

The function returns the set of inactive initiatives:

\[ \mathcal{A}(I, \mathrm{IIR}, R) = I \setminus A. \]

Post‑conditions

  • Determinism: Because the ranking \(R\) induces a strict total order, the algorithm produces a unique inactive set for any given inputs.
  • Maximal compatibility: The active set \(A\) is a maximal subset of \(I\) containing no pair of incompatible initiatives. It is not necessarily the maximum-cardinality or maximum-weight compatible subset.
  • Greedy priority preservation: Every inactive initiative conflicts with at least one higher‑ranked initiative in the active set. No initiative is made inactive except to preserve compatibility with initiatives that were accepted earlier in the ranking.
  • Single‑initiative rank monotonicity: Holding \(I\), \(\mathrm{IIR}\), and all other rankings fixed, increasing the rank of an active initiative cannot cause that initiative to become inactive.
  • Event‑sourcing compatibility: Inactive initiatives remain in the event‑sourced history; the inactive state is used only as a filter when folding over history.

Scope

This algorithm resolves incompatibility only. It does not determine whether an initiative is well‑formed, legally valid, or applicable after other initiatives have become inactive. Any dependency or applicability rules must be evaluated separately before or during the fold over active initiatives.