On a new edge function on complete weighted graphs and its application for locating Hamiltonian cycles of small weight