Finding the maximal strong components in a directed graph