Questions tagged [directed-acyclic-graphs]

Directed acyclic graphs appear in many data structures such a changeset graphs in distributed version control systems.

Definitions

A directed acyclic graph is directed graph with no cycles.
Graph - A collection of nodes with links between some pairs called arcs
Directed - A graph for which the arcs have a direction. Paths through the graph can only be used in one direction. If node 'x' links to node 'y', it does not automatically follow that node 'y' links to node 'x'.
Acyclic - A graph for which none of the vertices can be reached through a path starting with itself. A path can never reach the same node twice.

Synonyms

  • DAG
  • acyclic digraph

Common Uses

All trees can be represented as a directed acyclic graph. (But not all directed acyclic graphs are trees.)

920 questions
13
votes
1 answer

How many edges can there be in a DAG?

In a directed acyclic graph with n vertices, what is the maximum possible number of directed edges in it?
user1559262
  • 133
  • 1
  • 1
  • 4
12
votes
4 answers

Examples for Topological Sorting on Large DAGs

I am looking for real world applications where topological sorting is performed on large graph sizes. Some fields where I image you could find such instances would be bioinformatics, dependency resolution, databases, hardware design, data…
12
votes
4 answers

Incremental linearizing of git DAG

I'm the author of GitX. One of the features GitX has is the visualization of branches, as can be seen here. This visualization is currently done by reading commits which are emitted from git in the correct order. For each commit the parents are…
Pieter
  • 3,860
  • 1
  • 16
  • 15
12
votes
2 answers

Converting Directed Acyclic Graph (DAG) to tree

I'm trying to implement algoritm to convert Directed Acyclic Graph to Tree (for fun, learining, kata, name it). So I come up with the data structure Node: /// /// Represeting a node in DAG or Tree /// ///
Lukasz Madon
  • 13,748
  • 13
  • 58
  • 93
12
votes
1 answer

Is there documentation for Airflow log file return codes?

I am trying to identify what in a .log file makes a specific task marked as "Successful" vs "Failure" in airflow. I am getting the sense that this is dependent upon the operator (PythonOperator vs EmailOperator vs BashOperator etc.). I am seeing…
Josh
  • 153
  • 7
12
votes
3 answers

Efficient algorithm for merging two DAGs

I have two weighted DAGs (directed acyclic graphs) and need to merge them into one, so I can get a topological ordering (it could be more than two in some cases). The problem is that the graphs are acyclic each, but can form a cycle together. Also,…
Thomas
  • 131
  • 1
  • 5
12
votes
2 answers

Airflow: pattern to run airflow subdag once

From the airflow documentation: SubDAGs must have a schedule and be enabled. If the SubDAG’s schedule is set to None or @once, the SubDAG will succeed without having done anything I understand the subdagoperator is actually implemented as a…
gnicholas
  • 1,823
  • 17
  • 31
12
votes
1 answer

All possible paths from one node to another in a directed tree (igraph)

I use python binding to igraph to represent a directed tree. I would like to find all possible paths from one node in that graph to another one. Unfortunately, I couldn't find a ready to use function in igraph that performs this task? EDIT The…
Boris Gorelik
  • 24,869
  • 33
  • 118
  • 167
12
votes
3 answers

How to maintain a transitive closure table efficiently?

I have a DAG in my relational database (Firebird) with two tables edge and node (adjacency list model). I want to query them recursively, but found recursive queries very inefficient. So I tried to implement triggers to maintain the transitive…
12
votes
1 answer

How to define a tree-like DAG in Haskell

How do you define a directed acyclic graph (DAG) (of strings) (with one root) best in Haskell? I especially need to apply the following two functions on this data structure as fast as possible: Find all (direct and indirect) ancestors of one…
11
votes
3 answers

How to Trigger a DAG on the success of a another DAG in Airflow using Python?

I have a python DAG Parent Job and DAG Child Job. The tasks in the Child Job should be triggered on the successful completion of the Parent Job tasks which are run daily. How can add external job trigger ? MY CODE from datetime import datetime,…
11
votes
1 answer

trying to create dynamic subdags from parent dag based on array of filenames

I am trying to move s3 files from a "non-deleting" bucket (meaning I can't delete the files) to GCS using airflow. I cannot be guaranteed that new files will be there everyday, but I must check for new files everyday. my problem is the dynamic…
arcee123
  • 539
  • 3
  • 32
  • 86
11
votes
3 answers

Airflow 1.10.3 SubDag can only run 1 task in parallel even the concurrency is 8

Recently, I upgrade Airflow from 1.9 to 1.10.3 (latest one). However I do notice a performance issue related to SubDag concurrency. Only 1 task inside the SubDag can be picked up, which is not the way it should be, our concurrency setting for the…
Kevin Li
  • 1,880
  • 12
  • 25
11
votes
4 answers

Apache Airflow scheduler does not trigger DAG at schedule time

When I schedule DAGs to run at a specific time everyday, the DAG execution does not take place at all. However, when I restart Airflow webserver and scheduler, the DAGs execute once on the scheduled time for that particular day and do not execute…
Prabhjot
  • 397
  • 2
  • 3
  • 13
11
votes
1 answer

Optimal memory trace for a DAG of dependency evaluations

I'm looking for an algorithm which to optimise the order of evaluations on a DAG, such that least memory is used. It might be a bit harder to explain, so I'll give an example what I mean. Consider that you have a DAG with multiple roots, which…
1 2
3
61 62