@@ -508,34 +508,48 @@ void fillGraphWithRemainingEdges(ClusteringInfo cInfo, ArrayList<Community> comm
508
508
509
509
public void generateKnows ( ArrayList <Person > persons , int seed , ArrayList <Float > percentages , int step_index ) {
510
510
511
+ long start , end ;
511
512
rand .setSeed (seed );
512
513
this .percentages = percentages ;
513
514
this .stepIndex = step_index ;
514
515
516
+ start = System .currentTimeMillis ();
515
517
ArrayList <Community > communities = generateCommunities (persons );
518
+ end = System .currentTimeMillis ();
519
+ System .out .println ("Time to configure communities: " +(end -start ));
520
+
516
521
ClusteringInfo cInfo = new ClusteringInfo ( persons .size (), communities );
517
522
518
523
System .out .println ("Number of generated communities: " +communities .size ());
519
524
520
525
526
+ start = System .currentTimeMillis ();
521
527
for ( Community c : communities ) {
522
528
c .p_ = 1.0f ;
523
529
computeCommunityInfo (cInfo , c , 1.0f );
524
530
}
531
+ end = System .currentTimeMillis ();
532
+ System .out .println ("Time to compute initial community information: " +(end -start ));
525
533
534
+ start = System .currentTimeMillis ();
526
535
for ( Community c : communities ) {
527
536
c .p_ = 1.0f ;
528
537
estimateCCCommunity (cInfo , c , c .p_ );
529
538
}
530
539
531
540
float maxCC = clusteringCoefficient (communities , cInfo );
541
+ end = System .currentTimeMillis ();
532
542
System .out .println ("maxCC: " +maxCC );
543
+ System .out .println ("Time to compute maximum CC: " +(end -start ));
533
544
545
+ start = System .currentTimeMillis ();
534
546
for ( Community c : communities ) {
535
547
c .p_ = 0.5f ;//rand.nextFloat();
536
548
//c.p_ = rand.nextFloat();
537
549
estimateCCCommunity (cInfo , c , c .p_ );
538
550
}
551
+ end = System .currentTimeMillis ();
552
+ System .out .println ("Time to compute the initial solution: " +(end -start ));
539
553
540
554
PersonGraph graph ;
541
555
boolean iterate ;
@@ -544,15 +558,21 @@ public void generateKnows( ArrayList<Person> persons, int seed, ArrayList<Float>
544
558
do {
545
559
System .out .println ("Starting refinement iteration" );
546
560
iterate = false ;
561
+ start = System .currentTimeMillis ();
547
562
refineCommunities (cInfo , communities , fakeTargetCC );
563
+ end = System .currentTimeMillis ();
564
+ System .out .println ("Time to refine communities: " +(end -start ));
565
+
548
566
System .out .println ("Creating graph" );
549
567
550
- long start , end ;
568
+ start = System . currentTimeMillis () ;
551
569
for (Community c : communities ) {
552
570
createEdgesCommunityCore (persons , c );
553
571
createEdgesCommunityPeriphery (cInfo , persons , c );
554
572
}
555
573
fillGraphWithRemainingEdges (cInfo , communities , persons );
574
+ end = System .currentTimeMillis ();
575
+ System .out .println ("Time to generate graph: " +(end -start ));
556
576
557
577
graph = new PersonGraph (persons );
558
578
System .out .println ("Computing clustering coefficient" );
0 commit comments