def edges_in_all_hamiltonian_cycles(operational_limit=nil)
      hedges = nil
      hamiltonian_cycles do |path|
        # Convert the path to a hash v1->v2, v2->v3. Can't have collisions because the path is Hamiltonian
        edge_hash = {}
        path.each_with_index do |v, i|
          unless i == path.length-1
            edge_hash[v] = path[i+1]
          end
        end
        edge_hash[path[path.length-1]] = path[0] #Add the final wrap around edge

        if hedges.nil?
          # First Hpath found
          hedges = edge_hash
        else
          # Use a process of elimination, removing all edges that
          # aren't in hedges or this new Hpath
          hedges.select! do |v1, v2|
            edge_hash[v1] == v2 or edge_hash[v2] = v1
          end
          # If no edges fit the bill, then we are done
          return [] if hedges.empty?
        end
      end
      return [] if hedges.nil? #no Hpaths found in the graph
      return hedges.to_a
    end
def edges_in_all_hamiltonian_cycles(operational_limit=nil)
      hedges = nil
      hamiltonian_cycles do |path|
        # Convert the path to a hash v1->v2, v2->v3. Can't have collisions because the path is Hamiltonian
        edge_hash = {}
        path.each_with_index do |v, i|
          unless i == path.length-1
            edge_hash[v] = path[i+1]
          end
        end
        edge_hash[path[path.length-1]] = path[0] #Add the final wrap around edge

        if hedges.nil?
          # First Hpath found
          hedges = edge_hash
        else
          # Use a process of elimination, removing all edges that
          # aren't in hedges or this new Hpath
          hedges.select! do |v1, v2|
            edge_hash[v1] == v2 or edge_hash[v2] = v1
          end
          # If no edges fit the bill, then we are done
          return [] if hedges.empty?
        end
      end
      return [] if hedges.nil? #no Hpaths found in the graph
      return hedges.to_a
    end
Return an array of edges (edges being an array of 2 vertices)
 that correspond to edges that are found in all Hamiltonian paths.
 This method might be quite slow because it requires finding all Hamiltonian
 paths, which implies solving the (NP-complete) Hamiltonian path problem.

 There is probably no polynomial time way to implement this method anyway, see
 http://cstheory.stackexchange.com/questions/20413/is-there-an-efficient-algorithm-for-finding-edges-that-are-part-of-all-hamiltoni

 The operational limit is used to make sure this algorithm doesn't
 get out of hand - only this many 'operations' are used when traversing
 the graph, as in #hamiltonian_cycles_brute_force