Thread: I'm dreaming of solving the travelling salesman problem in O(nlogn)

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    I'm dreaming of solving the travelling salesman problem in O(nlogn)

    There. Now will I get two pages of comments as well?

    Ah, I bet you guys will need what I've tried so far to tell me how to fix it. Well, right now I have this:
    Code:
    #include <stdio.h>
    using namespace std;
    
    main()
    {
    };
    Now what should I do?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Huh?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    There are lots of people dreaming about O(n log n) lately.

    I don't see why the other dreamer should deserve ridicule, though (if that's the point).
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    The "TSP" problem is "NP-Hard". It doesn't even fall into the same universe as sorting.

    In the referenced thread, no one posted source to do what the OP wanted. We only critiqued the idea and, when posted, the source.

    I'll tell you the same thing I told the OP of that thread, if you have an O(n * log(n)) solution to the "TSP" problem, I'd love to see it. If you fail to match that goal, I'll be happy to critique your source as well.

    So do you have a solution? Or were you honestly just wanting to make a fool of yourself by whining because your previous thread didn't get as much attention as you thought it deserved?

    Soma

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by phantomotap View Post
    So do you have a solution? Or were you honestly just wanting to make a fool of yourself by whining because your previous thread didn't get as much attention as you thought it deserved?
    "My previous thread"? I don't even know which one that would be.

    This was kind of a tongue-in-cheek for 2 posts, but also a hundreds of others over time. Yes, the most obvious is the "insertion sort". And if you don't think it deserves to be made fun of, read the post again.

    I forgot to add one thing to my previous post though. See, my compiler seems to have a bug as the following doesn't compile bud give a error:
    Code:
    RG3ij53ji50jithETH9j5h9j0hwtHW0gqrlpq';reglQERg;lqerg;lg
    Do you know working compiler?


    There, I just wasted another minute of your time :P. But it feels good to relieve myself of my annoyances.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Whatever.

    *thread closed*
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem solving compiler errors
    By Jan79 in forum C++ Programming
    Replies: 1
    Last Post: 07-02-2003, 10:59 AM
  2. Sign-up Thread: Problem Solving #1
    By ygfperson in forum Contests Board
    Replies: 15
    Last Post: 01-26-2003, 02:55 AM
  3. IDEA: Problem Solving Contests
    By ygfperson in forum Contests Board
    Replies: 8
    Last Post: 10-19-2002, 08:38 PM
  4. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 08:34 PM
  5. C++ problem solving, HELP....PLEASE
    By Dana in forum C++ Programming
    Replies: 3
    Last Post: 09-25-2001, 04:05 PM