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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to