title: About Graphchi from Graphlabs: community detection example
body: <p>If someone is aware of Graphchi and tried to understand the communitydetection.cpp code I need help in understanding what this piece of code is doing in the step by tep fashion:</p>
  
  <pre><code> for(int i=0; i &lt; vertex.num_edges(); i++) {
              bidirectional_label edgelabel = vertex.edge(i)-&gt;get_data();
              vid_t nblabel = neighbor_label(edgelabel, vertex.id(), vertex.edge(i)-&gt;vertex_id());
              std::map&lt;vid_t, int&gt;::iterator existing = counts.find(nblabel);
              int newcount = 0;
              if(existing == counts.end()) {
                  counts.insert(std::pair&lt;vid_t,int&gt;(nblabel, 1));
                  newcount = 1;
              } else {
                  existing-&gt;second++;//map iterator
                  newcount = existing-&gt;second;
              }
              if (newcount &gt; maxcount || (maxcount == newcount &amp;&amp; nblabel &gt; maxlabel)) {
                  maxlabel = nblabel;
                  maxcount = newcount;
              }
          }
          newlabel = maxlabel;
      }
  </code></pre>