public void execute(Graph graph, AttributeModel attributeModel) {
//Look if the result column already exist and create it if needed
AttributeTable nodeTable = attributeModel.getNodeTable();
AttributeColumn col = nodeTable.getColumn(AVG_EUCLIDEAN_DISTANCE);
if (col == null) {
col = nodeTable.addColumn(AVG_EUCLIDEAN_DISTANCE, "Average Euclidean Distance", AttributeType.DOUBLE, AttributeOrigin.COMPUTED, 0.0);
}
//Lock to graph. This is important to have consistent results if another
//process is currently modifying it.
graph.readLock();