Set<Label> deadLabels = new HashSet<Label>();
Map<Label,CmpVertex> labelToState = new TreeMap<Label,CmpVertex>();
for(Entry<CmpVertex,Map<Label,CmpVertex>> entry:graph.transitionMatrix.entrySet())
{
CmpVertex state = entry.getKey();
for(Entry<Label,CmpVertex> target:entry.getValue().entrySet())
if (!deadLabels.contains(target.getKey()))
{// the label is not already recorded as leading to multiple different states.
CmpVertex recordedState = labelToState.get(target.getKey());
if (recordedState == null)
// first time we've seen this label in use
labelToState.put(target.getKey(),state);
else
if (recordedState != state)