Skip to contents

In this vignette, we compare caugi to some of the most widely used graph packages in R, Python, and Java.

Overview

The following table summarizes the packages included in this comparison, their general focus, and the languages they are packaged for.

An overview of the packages included in this comparison
Package Type Language URL
igraph General-purpose R, Python, C https://igraph.org
graph General-purpose R https://github.com/Bioconductor/graph
gRbase Graphical models R https://CRAN.R-project.org/package=gRbase
pcalg Causal graphs R https://pcalg.r-forge.r-project.org
dagitty Causal graphs R, Web https://www.dagitty.net
bnlearn Bayesian networks R https://www.bnlearn.com
ggm Graphical Markov models R https://CRAN.R-project.org/package=ggm
MixedGraphs Causal graphs R https://github.com/rje42/MixedGraphs
NetworkX General-purpose Python https://networkx.org
pgmpy Probabilitistc graphical models Python https://github.com/pgmpy/pgmpy
Tetrad Causal graphs Java, CLI, R1, Python http://www.phil.cmu.edu/tetrad

Scope

The comparison focuses on graph representation and analysis: which graph classes each package can represent, which structural and causal-graph algorithms it implements, and how it interoperates with other tooling.

Two adjacent areas are intentionally out of scope:

  • Causal discovery (PC, FCI, GES, GFCI, LiNGAM, etc.). caugi does not implement discovery algorithms.
  • Statistical inference and parameter learning (CPT estimation, likelihood, parameter fitting): also out of scope for caugi.

Graph Types Supported

Supported graph types for the packages in this comparison. ● indicates a dedicated class with type-level invariants; ◐ indicates representability without a dedicated class or invariant enforcement; ○ indicates unsupported graph types.
Package DAG CPDAG MPDAG MAG PAG ADMG SWIG UG Mixed/general
caugi ● ●2 ● ◐3 ○ ● ○ ● ●
igraph ◐4 ○5 ○ ○ ○ ○ ○ ◐6 ◐7
graph ◐8 ○ ○ ○ ○ ○ ○ ◐9 ◐10
gRbase ◐11 ○ ○ ○ ○ ○ ○ ◐12 ○
pcalg ◐13 ◐14 ◐15 ◐16 ◐17 ○ ○ ○ ○
dagitty ● ◐18 ○ ● ● ○ ○ ○ ○
bnlearn ● ◐19 ○ ○ ○ ○ ○ ◐20 ◐21
ggm ◐22 ◐23 ○ ◐24 ○ ◐25 ○ ◐26 ◐27
MixedGraphs ◐28 ○ ○ ○ ○ ◐29 ○ ● ●
NetworkX ◐30 ○ ○ ○ ○ ○ ○ ◐31 ◐32
pgmpy ● ◐33 ○34 ● ○ ● ○ ● ○35
Tetrad ● ◐36 ◐37 ◐38 ●39 ◐40 ○ ◐41 ◐42

Graph Queries and Structural Operations

Overview of available graph queries and structural operations in the packages in the comparison.
Package Parents/children Ancestors/descendants d-sep m-sep Paths Acyclicity Markov blanket Moralization Skeleton v-structures MEC enumeration
caugi ● ● ● ● ○ ● ● ● ● ○ ○
igraph ◐43 ◐44 ○ ○ ● ● ○ ○ ○ ○ ○
graph ◐45 ◐46 ○ ○ ◐47 ○ ○ ○ ○ ○ ○
gRbase ◐48 ◐49 ○ ○ ○ ● ○ ● ○ ○ ○
pcalg ◐50 ◐51 ◐52 ◐53 ○ ◐54 ○ ○ ◐55 ◐56 ●
dagitty ● ● ● ○ ● ● ● ● ○ ◐57 ●
bnlearn ● ● ◐58 ○ ● ● ● ● ● ● ●
ggm ◐59 ◐60 ● ● ◐61 ● ○ ○ ○ ○ ◐62
MixedGraphs ● ● ○ ● ○ ◐63 ◐64 ● ● ○ ○
NetworkX ◐65 ● ◐66 ○ ● ● ○ ● ◐67 ● ○
pgmpy ● ◐68 ● ● ○ ● ● ● ○69 ● ○
Tetrad ● ● ◐70 ● ● ◐71 ● ○ ◐72 ◐73 ●

Causal-Inference Algorithms

Overview of available causal-inference algorithms in the packages in the comparison.
Package Back-door adj. Generalized adj. Optimal adj. ID algorithm Do-calculus Counterfactuals Interventions/mutilation
caugi ● ● ◐74 ○ ○ ○ ○
igraph ○ ○ ○ ○ ○ ○ ○
graph ○ ○ ○ ○ ○ ○ ○
gRbase ○ ○ ○ ○ ○ ○ ○
pcalg ◐75 ● ● ○ ○ ○ ◐76
dagitty ◐77 ○ ○ ○ ○ ○ ◐78
bnlearn ○ ○ ○ ○ ○ ● ●
ggm ○ ○ ○ ○ ○ ○ ○
MixedGraphs ○ ○ ○ ○ ○ ○ ◐79
NetworkX ○ ○ ○ ○ ○ ○ ○
pgmpy ● ● ○ ○ ○ ○ ●
Tetrad ◐80 ● ◐81 ○ ○ ○ ○

I/O and Interoperability

Comparison of supported graph I/O formats and interoperability features.
Package DOT Mermaid GraphML JSON Coerce to/from other graph classes
caugi ◐82 ● ● ●83 ●
igraph ◐84 ○ ● ○ ◐85
graph ◐86 ○ ○ ○ ◐87
gRbase ○ ○ ○ ○ ◐88
pcalg ○ ○ ○ ○ ◐89
dagitty ○ ○ ○ ○ ◐90
bnlearn ◐91 ○ ○ ○ ●
ggm ○ ○ ○ ○ ◐92
MixedGraphs ○ ○ ○ ○ ●
NetworkX ◐93 ○ ● ● ◐94
pgmpy ◐95 ○ ○ ○ ◐96
Tetrad ◐97 ○ ○ ● ○

Implementation and Ergonomics

Comparison of implementation details and ergonomic features of the packages in the comparison.
Package Backend Sparse storage Built-in plotting Layout algorithms Pipeable/fluent API Lazy mutation
caugi R + Rust ● ● ● ● ●
igraph C ◐98 ● ● ○ ○
graph R + C ●99 ○100 ○ ○ ○
gRbase R + C++ ● ◐101 ○ ○ ○
pcalg R + C++ ○ ◐102 ○ ○ ○
dagitty R + JS ○ ● ◐103 ○ ○
bnlearn R + C ◐104 ◐105 ◐106 ○ ○
ggm R ○ ● ◐107 ○ ○
MixedGraphs R + C++ ◐108 ◐109 ○ ◐110 ○
NetworkX Python ◐111 ◐112 ● ○ ○
pgmpy Python (NetworkX) ○ ◐113 ◐114 ○ ○
Tetrad Java ● ◐115 ● ○ ○

Contributing

If you find any errors in the comparison above or would like to add another package for comparisons, please file an issue or submit a pull request with the relevant information.