public static LeftRegularBipartiteGraphSegment buildRandomLeftRegularBipartiteGraph(int leftSize,int rightSize,int leftDegree,Random random){
  LeftRegularBipartiteGraphSegment leftRegularBipartiteGraphSegment=new LeftRegularBipartiteGraphSegment(leftSize / 2,leftDegree,rightSize / 2,leftSize / 2,2.0,Integer.MAX_VALUE,new IdentityEdgeTypeMask(),new NullStatsReceiver());
  LongSet addedIds=new LongOpenHashSet(leftDegree);
  for (int i=0; i < leftSize; i++) {
    addedIds.clear();
    for (int j=0; j < leftDegree; j++) {
      long idToAdd;
      do {
        idToAdd=random.nextInt(rightSize);
      }
 while (addedIds.contains(idToAdd));
      addedIds.add(idToAdd);
      leftRegularBipartiteGraphSegment.addEdge(i,idToAdd,(byte)0);
    }
  }
  return leftRegularBipartiteGraphSegment;
}

public static LeftRegularBipartiteGraphSegment buildRandomLeftRegularBipartiteGraph ( int leftSize , int rightSize , int leftDegree , Random random ) { LeftRegularBipartiteGraphSegment leftRegularBipartiteGraphSegment = new LeftRegularBipartiteGraphSegment ( leftSize / 2 , leftDegree , rightSize / 2 , leftSize / 2 , 2.0 , Integer . MAX_VALUE , new IdentityEdgeTypeMask ( ) , new NullStatsReceiver ( ) ) ; LongSet addedIds = new LongOpenHashSet ( leftDegree ) ; for ( int i = 0 ; i < leftSize ; i ++ ) { addedIds . clear ( ) ; for ( int j = 0 ; j < leftDegree ; j ++ ) { long idToAdd ; do { idToAdd = random . nextInt ( rightSize ) ; } while ( addedIds . contains ( idToAdd ) ) ; addedIds . add ( idToAdd ) ; leftRegularBipartiteGraphSegment . addEdge ( i , idToAdd , ( byte ) 0 ) ; } } return leftRegularBipartiteGraphSegment ; }
build a random left - regular bipartite graph of given left and right sizes .
