public static int getVertexCountAtDistance ( IAtomContainer atomContainer , int distance ) { int natom = atomContainer . getAtomCount ( ) ; int [ ] [ ] admat = AdjacencyMatrix . getMatrix ( atomContainer ) ; int [ ] [ ] distanceMatrix = computeFloydAPSP ( admat ) ; int matches = 0 ; for ( int i = 0 ; i < natom ; i ++ ) { for ( int j = 0 ; j < natom ; j ++ ) { if ( distanceMatrix [ i ] [ j ] == distance ) matches ++ ; } } return matches / 2 ; }
Returns the number of vertices that are a distance d apart .