mbi.junction_tree

Utilities for constructing and working with junction trees.

This module provides functions for building junction trees from a given domain and set of cliques. Junction trees are fundamental structures in graphical model inference, enabling efficient message passing algorithms. Functions include finding maximal cliques, determining message passing orders, graph triangulation, computing greedy elimination orders, and estimating model size.

Functions

greedy_order

Compute a greedy elimination order.

hypothetical_model_size

Size of the full junction tree parameters, measured in megabytes.

make_junction_tree

Create a junction tree.

maximal_cliques

Return the list of maximal cliques in the model.

message_passing_order

Return a valid message passing order.

mbi.junction_tree.maximal_cliques(junction_tree: Graph) → list[tuple[str | int, ...]][source]

Return the list of maximal cliques in the model.

mbi.junction_tree.message_passing_order(junction_tree: Graph) → list[tuple[tuple[str | int, ...], tuple[str | int, ...]]][source]

Return a valid message passing order.

mbi.junction_tree.greedy_order(domain: Domain, cliques: Sequence[tuple[str | int, ...]], stochastic: bool = False, elim: list[str | int] | None = None) → tuple[list[str | int], int][source]

Compute a greedy elimination order.

mbi.junction_tree.make_junction_tree(domain: Domain, cliques: Collection[tuple[str | int, ...]], elimination_order: list[str | int] | int | None = None) → tuple[Graph, list[str | int]][source]

Create a junction tree.

mbi.junction_tree.hypothetical_model_size(domain: Domain, cliques: Sequence[tuple[str | int, ...]]) → float[source]

Size of the full junction tree parameters, measured in megabytes.