Example #1
0
        sb = cp.deepcopy(inicial_g)
        sb = ils.Run(int(sb.M * sb.N * 0.009), inicial_g)
        tempo = time.perf_counter() - tempo
        s.append(["ILS", sb.avaliacao(), tempo])

        # # Variable Neighborhood Search
        tempo = time.perf_counter()
        sb = cp.deepcopy(inicial_g)
        sb = vns.Run(int(sb.M * sb.N * 0.005), int(sb.N * sb.N), inicial_g)
        tempo = time.perf_counter() - tempo
        s.append(["VNS", sb.avaliacao(), tempo])

        # Gado Local Search
        tempo = time.perf_counter()
        sb = cp.deepcopy(inicial_g)
        sb = gls.Run(50, inicial_g)
        tempo = time.perf_counter() - tempo
        s.append(["GLS", sb.avaliacao(), tempo])

        # Greedy Random Adptative Search Procedure (GRASP)
        tempo = time.perf_counter()
        sb = cp.deepcopy(inicial_g)
        sb = grasp.Run(20, inicial_g)
        tempo = time.perf_counter() - tempo
        s.append(["GRASP", sb.avaliacao(), tempo])

        # # Simulated Annealing
        tempo = time.perf_counter()
        sb = cp.deepcopy(inicial_g)
        sb = sa.Run(int(sb.M * sb.N), inicial_g)
        tempo = time.perf_counter() - tempo