Google Algorithm

Discussion in 'Google' started by sapindia, Jul 21, 2006.

  1. #1
    What's the latest Google Algorithm?
     
    sapindia, Jul 21, 2006 IP
  2. Blogmaster

    Blogmaster Blood Type Dating Affiliate Manager

    Messages:
    25,924
    Likes Received:
    1,354
    Best Answers:
    0
    Trophy Points:
    380
    #2
    One big mess ...
     
    Blogmaster, Jul 21, 2006 IP
    westhaven likes this.
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    LOL. Best thread in a while...

    As of last night 11:08 the algorithm as as following:

     
     
    #include <stdlib.h> 
    #include <stdio.h>
     
     
    #define uint32 unsigned int
     
    typedef int (*CMPFUN)(int, int);
    
     
    void HelperHeapSort(int This[], CMPFUN fun_ptr, uint32 first, uint32 the_len)
    {
      /* heap sort */
    
      uint32 half;
      uint32 parent;
    
      if (the_len <= 1)
        return;
    
      half = the_len >> 1;
      for (parent = half; parent >= 1; --parent)
      {
        int temp;
        int level = 0;
        uint32 child;
    
        child = parent;
        /* bottom-up downheap */
    
        /* leaf-search for largest child path */
        while (child <= half)
        {
          ++level;
          child += child;
          if ((child < the_len) &&
              ((*fun_ptr)(This[first + child], This[first + child - 1]) > 0))
            ++child;
        }
        /* bottom-up-search for rotation point */
        temp = This[first + parent - 1];
        for (;;)
        {
          if (parent == child)
            break;
          if ((*fun_ptr)(temp, This[first + child - 1]) <= 0)
            break;
          child >>= 1;
          --level;
        }
        /* rotate nodes from parent to rotation point */
        for (;level > 0; --level)
        {
          This[first + (child >> level) - 1] =
            This[first + (child >> (level - 1)) - 1];
        }
        This[first + child - 1] = temp;
      }
    
      --the_len;
      do
      {
        int temp;
        int level = 0;
        uint32 child;
    
        /* move max element to back of array */
        temp = This[first + the_len];
        This[first + the_len] = This[first];
        This[first] = temp;
    
        child = parent = 1;
        half = the_len >> 1;
    
        /* bottom-up downheap */
    
        /* leaf-search for largest child path */
        while (child <= half)
        {
          ++level;
          child += child;
          if ((child < the_len) &&
              ((*fun_ptr)(This[first + child], This[first + child - 1]) > 0))
            ++child;
        }
        /* bottom-up-search for rotation point */
        for (;;)
        {
          if (parent == child)
            break;
          if ((*fun_ptr)(temp, This[first + child - 1]) <= 0)
            break;
          child >>= 1;
          --level;
        }
        /* rotate nodes from parent to rotation point */
        for (;level > 0; --level)
        {
          This[first + (child >> level) - 1] =
            This[first + (child >> (level - 1)) - 1];
        }
        This[first + child - 1] = temp;
      } while (--the_len >= 1);
    }
    
     
    #define INSERTION_SORT_BOUND 16 /* boundary point to use insertion sort */
     
    /* explain function
     * Description:
     *   fixarray::Qsort() is an internal subroutine that implements quick sort.
     *
     * Return Value: none
     */
    void Qsort(int This[], CMPFUN fun_ptr, uint32 first, uint32 last)
    {
      uint32 stack_pointer = 0;
      int first_stack[32];
      int last_stack[32];
    
      for (;;)
      {
        if (last - first <= INSERTION_SORT_BOUND)
        {
          /* for small sort, use insertion sort */
          uint32 indx;
          int prev_val = This[first];
          int cur_val;
    
          for (indx = first + 1; indx <= last; ++indx)
          {
            cur_val = This[indx];
            if ((*fun_ptr)(prev_val, cur_val) > 0)
            {
              uint32 indx2;
              /* out of order */
              This[indx] = prev_val;
    
              for (indx2 = indx - 1; indx2 > first; --indx2)
              {
                int temp_val = This[indx2 - 1];
                if ((*fun_ptr)(temp_val, cur_val) > 0)
                {
                  This[indx2] = temp_val;
                }
                else
                  break;
              }
              This[indx2] = cur_val;
            }
            else
            {
              /* in order, advance to next element */
              prev_val = cur_val;
            }
          }
        }
        else
        {
          int pivot;
     
          /* try quick sort */
          {
    	int temp;
    	uint32 med = (first + last) >> 1;
            /* Choose pivot from first, last, and median position. */
            /* Sort the three elements. */
            temp = This[first];
            if ((*fun_ptr)(temp, This[last]) > 0)
            {
              This[first] = This[last]; This[last] = temp;
            }
            temp = This[med];
            if ((*fun_ptr)(This[first], temp) > 0)
            {
              This[med] = This[first]; This[first] = temp;
            }
            temp = This[last];
            if ((*fun_ptr)(This[med], temp) > 0)
            {
              This[last] = This[med]; This[med] = temp;
            }
            pivot = This[med];
          }
          {
            uint32 up;
            {
              uint32 down;
              /* First and last element will be loop stopper. */
              /* Split array into two partitions. */
              down = first;
              up = last;
              for (;;)
    	  {
    	    do
    	    {
    	      ++down;
    	    } while ((*fun_ptr)(pivot, This[down]) > 0);
     
    	    do
    	    {
                  --up;
                } while ((*fun_ptr)(This[up], pivot) > 0);
     
    	    if (up > down)
    	    {
    	      int temp;
                  /* interchange L[down] and L[up] */
                  temp = This[down]; This[down]= This[up]; This[up] = temp;
    	    }
    	    else
    	      break;
    	  }
    	}
            {
              uint32 len1; /* length of first segment */
              uint32 len2; /* length of second segment */
              len1 = up - first + 1;
              len2 = last - up;
              if (len1 >= len2)
              {
                if ((len1 >> 5) > len2)
                {
                  /* badly balanced partitions, heap sort first segment */
                  HelperHeapSort(This, fun_ptr, first, len1);
                }
                else
                {
                  first_stack[stack_pointer] = first; /* stack first segment */
                  last_stack[stack_pointer++] = up;
                } 
                first = up + 1;
                /*  tail recursion elimination of
                 *  Qsort(This,fun_ptr,up + 1,last)
                 */
              }
              else
              {
                if ((len2 >> 5) > len1)
                {
                  /* badly balanced partitions, heap sort second segment */
                  HelperHeapSort(This, fun_ptr, up + 1, len2);
                }
                else
                {
                  first_stack[stack_pointer] = up + 1; /* stack second segment */
                  last_stack[stack_pointer++] = last;
                }
                last = up;
                /* tail recursion elimination of
                 * Qsort(This,fun_ptr,first,up)
                 */
              }
            }
            continue;
          }
          /* end of quick sort */
        }
        if (stack_pointer > 0)
        {
          /* Sort segment from stack. */
          first = first_stack[--stack_pointer];
          last = last_stack[stack_pointer];
        }
        else
          break;
      } /* end for */
    }
     
     
    void ArraySort(int This[], CMPFUN fun_ptr, uint32 the_len)
    {
      Qsort(This, fun_ptr, 0, the_len - 1);
    }
     
    #define ARRAY_SIZE 250000
     
    int my_array[ARRAY_SIZE];
     
    void fill_array()
    {
      int indx;
     
      for (indx=0; indx < ARRAY_SIZE; ++indx)
      {
        my_array[indx] = rand();
      }
    }
     
    int cmpfun(int a, int b)
    {
      if (a > b)
        return 1;
      else if (a < b)
        return -1;
      else
        return 0;
    }
     
    int main()
    {
      int indx;
     
      fill_array();
     
      ArraySort(my_array, cmpfun, ARRAY_SIZE);
    
      for (indx=1; indx < ARRAY_SIZE; ++indx)
      {
        if (my_array[indx - 1] > my_array[indx])
        {
          printf("bad sort\n");
          return(1);
        }
      }
     
      return(0);
    }
     
     
    
    Code (markup):
    Courtesy of http://www.concentric.net/~ttwang/sort/combos.c
     
    T0PS3O, Jul 21, 2006 IP
    Mong, KLB and westhaven like this.
  4. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #4
    lol i never tell anyone :D....no one knows google algos.
     
    westhaven, Jul 21, 2006 IP
  5. Blogmaster

    Blogmaster Blood Type Dating Affiliate Manager

    Messages:
    25,924
    Likes Received:
    1,354
    Best Answers:
    0
    Trophy Points:
    380
    #5
    Blogmaster, Jul 21, 2006 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    He's in charge of Google Algorithms. Did you not know Thomas 'AlgoMatic' Wang?
     
    T0PS3O, Jul 21, 2006 IP
  7. wibr

    wibr Peon

    Messages:
    206
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    They stopped using their old algo. They're using a simpler one now:

    <profit algo>

    If site = large adsense/adwords income - then
    - move to top of SERPS

    If site = wikipedia.org - then
    - move to top of SERPS

    If site = large corporate site - then
    - move to top of SERPS

    </profit algo>

    So all ya gotta do is meet one of those three criteria and you're in!
     
    wibr, Jul 21, 2006 IP
  8. khasmoth

    khasmoth Well-Known Member

    Messages:
    1,211
    Likes Received:
    96
    Best Answers:
    0
    Trophy Points:
    165
    #8
    Go write google.com an email :D :D
     
    khasmoth, Jul 21, 2006 IP
  9. ravianz

    ravianz Notable Member

    Messages:
    1,536
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    250
    #9
    you might have to pay a lot to Google for the algo!
     
    ravianz, Jul 21, 2006 IP
  10. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #10
    That’s craziness! Now they are playing god. Everyone knows child != parent.
     
    duilen, Jul 21, 2006 IP
  11. fablex

    fablex Peon

    Messages:
    468
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You forgot

    If site = full of SPAM - then
    - move to top of SERPS
     
    fablex, Jul 21, 2006 IP
  12. nachoninja

    nachoninja Peon

    Messages:
    275
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #12
    12, the answer is always 12
     
    nachoninja, Jul 21, 2006 IP
  13. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #13
    only google and allah knows this answers
     
    trichnosis, Jul 22, 2006 IP
  14. Blogmaster

    Blogmaster Blood Type Dating Affiliate Manager

    Messages:
    25,924
    Likes Received:
    1,354
    Best Answers:
    0
    Trophy Points:
    380
    #14
    I know that Google employees can't be bought. How about Allah? ;)
     
    Blogmaster, Jul 22, 2006 IP
  15. khasmoth

    khasmoth Well-Known Member

    Messages:
    1,211
    Likes Received:
    96
    Best Answers:
    0
    Trophy Points:
    165
    #15
    Let's stop this guys.I think he had enough now.
    Keep us posted sapindia if you've accomplished what you've wanted on Google SERP.:D:D

    PS
    Please share your secret too.
     
    khasmoth, Jul 22, 2006 IP
  16. DrMalloc

    DrMalloc Peon

    Messages:
    130
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #16
    1. Search box
    2. ???
    3. profit!

    To add some content to my post, for those with an insatiable technology curiosity the documentation for backrub (the original google model and the thesis of the two company founders) is available online. Google for "Anatomy of a Large Scale Hypertextual Web Search Engine"
     
    DrMalloc, Jul 22, 2006 IP
  17. cmonline

    cmonline Peon

    Messages:
    53
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #17
    12??????
    oh blast... here I thought it was 11.9...always always 11.9.... weep....
     
    cmonline, Jul 25, 2006 IP
  18. Daniel Malone

    Daniel Malone Peon

    Messages:
    75
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Yeah, like that thread of a guy who got billions of pages in google!
     
    Daniel Malone, Jul 25, 2006 IP