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.)

1373 questions
-2
votes
1 answer

Airflow dag executing middle tasks after completing stop_dag task, how to stop other tasks want to dependency even though parent task did not ran

Here is the image after stop execution step, highlighted steps are running without any dependency. please help to stop other task after stop_dag task run completed.
-2
votes
1 answer

Check if graph is cyclic

The following code works fine except for when it runs through an acyclic graph. It marks the acyclic graph as cyclic and I can't understand why. @Override public boolean isCyclic(DirectedGraph graph) { List> visitedNodes =…
Lithicas
  • 3,793
  • 7
  • 23
  • 32
-2
votes
1 answer

How to find a path between two nodes with an odd number of edges?

I have a directed acyclic graph and I need to find a path with an odd number of edges between the starting point and a sink (the graph can contain multiple sinks). In the end, I should have a time complexitxy of O(|V|+|E|).
-2
votes
1 answer

Index out of bounds error for DAG

I'm writing a program to find the longest path for a DAG with input from standard in.I finally got it to compile, with it saying it is using unchecked or unsafe operations due to my Array list, but I am getting an index out of bounds error and it…
-2
votes
1 answer

Object oriented graphs implementation in c++

I have to implement a simulation of the WWW on c++ using graphs, where the nodes are Webpages and the directed edges are URLs. In school, in our level, we are still starting in Object Oriented Programming, so they proposed to implement using the…
Salim Mahboubi
  • 561
  • 7
  • 25
-3
votes
1 answer

Facing a syntactic problem in Directed Acyclic Graph Python

Here I'm using DAG to solve Job scheduling problem. from collections import defaultdict class JobGraph: def __init__(self): self.graph = defaultdict(list) self.indegree = defaultdict(int) self.visited = set() …
Recommence
  • 75
  • 1
  • 8
-3
votes
1 answer

DAG shortest path

Given a directed acyclic graph G = (V,E) and two distinguished vertices s and t. Both the edges and vertices are assigned real-valued weights. The weight of a path is defined as the sum of all the edges and vertices on the path. The problem is to…
user3566629
  • 35
  • 1
  • 3
1 2 3
91
92