directed-acyclic-graphs

Part Database - Network Model / Hierachal Model / Nested Sets / Acyclic Graphs. Which is right here?

扶醉桌前 提交于 2020-01-05 15:36:11
问题 We are using PHP / SQL to build a parts database which will output as a tree structure. After plunging head first into the coding with the nested sets model we realised that we needed to adjust the model to allow for multiple parents. Effectively, every child can have more than one parent, and every parent can have more than one child, but each node cannot be its own relative. We want to link a collection of parts (A) to a parent part and create a larger part (B) whilst keeping the original

What is the best way to store login credentials on Airflow?

可紊 提交于 2020-01-04 15:31:48
问题 I found out there are lot of ways to store it as variables, hooks and other ways using encryption. I would like to know what's the best way to do it. 回答1: Currently there 2 ways of storing secrests: 1) Airflow Variables : Value of a variable will be hidden if the key contains any words in (‘password’, ‘secret’, ‘passwd’, ‘authorization’, ‘api_key’, ‘apikey’, ‘access_token’) by default, but can be configured to show in clear-text as shown in the image below. However, there is a known-bug where

What is the best way to store login credentials on Airflow?

心已入冬 提交于 2020-01-04 15:31:23
问题 I found out there are lot of ways to store it as variables, hooks and other ways using encryption. I would like to know what's the best way to do it. 回答1: Currently there 2 ways of storing secrests: 1) Airflow Variables : Value of a variable will be hidden if the key contains any words in (‘password’, ‘secret’, ‘passwd’, ‘authorization’, ‘api_key’, ‘apikey’, ‘access_token’) by default, but can be configured to show in clear-text as shown in the image below. However, there is a known-bug where

Prolog, Determine if graph is acyclic

倖福魔咒の 提交于 2020-01-04 05:20:15
问题 I need to define a predicate acyclic/1 that takes a graph in as input and determine if that graph is acyclic. So from my understanding graph1(a,b). graph1(b,c). graph1(c,a). Will return no and graph2(a,b). graph2(b,c). will return yes I made a predicate to determine if 2 nodes in a graph are connected and if so they will return yes. isConnected(X,Y) :- a(X,Z), isConnected(Z,Y). is there a way that I can use this to determine if a graph is acyclic? I do not want to use any predefined

Add a edge to direct acyclic graph with other restrictions

跟風遠走 提交于 2020-01-01 05:48:11
问题 I have a DAG. I have this operation to add a edge between two nodes. If A is reachable from B, then B is A's parent. If A is reachable from B without going though another node, then B is A's direct parent. Requirements for this graph are: No cycles. For any node, there is a list of direct parents P[1],P[2],P[3]... P[i] is not a parent of P[j] for any i and j. If adding a edge, requirement 1 is not met, the edge is not constructed. If adding a edge, requirement 2 is not met, the edge is

random algorithm over all topological sorts of a DAG?

混江龙づ霸主 提交于 2020-01-01 03:26:10
问题 Does anyone know of a random algorithm for generating a topological sort of a DAG, where each invocation of the algorithm has a non-zero probability of generating every valid topological sort of the DAG. It's crucial that the algorithm does not preclude any valid topological sort, because it's part of a larger algorithm that, given enough iterations, must be demonstrably capable of exploring all topological sorts of a given DAG. Does anyone know if such an algorithm has been developed?

Apache Airflow - trigger/schedule DAG rerun on completion (File Sensor)

不问归期 提交于 2019-12-31 22:41:12
问题 Good Morning. I'm trying to setup a DAG too Watch/sense for a file to hit a network folder Process the file Archive the file Using the tutorials online and stackoverflow I have been able to come up with the following DAG and Operator that successfully achieves the objectives, however I would like the DAG to be rescheduled or rerun on completion so it starts watching/sensing for another file. I attempted to set a variable max_active_runs:1 and then a schedule_interval: timedelta(seconds=5)

How to show that a prob is in NP and that it is NP-complete

只愿长相守 提交于 2019-12-25 03:36:11
问题 Longest Path We have a graph G=(V,E), lengths l(e) in Z^(+) for each e in E, a positive integer K and two nodes s,t in V. The question is if there is a simple path in G from s to t of length at least K ? Show that the problem Longest Path belongs to NP. Show that the problem Longest Path is NP-complete, reducing Hamiltonian Path to it. Show that if the graph is directed and acyclic then the problem can be solved in time O(|V|+|E|). Could you give me a hint how we could show that the problem

How to pause a task in airflow

南笙酒味 提交于 2019-12-24 22:36:21
问题 There is a DAG which contains 4 tasks as shown below. Sometimes I want to run task3 only after checking couple of things. May I know how to pause task3 of next instance. Is there any way to pause future(tomorrow's) task instance ? I know we can use command line interface "airflow pause dagid" but here I want to pause taskid. task1 >> task2 >> task3 >> task4 I know we can use command line interface "airflow pause dagid" but here I want to pause taskid. 来源: https://stackoverflow.com/questions

Finding all paths between a set of vertices in a DAG

Deadly 提交于 2019-12-24 04:21:01
问题 Given a graph G= (V, E) that is: directed, acyclic, non-weighted, may have more than one edge between two vertices (thus, source and destination are not enough to determine an edge). And given a set of vertices, let's call them vSet ; that contains a vertex vRoot ; I need to find ALL paths pSet between vSet elements respecting the following: any vertex that appears as a source for some path in pSet must be reachable from vRoot. any path in pSet must has its source and destination from vSet ,