Questions tagged [path]
29 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
7
votes
3 answers
Finding a set of edges $E$ such that every $s$-$t$-path contains at least 2 edges from $E$
Given an undirected graph $G$ and two vertices $s$ and $t$, i want to find a minimum set of edges $E$ in $G$ such that every (simple) $s$-$t$-path contains at least 2 edges from $E$.
Is this problem solvable in polynomial time? What if the paths…
tgnome
- 153
- 5
6
votes
0 answers
Are there $\ell$ edge-disjoint $s$-$t$-paths such that at least $k$ of them are internally disjoint? Complexity
Given an undirected graph, two vertices $s$ and $t$, and two integers $k$,$l$ - what is the complexity of finding $\ell$ edge-disjoint $s$-$t$-paths such that at least $k$ of them are pairwise internally disjoint? Being internally disjoint means…
tgnome
- 153
- 5
4
votes
1 answer
Approximation ratio on (1, 2)-metric Travelling Salesman Problem (TSP)
I encountered a problem, where I am given a (fully-connected) graph within a metric space, where each edge weight is either 1 or 2.
My task is to prove that the following greedy algorithm gives a $\frac{3}{2}$-approximation for finding a TSP path:…
NiRvanA
- 159
- 6
4
votes
0 answers
Algorithm to find equivalent classes of homotopic pathes on a grid with obstacles
Given a $n \times n$ grid with some walls and two cells $a$ and $b$, I want to compute the non-homotopics paths from $a$ to $b$ on this grid. A path is a sequence of adjacent cells (diagonal does not count) such that from one cell to another, we…
Johan
- 141
- 3
3
votes
1 answer
All possible paths passing thru a set of nodes
Given a directed unweighted graph and a set of nodes N, I have to find all the paths of length at most L passing thru all the nodes. Since I am not enforcing each node to be visited only once, you can also call this a walk on the graph.
There are a…
giz
- 31
- 3
3
votes
1 answer
Trajectories with collisions
Say that I have a plasma gun:
It's easy to compute the trajectory of the plasma ray starting from the gun.
However, another ray may come from afar:
As everybody knows, plasma rays are deviated when they collide. In fact, they are always deviated…
cdupont
- 131
- 3
3
votes
1 answer
Show all chains per user
Some time ago I had in one of the big tech interviews the following question that I still don't know how to approach it.
You have a chains of reservations from AirBnb:
reservations:[
{user = 1, res_id = 1001, checkin = 100, checkout = 101},
…
Andrei T
- 31
- 5
2
votes
0 answers
Are there $r$ pairwise edge-disjoint $k$-sets of internally disjoint $s$-$t$-paths? Complexity
Given an undirected graph, two vertices $s$ and $t$, and two integers $k$ and $r$, then a $k$-set of internally disjoint $s$-$t$-paths is defined to be a set of exactly $k$ $s$-$t$-paths that share no vertex except for $s$ and $t$. What is the…
tgnome
- 153
- 5
2
votes
0 answers
What is the depth distribution of a random binary tree with n nodes?
Assume I generate a random binary tree with a bounded height with $n$ nodes.
For a given key we measure the length of its path (the maximum can be $n-1$). So my Question is what is the distribution of the path length?
The tree is constructed by…
Jungle
- 21
- 2
2
votes
1 answer
EvoPathfinding - Stuck in local optimal
I am using a Genetic Algorithm framework to solve a path-finding problem. Specifically, given the following 32x32 maze:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X | X
X | X
X |…
ex1led
- 121
- 3
2
votes
0 answers
Finding a circle within a circle
Let $G=(V,E)$ be undirected, and let $s,t\in V$ and $C\subseteq E$ be a circle that contains $s$ and $t$. Assuming $s$ and $t$ are on the circle $C$, we are given a set of edges $F\subseteq E$ which are to be removed. After removing these edges, we…
Eric_
- 535
- 2
- 13
2
votes
1 answer
Reducing infinite paths of a transition system to its set of sets of states
Consider a transition system defined by $\langle S,T \rangle$, where $S$ is a set of states and $T \subseteq S \times S$ is a set of transitions, where $T$ is total, i.e. for every state $s$ there is at least one outgoing transitions $(s,s') \in…
Sindri P.
- 23
- 4
2
votes
1 answer
Determine if there's a $P_3$ as an induced subgraph in a graph $G$
Given a graph $G$ on $n$ vertices with $m$ edges, show an algorithm that determines if there's a $P_3$ as an induced subgraph in $G$ in $O(m+n)$ time. ($P_3$ is the path on 3 vertices).
What I was thinking at first is that any vertex $v$ that has…
giorgioh
- 317
- 1
- 11
1
vote
2 answers
Path Through Graph That Minimizes Node Attributes
I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes…
laurence
- 11
- 2