ham_distance function

Hamiltonian distance matrix creation