Graph core algorithms.