Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert MAG to PAG #85

Open
adam2392 opened this issue Jul 6, 2023 · 5 comments
Open

Convert MAG to PAG #85

adam2392 opened this issue Jul 6, 2023 · 5 comments

Comments

@adam2392
Copy link
Collaborator

adam2392 commented Jul 6, 2023

Is your feature request related to a problem? Please describe.
A MAG is a mixed-edge graph with directed and bidirected edges and has the 'maximality' property.

This is a sub-procedure of #73 and will enable that to function properly.

Describe the solution you'd like
Implement a function mag_to_pag, which takes in a valid MAG and outputs the corresponding PAG.

Additional context
@aryan26roy if you're still interested, this can be the next step before revisiting #73.

I presume tetrad has a function written in java. More importantly, the paper linked in the issue for #73 should contain the relevant algorithm written in the paper to convert a MAG to a PAG.

@aryan26roy
Copy link
Collaborator

@adam2392 I will take this up.

@adam2392
Copy link
Collaborator Author

Perhaps it might make sense to also add a function that takes in a mixed-edge graph with directed and/or bidirected edges (e.g. an ADMG without undirected edges) and checks if it is a valid MAG.

According to Zhang 2008 (https://www.jmlr.org/papers/volume9/zhang08a/zhang08a.pdf), check:

  1. does graph contain any directed, or almost directed cycles?
  2. between any two non-adjacent nodes, is there an inducing path? (this is now possible because you have implemented the inducing path algorithm)

This is probably pretty expensive because it scales poorly wrt node count, but imo it's fine as long as we document it because I'm not aware of another cheaper way to check if a MAG is valid. I'm sure a way exists using some fancy Breadth-first-search.

@aryan26roy
Copy link
Collaborator

@adam2392 so do you want me to add a method for converting PAG to MAG first or the method for checking the validity of an MAG?

@adam2392
Copy link
Collaborator Author

Perhaps checking validity of a MAG(?). There are some graphical examples in the paper.

@aryan26roy
Copy link
Collaborator

Yeah that sounds better to me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants