kroma

kroma.algorithms.refinement

Refinement

Refinement keeps the joined graph consistent while pairs are accepted, then collapses it at the end.

Online

online_refine(full_graph, rank_attr, equiv_classes, delta_edges, pred)
  -> (equiv_classes, expert_questions)

New edges are added to the graph. The function returns the updated equivalence classes and the pairs that should go to an expert. ReviewRepository records those questions. PredictionRepository appends accepted rows.

Offline

offline_refine(adj, rank_attr) -> dict

compute_node_ranks assigns each node its longest distance from a root. offline_refine partitions nodes by that rank, splits blocks that a higher node separates, and collapses each block.

MatchingRun.finish calls this once after scoring.

Source: refinement.py.