} else {
neighborhood = neighborIndexes;
}
// extract neighborhood subgraph
final ClusterGraph neighborhoodGraph = mcodeUtil.createGraph(inputNetwork, neighbors);
if (neighborhoodGraph == null) {
// this shouldn't happen
logger.error("In " + callerID + ": neighborhoodGraph was null.");
return null;
}
// Calculate the node information for each node
final NodeInfo nodeInfo = new NodeInfo();
// Density
if (neighborhoodGraph != null)
nodeInfo.density = calcDensity(neighborhoodGraph, params.isIncludeLoops());
nodeInfo.numNodeNeighbors = neighborhood.length;
// Calculate the highest k-core
Integer k = null;
Object[] returnArray = getHighestKCore(neighborhoodGraph);
k = (Integer) returnArray[0];
ClusterGraph kCore = (ClusterGraph) returnArray[1];
nodeInfo.coreLevel = k.intValue();
// Calculate the core density - amplifies the density of heavily interconnected regions and attenuates
// that of less connected regions
if (kCore != null)