7
\$\begingroup\$

I have code that solves the "Traveling Salesman" problem using "Kruskal's algorithm" for a code competition site.

The code run and generates the correct result, but has O(n3) complexity. I am not sure my code implements "Kruskal's algorithm" correctly.

Is it OK to ask question about algorithms and if the code implements the algorithm correctly for the problem at hand?

Is it OK to ask questions soliciting (at the same time) alternative algorithms to solve the problem?

\$\endgroup\$
2
  • \$\begingroup\$ Solving TSP in O(n^3)? What magic is this? \$\endgroup\$ Oct 22, 2013 at 16:17
  • \$\begingroup\$ @200_success: Its not a solution its a heuristic. Thus not guaranteed to give the perfect answer but a close approximation. \$\endgroup\$ Oct 22, 2013 at 16:45

1 Answer 1

7
\$\begingroup\$

If your code runs and generates correct results, I don't see a problem with it being reviewed here. People would review all aspects of the code, and you're free to accept an answer that would also review the algorithm aspect of it, to address whether your implementation is correct or not.

We have an tag right?

My point is, I don't think it's much different from reviewing code tagged or .

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .