Utilities used by JGraphT algorithms.