public double getNeighborhoodConductanceUnweighted()

in src/main/java/com/twitter/sbf/graph/Graph.java [131:152]


  public double getNeighborhoodConductanceUnweighted(int i) {
    if (this.getDegree(i) < 2) {
      return 1.0;
    }
    double cut = 0;
    double vol = 0;
    for (Integer vertexId : this.getNeighbors(i)) {
      for (Integer neighborId : this.getNeighbors(vertexId)) {
        if (!this.isNeighbors(neighborId, i) && neighborId != i) {
          cut += 1;
        }
      }
      vol += this.getDegree(vertexId);
    }
    vol += this.getDegree(i);
    double edge2 = 2.0 * this.getNumEdges();
    if (vol != edge2 && vol != 0) {
      return cut / Math.min(vol, edge2 - vol);
    } else {
      return 0.0;
    }
  }