Add support for ADMGs (Acyclic Directed Mixed Graphs)#31
Closed
Add support for ADMGs (Acyclic Directed Mixed Graphs)#31
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-authored-by: frederikfabriciusbjerre <55752995+frederikfabriciusbjerre@users.noreply.github.com>
Co-authored-by: frederikfabriciusbjerre <55752995+frederikfabriciusbjerre@users.noreply.github.com>
Co-authored-by: frederikfabriciusbjerre <55752995+frederikfabriciusbjerre@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for ADMGs
Add support for ADMGs (Acyclic Directed Mixed Graphs)
Oct 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements full support for ADMGs (Acyclic Directed Mixed Graphs) in caugi, addressing issue #[issue_number].
What is an ADMG?
An ADMG (Acyclic Directed Mixed Graph) is a causal graph structure that combines:
-->) representing direct causal relationships<->) representing latent confounding (unmeasured common causes)ADMGs must be acyclic with respect to directed edges, but bidirected edges can form cycles. This makes them ideal for representing causal systems with hidden confounders without explicitly modeling the latent variables.
Usage Example
Changes
Rust Backend
src/rust/src/graph/admg.rs): Implements ADMG structure with O(1) slice queries for parents, children, and bidirected neighborsAdmgvariant andbidirected_of()methodis_admg_type_ptr()to validate ADMG constraints (acyclic directed edges, no undirected/partial edges)graphview_new()constructor and all match statementsR Interface
caugi_graph()now acceptsclass = "ADMG"bidirected()function to retrieve bidirected neighborsImplementation Details
The ADMG implementation follows the same pattern as existing DAG and PDAG classes:
directed_part_is_acyclic()algorithm---) and partial edges (o->,--o,o-o) at construction timeparents(),children(),neighbors(),ancestors(),descendants(),markov_blanket_of(), andexogenous_nodes()Testing
All new functionality is tested:
bidirected()query returns correct neighborsCloses #[issue_number]
Original prompt
Fixes #22
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.