def sort_used_networks_by_hosts_size(used_network)
      used_network.sort_by.with_index { |nwrk, i| [-nwrk.hosts.size, i] }
    end
def sort_used_networks_by_hosts_size(used_network)
      used_network.sort_by.with_index { |nwrk, i| [-nwrk.hosts.size, i] }
    end
sort used networks pool in descending order based on the number of hosts
 it contains, this helps to keep larger networks on top thereby eliminating
 more number of entries in available_networks_pool at a faster pace