We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Let's choose arbitrary permutation p and add orientation for all edges of G with respect of p i.e. if (x,y) belongs to E and p^-1(x) < p^-1(y) then edge is directed like x -> y.
If I could find an arbitrary permutation that fits in a ucg like the problem statement, wouldn't this permutation be the longest path?
What does it mean by p^-1(x) < p^-1(y) ?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Walking the Approximate Longest Path
You are viewing a single comment's thread. Return to all comments →
I couldn't understand the sentence in Editorial.
If I could find an arbitrary permutation that fits in a ucg like the problem statement, wouldn't this permutation be the longest path?
What does it mean by p^-1(x) < p^-1(y) ?