cycleToMap (x:xs) = fromList $ cycleToMap' (x:xs)
  where
    cycleToMap'       [] = []
    cycleToMap'      [y] = [(y,x)]
    cycleToMap' (y:z:zs) =  (y,z) : cycleToMap' (z:zs)

-- | List of all hamiltonian cycles satisfying the constraints  
cycleToMap (x:xs) = fromList $ cycleToMap' (x:xs)
  where
    cycleToMap'       [] = []
    cycleToMap'      [y] = [(y,x)]
    cycleToMap' (y:z:zs) =  (y,z) : cycleToMap' (z:zs)

-- | List of all hamiltonian cycles satisfying the constraints  
cycleToMap (x:xs) = fromList $ cycleToMap' (x:xs)
  where
    cycleToMap'       [] = []
    cycleToMap'      [y] = [(y,x)]
    cycleToMap' (y:z:zs) =  (y,z) : cycleToMap' (z:zs)

-- | List of all hamiltonian cycles satisfying the constraints  