For questions about the usage and manipulation of Directed Acyclic Graphs (DAG).
Questions tagged [dag]
168 questions
16
votes
4 answers
Transitive reduction of DAG
I am looking for O(V+E) algorithm for finding the transitive reduction given a DAG.
That is remove as many edges as possible so that if you could reach v from u, for arbitrary v and u, you can still reach after removal of edges.
If this is a…
Karan
- 291
- 1
- 3
- 7
9
votes
1 answer
Shortest Path in a Directed Acyclic Graph with two types of costs
I am given a directed acyclic graph $G = (V,E)$, which can be assumed to be topologically ordered (if needed). Each edge $e$ in G has two types of costs - a nominal cost $w(e)$ and a spiked cost $p(e)$. I am also given two nodes in $G$, node $s$ and…
Miel Sharf
- 141
- 6
7
votes
1 answer
Transitive reduction of rectangle containment hierarchy DAG
I am looking for a $O(|V| + |E|)$ algorithm for finding transitive reduction of a rectangle containment hierarchy DAG, i.e. a directed edge exists from one rectangle to another if the first rectangle contains the second.
That is, remove as many…
bzliu94
- 372
- 1
- 8
7
votes
0 answers
Minimum Number of Edges Added to a DAG to get Unique Topological Order
The question is simple:
Given an unweighted directed acyclic graph, $G = (V, E)$, what is the minimum number of directed edges we need to add to $E$ such that the resulting graph $G = (V, E')$ has a unique topological ordering?
I initially…
ryan
- 4,533
- 1
- 16
- 41
6
votes
2 answers
maximum weighted path(s) in a DAG
Given a weighted directed acyclic graph (DAG), I need to find all maximum weighted paths between the start node(s), i.e. zero incoming edges, and the end node(s), i.e. zero outgoing edges. My current approach is doing the followings.
Add an extra…
SBDK8219
- 161
- 1
- 1
- 3
6
votes
1 answer
Efficient algorithms for identifying the diamond fork&join vertices and the diamond pairs in directed acyclic graph?
Given a DAG (directed acyclic graph) $G=(V,E)$ without multiple edges, i.e., edges with the same source and target vertices, we define:
A vertex $v_j \in V$ is a diamond-join ($\Diamond_J$) vertex if there exists some other vertex $v_f \in V$ such…
hengxin
- 9,671
- 3
- 37
- 75
6
votes
1 answer
Finding all paths between a set of vertices in a DAG
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…
Median Hilal
- 423
- 4
- 10
5
votes
0 answers
Has this graph-theoretic problem got a known name? Is it NP-hard?
I am considering the following problem.
We are given a Directed Acyclic Graph. In general, there would be some number of subgraphs that, contracted into one node, would make it a tree. For example, in this graph:
If I contract the nodes $b$ and $c$…
Nicola Gigante
- 558
- 2
- 12
5
votes
1 answer
Algorithm for finding an irreducible kernel of a DAG in O(V*e) time, where e is number of edges in output
An irreducible kernel is the term used in Handbook of Theoretical Computer Science (HTCS), Volume A "Algorithms and Complexity" in the chapter on graph algorithms. Given a directed graph $G=(V,E)$, an irreducible kernel is a graph $G'=(V,E')$ where…
andy_fingerhut
- 218
- 1
- 7
5
votes
1 answer
Approximating the biggest acyclic subgraph of a given weighted digraph $G= (V,E)$
The base scenario is this: We're given a weighted, directed graph $G= (V,E)$, and are tasked to find an approximating algorithm which returns a digraph $G' = (V,E')$ (i.e. which only deletes edges) so that $G'$ is acyclic, and so that the sum of the…
Sudix
- 719
- 3
- 13
4
votes
1 answer
Strongly connected components on a DAG
What is supposed to be the right result of an SCC algorithm running on a DAG.
should it return "no components" or "there are V components of size 1"?
I suspect it will return the latter (since it will start with the last sink, and then go back and…
Eran Medan
- 431
- 1
- 4
- 12
4
votes
0 answers
Fastest algorithm for shortest path with atmost k edges on a DAG with non-negative edge weights?
(Please note, this is not a duplicate to Shortest path with exactly $k$ edges OR Shortest path with a fixed number of edges. What I want is a better algorithm)
The problem under consideration is to find single-source-shortest-path of at most…
Loves Probability
- 151
- 1
- 4
4
votes
3 answers
Linear-time algorithm for determining the presence of incomparable pairs in a directed acyclic graph (DAG)
I am seeking a linear-time algorithm to determine whether a directed acyclic graph (DAG) contains at least one pair of incomparable nodes.
Two nodes $u$, $v$ are said to be incomparable if there is neither a path from $u$ to $v$ nor a path from $v$…
Johntrik
- 43
- 8
4
votes
1 answer
Is there a term for these "descendancy" subgraphs of directed acyclic graphs?
Consider a directed acyclic graph $G$ with vertex set $V$. Choose a vertex $v$, and let $H$ be the subgraph containing $v$ and all other vertices in $G$ that are reachable from $v$ (along with the associated directed edges).
(In other words, if we…
Robert Rovetti
- 83
- 5
4
votes
1 answer
Merging nodes of a DAG
I would like to merge connected nodes with a specific attribute of a directed acyclic graph. The purpose is to detect max connected clusters of blue nodes and merge them.
After each merge operation, the graph should remain acyclic.
Let's say my…
David
- 163
- 7