/// Return the maximum and average degree of the graph that would be returned by filter(k)
Return the maximum and average degree of the graph that would be returned by filter(k)
Return the maximum and average degree of the graph that would be returned by filter ( k )
pub(crate) fn filter_degree(&self, k: usize) -> (usize, f64) {
        let mut max_degree = 0;
        let mut sum_degree = 0;
        for v in 0..self.nvertices() {
            let mut degree = 0;
            for i in self.offsets[v]..self.offsets[v + 1] {
                if self.freqs[i] >= k {
                    degree += 1;
                }
            }
            max_degree = max_degree.max(degree);
            sum_degree += degree;
        }
        (max_degree, sum_degree as f64 / self.nvertices() as f64)
    }
pub ( crate ) fn filter_degree ( & self , k : usize ) -> ( usize , f64 ) { let mut max_degree = 0 ; let mut sum_degree = 0 ; for v in 0 .. self . nvertices ( ) { let mut degree = 0 ; for i in self . offsets [ v ] .. self . offsets [ v + 1 ] { if self . freqs [ i ] >= k { degree += 1 ; } } max_degree = max_degree . max ( degree ) ; sum_degree += degree ; } ( max_degree , sum_degree as f64 / self . nvertices ( ) as f64 ) }
Return the maximum and average degree of the graph that would be returned by filter(k)
Return the maximum and average degree of the graph that would be returned by filter ( k )
&self
k
usize