}
@SuppressWarnings("unchecked")
protected static int getEffectiveDiameter(DirectedSparseGraph machine)
{
DijkstraDistance p = new DijkstraDistance(machine);
List<Integer> distances = new LinkedList<Integer>();
for(DeterministicVertex v:(Set<DeterministicVertex>)machine.getVertices())
for(DeterministicVertex vOther:(Set<DeterministicVertex>)machine.getVertices())
{
int length = 0;
Number distance = p.getDistance(v, vOther);if (distance != null) length = distance.intValue();
if (length > 0) // non-empty path
distances.add(length);
// cannot limit consideration to a triangular subset because the relation is not symmetric.
}