Added implementation of a generic insertion sort algorithm for sorting the edges according to non-decreasing weight.