Questions tagged [directed-graphs]
60 questions
12
votes
1 answer
How to find a "short" walk that visits all vertices of a strongly connected directed graph
I am interested in the following algorithmic problem:
Given a strongly connected directed graph $G$, I want a "short" (see below for what I mean by short) walk that starts with an arbitrary vertex $s$ and contains all vertices of $G$.
Deciding if…
Michal Dvořák
- 777
- 3
- 15
5
votes
2 answers
Structural equivalence of self-referential structures
Given two types, T1 and T2, how does structural equivalence work when they're self-referential? Further, how do we go about proving it?
T1: struct { a: int, b: pointer to T2 }
T2: struct { a: int, b: pointer to T1 }
I was attempting to create a…
HidekiRyuga
- 59
- 1
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
Prove finding k disjoint paths from n given paths in a directed graph is NP-complete
Problem: Given n paths in a directed graph G(V, E) and an integer k, find out k paths among them such that no two of them pass through a common node.
Prove that the given problem is in NP-complete.
I was able to prove that the problem is in NP. Hint…
user121450
3
votes
0 answers
Algorithm to find minimum number of cuts in DAG based on a rule
I encountered this problem while doing some “graph”ics programming:
Take a directed acyclic graph where every vertex is given a non-unique label 1..N
You can ‘trim’ the DAG by making a cut that removes all vertices that share one label and also…
Matt Tytel
- 31
- 2
3
votes
1 answer
Maximum number of distinct nodes that can be visited on a single walk
Given a directed graph which may contain cycles, how can I find the maximum number of distinct nodes that can be visited on a single walk?
I have done some research and the most similar-sounding problem I have found is the longest path problem,…
gd1
- 133
- 5
3
votes
1 answer
Find palindrome in directed Graph where edges are either blue or red
This is the given task:
Suppose you are given an arbitrary directed graph G in which each edge is
colored either red or blue, along with two special vertices s and t.
Describe an algorithm that either computes a walk from s to t such that
the…
user136953
2
votes
0 answers
The problem of reachability in a directed graph, but all predecessors must be reached to reach a node
Let $S$ be a set of nodes belonging to a directed graph $G = (V,E)$. A vertex $v$ of $G$ is said to be reachable from $S$ if and only if $v \in S$, or if each predecessor of $v$ is reachable from $S$ after removing any outgoing edge of $v$. We'll…
contrapunctus
- 21
- 3
2
votes
1 answer
Why there is no definition of cut vertices or articulation points in directed graphs?
We know cut vertex is an important definition in undirected graph, indicating a vertex which when removed, the number of connected components would increase. And we also have an efficient algorithm for it.
However we don't have such counterpart…
27rabbit
- 68
- 7
2
votes
1 answer
Turning an undirected graph into a directed graph such that in-degree of all nodes is at most 1 or show it is not possible
I was thinking what if you just started with the node with lowest non-zero degree $u$ (only count undirected edges) and picked random edge that is connected to that and direct that inwards. EX: undirected edge $uv \to (v,u)$. Then repeat, ignoring…
CHTM
- 121
- 1
2
votes
0 answers
Edmond's theorem for k-disjoint arborescences in digraphs
Recently while studying arborescences in graph theory, I came across Edmond's theorem for $k$ edge-disjoint arborescences in digraphs
if a finite digraph is $k$ edge-connected from a vertex r for some $k \in N$, then it has
$k$ edge-disjoint…
Ash Ketchum
- 53
- 5
2
votes
1 answer
Find the directed subgraph with least edges that preserves connectivity
I have a directed graph $G$ with a set of nodes $N$ and a set of edges $E$ with the following property : if $(A\to B)\in E$ and $(B\to C)\in E$, then $(A\to C)\in E$, for all nodes $A,B,C$.
I would like to find the subgraph $G'$ with the same set of…
Tristan Nemoz
- 123
- 5
2
votes
0 answers
Given a vertex in a digraph, is there a standard term for (the vertices reachable from it) union (the vertices reaching it)?
Question in title. Looking for whether there is a term that is, if not widely understood, at least citeable to a source.
This is equivalent to asking for the set of nodes that are comparable to the given node in the preorder induced by the digraph.…
Aaron Rotenberg
- 3,583
- 14
- 20
2
votes
1 answer
How to find long trails in a multidigraph
I have a directed multigraph (a multigraph is a graph that can have more than one edge between any two nodes). In Wikipedia's terminology, this is a directed multigraph (edges without own identity). I want to find its longest directed trails (a…
user2373145
- 201
- 1
- 6
2
votes
2 answers
DAG: When adding an edge that would normally result in a cycle, is there an algorithm to split the graph instead?
Summary
I am using a DAG to compress a tree structure with many repeated nodes (the repeated nodes only very seldomly do not also have repeated edges out.)
Normally, when attempting to add an edge to a DAG that would cause a cycle, you instead…
OmnipotentEntity
- 133
- 7