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.
Permutations p1...pn were chosen uniformly at random among all permutations.
For each i in {1, 2, ..., n-1}, edge (p[i], p[i+1]) was added to the graph.
This makes no sense because p[i] is a PERMUTATION. It's a series of cities including all cities exactly once. You can't have an edge between two permutations.
Perhaps the intended meaning was this:
A random permutation "c" of n cities is chosen.
For each i in {1, 2, ..., n-1}, edge (c[i], c[i+1]) was added to the graph.
The term "approximate" is used because a solution will be accepted if it's close (at least 80% of n).
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 →
The problem statement doesn't make sense:
This makes no sense because p[i] is a PERMUTATION. It's a series of cities including all cities exactly once. You can't have an edge between two permutations.
Perhaps the intended meaning was this:
The term "approximate" is used because a solution will be accepted if it's close (at least 80% of n).