Graph

group Graph

Graph data structures, including:

  • PDAG: A common graph representation, convertible to a pgmpy.base.PDAG.

  • IPDAGConvertible: Ensures convertibility to the common representation.

  • Data structures optimized for various structure learning algorithms (PDAGwithAdjList, PDAGwithAdjMat).

struct PDAG
#include <pdag.h>

Interface for converting internal graph structures to a unified PDAG.

Structure learning algorithms may use different graph representations. This interface ensures that all such graphs can be converted into a common sparse PDAG form for downstream use (e.g., evaluation, comparison, or Python interop).

Public Functions

inline PDAG(std::size_t num_vars)

Construct a new PDAG with a specified number of variables.

Parameters:

num_vars – The number of variables in the PDAG.

struct PDAGwithAdjList : public IPDAGConvertible
#include <pdag_with_adjlist.h>

PDAG implementation backed by an adjacency list.

This structure uses an adjacency list to represent the PDAG, allowing for efficient storage and access patterns.

struct PDAGwithAdjMat : public IPDAGConvertible
#include <pdag_with_adjmat.h>

PDAG implementation backed by a bit-compressed adjacency matrix.

This structure uses a bit-compressed adjacency matrix to represent the PDAG, allowing for efficient storage and access patterns.