Recognise trails that use every edge exactly once (Eulerian) or visit every vertex exactly once (Hamiltonian).