cyclegraph: add destructor, use 'const' appropriately