Expand description
Deterministic per-topology top-K reduction and tie diagnostics.
Behaviorally equivalent to the Python reference in
crates/pyxlog/python/pyxlog/ilp/exact_induce.py:
- Within each topology, sort scored pairs by lexicographic key
(-positives_covered, negatives_covered, left_idx, right_idx). - Filter to pairs with
positives_covered > 0, then keep the firstk_per_topology. - For each kept pair:
local_rank= 0-indexed position within the positive-filtered list.next_positives_covered/next_negatives_covered= the next pair in the positive-filtered list, or(0, 0)if there is none.tie_class_size= count of pairs in the FULL sorted list (including zero-coverage) sharing the same(positives_covered, negatives_covered).
- Output groups candidates by
Topology::ALLorder.
Structs§
- Scored
Pair - One scored
(topology, left, right)triple produced by the scoring stage.
Functions§
- reduce_
per_ topology - Reduce a flat scored-pair list to the final ordered
ScoredCandidatelist.