Giter Club home page Giter Club logo

pdagextendability's Introduction

Build Status Documentation Coverage Status

PdagExtendability

This repository contains a benchmarking framework for the extendability of (causal) graphs. The benchmarking framework contains efficient algorithms for extending (causal) graphs and more than 1000 exemplary input graph instances.

More precisely, algorithms solving the following two problems are provided:

  1. Given any partially directed graph G, compute a consistent DAG extension for G if G admits such an extension, otherwise return a negative answer (Extension Problem).
  2. Given any partially directed graph G, compute the set of all consistent DAG extensions for G (Enumeration Problem).

Usage

In order to run the benchmarks, download the repository first. The benchmarks can be started directly from the terminal via

julia run.jl "../configs/config-1.json"

Alternatively, you can start a Docker container via ./run.sh and run the same command inside of the Docker container (this allows to execute the code without installing Julia or any of the dependencies on your machine).

See also the documentation for more detailed information on how to adjust the configuration for a run.

References

Many of the implemented algorithms are from the following papers:

D. Dor, M. Tarsi (1992). A simple algorithm to construct a consistent extension of a partially oriented graph. Technicial Report R-185, Cognitive Systems Laboratory, UCLA.

M. Wienöbst, M. Bannach, M. Liśkiewicz (2021). Extendability of Causal Graphical Models: Algorithms and Computational Complexity. 37th Conference on Uncertainty in Artificial Intelligence, 2021 (UAI 2021).

Development with Docker

The whole software is wrapped inside a Docker container. Thus, it is not even necessary to have Julia installed on your system. Using Docker, simply run ./run.sh to start the system. Edit the source files as you like and execute them directly in the shell provided by Docker.

In case the Dockerfile is edited, you can run ./run.sh b to rebuild the Docker container before starting it.

pdagextendability's People

Contributors

malte311 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

pdagextendability's Issues

Add output verification

For each input, verify that the resulting graph has the same skeleton and v-structures as the input.

Systematic graph generation

Generate graphs systematically.

Begin with chordal graphs and think about how to add directed edges in order to obtain PDAGs. We want most of them to be extendable.

Try to find worst-case instances for Dor Tarsi.

MPDAG Extensions

Consider MPDAGs as well.

  • Implement the algorithm to extend MPDAGs.
  • Generate MPDAGs by applying Meek's Rules to PDAGs.
  • Extend arbitrary PDAGs by 1) PDAG -> MPDAG 2) check if acyclic or new v-structures 3) MPDAG -> DAG

Initialize HashSets

Initialize HashSets and remove isassigned calls, if this is faster (compare it to uninitialized HashSets with isassigned).

Bugs in Graph Generators

Fix bugs in graph generators (e.g., binary tree is not correctly generated). Whenever possible, use LightGraphs implementations (if they exist).

Add Docker Setup

Add Docker setup to run the code completely in Docker containers.

  • Set up Travis CI
  • Verify that Docker is working locally (execution of the Julia code works).
  • Maybe a JuliaProject.toml or Project.toml is needed to download dependencies in the Docker container? -> Not for now.

More Tests

Having implemented the graph generators (see #20), extend the test cases by these new graph types.

Greedy heuristic

Implement a greedy algorithm which prefers nodes with a lower degree over nodes with a higher degree.

Use an array with indices for each degree (0 to n-1) holding a list of vertices with degree i at index i.

Construction of the degree structure

Improve construction by computing the degree as follows. Iterate over outgoing edges for each node and check if an incoming edge exists as well to compute the degree. Should be roughly (ignoring the check for the reverse edge which should be fast) in time complexity O(|E|). LightGraphs offers vectors fadj and badj for this.

Non-extendable Graphs

Generate big graphs which are not extendable. (undirected, partially directed, directed)

Graph Input Time

Maybe get rid of the readinputgraph part in the new algorithm. Since the setup is expensive, it might be better for each algorithm to use its own setup, i.e., the old one uses readinputgraph but the new one parses the graph directly from a string/array.

Power Law Graphs

Generate instances using the Erdős–Rényi model and the Barabási–Albert model.

Topological Ordering Output

Output a topological ordering instead of the extended graph. Use an extra function for computing the extended graph from the ordering. This allows separate time measurements.

Another advantage of this is that filter can be used to direct all edges in one step which should be faster than directing each edge on its own.

Create a Readme File

Create a README.md file.

  • Add badges for build status and documentation on branch gh-pages (if possible).
  • Add a description of the project itself.
  • Provide steps on how to use the code (Docker setup) and explain where logs can be found.

Generation of PDAGs

Generate PDAGs which are extendable. Until now, there are only fully undirected graphs which are extendable.

Dor Tarsi Algo: Maybe only delete edges and don't use the rem_vertex! function

Currently, rem_vertex! is called which leads to the problem that node labels are changed. To circumvent this issue, a hashtable is used to map old node labels on their new label.

Maybe it is not even easier but also more efficient to only delete the edges of the node to delete and leave the node unconnected in the graph - this should be possible.

Depth First Search

Implement DFS as a baseline for fully directed graphs (simple cycle checking).

Graph Generator Output

The value for n=... is not always correct since the functions may add nodes to the given n. Use the actual n in the name.

MPDAG Generation

Generation of MPDAGs does not work as intended. The rules are not applied exhaustively since changes of edges are not considered at the moment.

Bug in AMO computation

The separation of each set into two parts does not work as intended yet.

Problem: Set with vertices that have no ingoing edges might be empty and thus index j is decreased but later on there are still vertices in some later set that are moved into the set for vertices without ingoing edges.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.