You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "JackyYangPassion (via GitHub)" <gi...@apache.org> on 2023/04/19 12:34:29 UTC

[GitHub] [incubator-hugegraph-computer] JackyYangPassion commented on issue #236: [Question] LPA result not as expected

JackyYangPassion commented on issue #236:
URL: https://github.com/apache/incubator-hugegraph-computer/issues/236#issuecomment-1514657667

   From Source master Code:
       /**
        * The superstep iteration stops if met one of the following conditions:
        * 1): Has run maxSuperStep times of superstep iteration.
        * 2): The mater-computation returns false that stop superstep iteration.
        * 3): All vertices are inactive and no message sent in a superstep.
        * @param masterContinue The master-computation decide
        * @return true if finish superstep iteration.
        */
   
   ```
       private boolean finishedIteration(boolean masterContinue,
                                         MasterComputationContext context) {
           if (!masterContinue) {
               return true;
           }
           if (context.superstep() >= this.maxSuperStep - 1) {
               return true;
           }
           long activeVertexCount = context.totalVertexCount() -
                                    context.finishedVertexCount();
           return context.messageCount() == 0L && activeVertexCount == 0L;
       }
   ```
   
   Fix the third condition  3): All vertices are inactive and no message sent in a superstep. to false:
   
   ```
       private boolean finishedIteration(boolean masterContinue,
                                         MasterComputationContext context) {
           if (!masterContinue) {
               return true;
           }
           if (context.superstep() >= this.maxSuperStep - 1) {
               return true;
           }
           return false;
       }
   ```
   
   The LPA result:
   4 community
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org