Skip to main content

VariableOrder

Trait VariableOrder 

Source
pub trait VariableOrder {
    // Required methods
    fn name(&self) -> &'static str;
    fn order(&self, hg: &HypergraphRule) -> Vec<VertexId>;
}
Expand description

Compute a variable order for a HypergraphRule.

Returned vectors must:

  • contain every VertexId in hg.vertex_ids() exactly once,
  • be deterministic for a given input (same hg → same output),
  • not depend on hidden mutable state (e.g. process-wide RNG).

Determinism is the contract that lets the explain output be snapshot-tested. Implementations that want randomness should expose a seeded constructor and document the seeding policy.

Required Methods§

Source

fn name(&self) -> &'static str

Stable identifier for this order’s strategy. Used by the explain output (e.g. "appearance", "selectivity-greedy").

Source

fn order(&self, hg: &HypergraphRule) -> Vec<VertexId>

Compute the order. See trait-level contract for invariants.

Implementors§