Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Child pages (Children Display)

Table of Contents

Table of Contents

How To's

...

  • 2010.10.11 - amix.dk - How Hacker News ranking algorithm works
    • In essence the ranking performed by Hacker News looks like this:
      Score = (P-1) / (T+2)^G

      where,
      P = points of an item (and -1 is to negate submitters vote)
      T = time since submission (in hours)
      G = Gravity, defaults to 1.8 in news.arc

      Gravity and time have a significant impact on the score of an item. Generally these things hold true:

      - the score decreases as T increases, meaning that older items will get lower and lower scores
      - the score decreases much faster for older items if gravity is increased

    • HN discussion
    • I couldn't make sense of the Arc/Lisp code, but the Python version (of the original Arc implementation) is:

      • Code Block
        languagepy
        def calculate_score(votes, item_hour_age, gravity=1.8):
            return (votes - 1) / pow((item_hour_age+2), gravity)


    • The practical takeaway from knowing how the algorithm works seems to line up with the advice people have been giving:
      1. The only way you can influence your article's ranking are by trying to influence 1) the age of your submission, and 2) the number of upvotes.
      2. Submit in the early morning on a weekday.
        1. A submission is heavily penalized by the algorithm for being more than a few hours old. If you submit your article at 3am Pacific and get only a handful of upvotes until 9am Pacific, and someone else submits at 9am Pacific and gets some friends to give them a "boost" of a few upvotes, and then both your articles begin getting upvoted at the same rate, the other person may end up with a (far?) higher score than you.
      3. Organize a group of people to upvote your article within the first 20-30 minutes of submitting.
    • It isn't clear to me how PG arrived at "1.8" for the gravity factor.
      • Gravity effects ← The three values of gravity tried here are 0.5, 1.8, and 2.0.
      • From looking at the graph, and from my experience with HN, it seems the gravity factor is tweaked to have the popular articles stay on the front page for hours, but the 'average' articles changing every few hours.

...