directed-acyclic-graphs

NetworkX: Find longest path in DAG returning all ties for max

让人想犯罪 __ 提交于 2019-12-24 03:49:07
问题 I'm having trouble figuring out how to update the networkx dag_find_longest_path() algorithm to return "N" for ties instead of returning the first max edge found, or returning a list of all edges that are tied for max weight. I first created a DAG from pandas dataframe that contains an edgelist like the following subset: edge1 edge2 weight 115252161:T 115252162:A 1.0 115252162:A 115252163:G 1.0 115252163:G 115252164:C 3.0 115252164:C 115252165:A 5.5 115252165:A 115252166:C 5.5 115252162:T

Longest path between from a source to certain nodes in a DAG

谁都会走 提交于 2019-12-23 12:20:20
问题 How do i find the longest path from single source to all final destinations i.e. For source i1, Give longest path between i1 -> o1 and i1 -> o2. The legends described in the above graph are as follows: (i1, i2) are start nodes (o1, o2) are end nodes (1-8) are sub graphs The edges may have +ive/-ive weights The longest paths in this network are in the following order: Worst path: i1 -> 1 -> 4 -> o1 Then, all paths i1 … -> … o1 Then i1 -> 5 -> 6 -> o2 Need a way to ignore selection of (i1 -> 3)

Airflow kills my tasks after 1 minute

只谈情不闲聊 提交于 2019-12-23 09:57:15
问题 I have a very simple DAG with two tasks, like following: default_args = { 'owner': 'me', 'start_date': dt.datetime.today(), 'retries': 0, 'retry_delay': dt.timedelta(minutes=1) } dag = DAG( 'test DAG', default_args=default_args, schedule_interval=None ) t0 = PythonOperator( task_id="task 1", python_callable=run_task_1, op_args=[arg_1, args_2, args_3], dag=dag, execution_timeout=dt.timedelta(minutes=60) ) t1 = PythonOperator( task_id="task 2", python_callable=run_task_2, dag=dag, execution

Directed graph linear algorithm

有些话、适合烂在心里 提交于 2019-12-23 02:30:49
问题 I would like to know the best way to calculate the length of the shortest path between vertex s and every other vertex of the graph in linear time using dynamic programming. The graph is weighted DAG. 回答1: What you can hope for is an algorithm linear in the number of edges and vertices, i.e. O(|E| + |V|) , which also works correctly in presence of negative weights. This is done by first computing a topological order and then 'exploring' the graph in the order given by this topological order.

Airflow latency between tasks

落爺英雄遲暮 提交于 2019-12-22 08:34:59
问题 As you can see in the image : airflow is making too much time between tasks execution ? it almost represents 30% of the DAG execution time. I've changed the airflow.cfg file to: job_heartbeat_sec = 1 scheduler_heartbeat_sec = 1 but I still have the same latency rate. Why does it behave this way ? 回答1: It is by design. For instance I use Airflow to perform large workflows where some tasks can take a really long time. Airflow is not meant for tasks that will take seconds to execute, it can be

Algorithm to transform a workflow DAG into parallel resource allocation?

谁说我不能喝 提交于 2019-12-21 12:44:55
问题 Say I have a graph where nodes are workloads of various kinds and edges are dependencies between the workloads. (This is a DAG since cyclical dependencies must not exist.) I also have a set of multiple agents who can perform the work. Some workload varieties may be given to any agent, others must be given to a specific agent, and others must be given to one agent among a particular group of agents. How do I assign workloads such that: No workload is given to an agent until all its blocking

DAG-oriented git browser?

倖福魔咒の 提交于 2019-12-21 08:08:16
问题 There are git intros with pretty graphs to get your head around the concept of "git's history is just a DAG". I'm wondering why there are (seemingly) few visual git browsers that builds upon this exact model for representing the history. git-cola's DAG view (Looks like still an experimental feature) github's network graph (Quite close to what I'm looking for, but it's not a standalone tool) Other than these, all of the visual git browsers (gitk, git-gui, GitX, etc.) push aside the graph to a

Shortest Path For A Dag

*爱你&永不变心* 提交于 2019-12-21 05:28:16
问题 I have a graph with an s and t vertex that I need to find the shortest path between. The graph has a lot of special properties that I would like to capitalize on: The graph is a DAG (directed acyclic graph). I can create a topological sort in O(|V|) time, faster than the traditional O(|V + E|). Within the topological sort, s is the first item in the list and t is the last. I was told that once I have a topological sort of the vertices I could find the shortest path faster than my current

Examples for Topological Sorting on Large DAGs

有些话、适合烂在心里 提交于 2019-12-20 18:44:21
问题 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 warehousing... but I hope some of you may have encountered or heard of any specific algorithms/projects/applications/datasets that require topsort. Even if the data/project may not be publicly accessible any hints (and estimates on the order of magnitude of

How to convert Directed Acyclic Graph (DAG) to Tree

只愿长相守 提交于 2019-12-20 09:01:38
问题 I have been looking for C# examples to transform a DAG into a Tree. Does anyone have an examples or pointers in the right direction? Clarification Update I have a graph that contains a list of modules that my application is required to load. Each module has a list of modules it depends on. For example here are my modules, A, B C, D and E A has no dependencies B depends on A, C and E C depends on A D depends on A E depends on C and A I want resolve dependencies and generate a tree that looks