Identify paths and cycles (#701)