Need help: Proving a solution for a Graph problem

Правка en4, от 3509, 2021-04-08 07:15:48

The problem

I have prepared a problem as follow: There is this secret sequence $$$S$$$ consists of $$$N$$$ distinct numbers. Given a matrix $$$G$$$ of size $$$N \times N$$$, where $$$G_{i,j}=$$$'\t{Y}' if $$$S_i>S_j$$$. Otherwise, $$$G_{i,j}=$$$'\t{?}', meaning we have no information about the relation of $$$S_i$$$ and $$$S_j$$$, whether they are larger or smaller. You need to output a sequence $$$P = {P_1, P_2, ..., P_n}$$$, such that $$$S_{P_1} > S_{P_2} > ... > S_{P_n}$$$, or report that it is impossible to determined exactly the order.

Example

\begin{array}{|c|c|c|} \hline G & 1 & 2 & 3 & 4 \cr \hline 1 & ? & ? & ? & ? \cr \hline 2 & ? & ? & Y & Y \cr \hline 3 & Y & ? & ? & Y \cr \hline 4 & Y & ? & ? & ? \cr \hline \end{array} The above input yeilds the answer $$$P={2,3,4,1}$$$, which corresponds to $$$S_2 > S_3 > S_4 > S_1$$$.

Теги help, algorithm proving, graph

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en16 Английский 3509 2022-03-26 05:17:03 73
en15 Английский 3509 2021-04-08 18:24:48 14
en14 Английский 3509 2021-04-08 10:55:28 183
en13 Английский 3509 2021-04-08 09:29:09 26 (published)
en12 Английский 3509 2021-04-08 09:21:53 85
en11 Английский 3509 2021-04-08 08:02:51 12
en10 Английский 3509 2021-04-08 08:02:18 38
en9 Английский 3509 2021-04-08 08:01:23 33
en8 Английский 3509 2021-04-08 07:58:53 15
en7 Английский 3509 2021-04-08 07:58:16 7
en6 Английский 3509 2021-04-08 07:56:44 66
en5 Английский 3509 2021-04-08 07:53:15 1867
en4 Английский 3509 2021-04-08 07:15:48 130
en3 Английский 3509 2021-04-08 07:15:37 132
en2 Английский 3509 2021-04-08 07:12:25 240
en1 Английский 3509 2021-04-08 07:09:16 711 Initial revision (saved to drafts)