Skip to main content
removing notes
Source Link
hengxin
  • 9.6k
  • 3
  • 37
  • 74

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths among $S$ and $T$, (formally, $\min\{d(s,t): s \in S, t \in T\}$) in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


Note: The first version of my problem is to find all $d(s,t)$ for each $s \in S$ and $t \in T$. As @D.W. argues, it is not likely to do this in $O(m \log n)$ time because taking $S, T = V$ requires all pairs shortest paths.

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths among $S$ and $T$, (formally, $\min\{d(s,t): s \in S, t \in T\}$) in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


Note: The first version of my problem is to find all $d(s,t)$ for each $s \in S$ and $t \in T$. As @D.W. argues, it is not likely to do this in $O(m \log n)$ time because taking $S, T = V$ requires all pairs shortest paths.

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths among $S$ and $T$, (formally, $\min\{d(s,t): s \in S, t \in T\}$) in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.

problem changed
Source Link
hengxin
  • 9.6k
  • 3
  • 37
  • 74

All pairs shortest Shortest paths betweenamong two subsets of nodes

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths between any node inamong $S$ and any node in $T$, (formally, $\min\{d(s,t): s \in S, t \in T\}$) in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


A first attempt Note: The first version of my problem is to add two extra nodes $s$ andfind all $t$, connect them to$d(s,t)$ for each node in $S$ and $T$ respectively,$s \in S$ and to find the shortest path from $s$ to $t$$t \in T$. However, in my opinion As @D.W. argues, it is not likely to do this find only a shortest paths for each node in $T$, instead of$O(m \log n)$ time because taking $S, T = V$ requires all pairs shortest path between $S$ and $T$paths.

All pairs shortest paths between two subsets of nodes

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths between any node in $S$ and any node in $T$ in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


A first attempt is to add two extra nodes $s$ and $t$, connect them to each node in $S$ and $T$ respectively, and to find the shortest path from $s$ to $t$. However, in my opinion, this find only a shortest paths for each node in $T$, instead of all pairs shortest path between $S$ and $T$.

Shortest paths among two subsets of nodes

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths among $S$ and $T$, (formally, $\min\{d(s,t): s \in S, t \in T\}$) in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


Note: The first version of my problem is to find all $d(s,t)$ for each $s \in S$ and $t \in T$. As @D.W. argues, it is not likely to do this in $O(m \log n)$ time because taking $S, T = V$ requires all pairs shortest paths.

Source Link
hengxin
  • 9.6k
  • 3
  • 37
  • 74

All pairs shortest paths between two subsets of nodes

Given a directed graph $G = (V, E)$ with all edge weights being non-negative and two disjoint subsets of nodes $S, T \subseteq V$, design an algorithm to find the shortest paths between any node in $S$ and any node in $T$ in $O(m \log n)$ time, where $|V| = n$ and $|E| = m$.


A first attempt is to add two extra nodes $s$ and $t$, connect them to each node in $S$ and $T$ respectively, and to find the shortest path from $s$ to $t$. However, in my opinion, this find only a shortest paths for each node in $T$, instead of all pairs shortest path between $S$ and $T$.