ai4co / reevo

[NeurIPS 2024] ReEvo: Large Language Models as Hyper-Heuristics with Reflective Evolution
https://ai4co.github.io/reevo/
MIT License
116 stars 24 forks source link

Attempt 1 failed with error: Request timed out. #6

Closed Li-lab98 closed 5 months ago

Li-lab98 commented 5 months ago

How to solve this problem?

[2024-05-27 11:03:36,897][root][INFO] - Using LLM: gpt-3.5-turbo [2024-05-27 11:03:36,899][root][INFO] - Using Algorithm: reevo [2024-05-27 11:03:38,178][root][INFO] - Problem: tsp_aco [2024-05-27 11:03:38,178][root][INFO] - Problem description: Solving Traveling Salesman Problem (TSP) via stochastic solution sampling following "heuristics". TSP requires finding the shortest path that visits all given nodes and returns to the starting node. [2024-05-27 11:03:38,178][root][INFO] - Function name: heuristics [2024-05-27 11:03:38,191][root][INFO] - Evaluating seed function... [2024-05-27 11:03:38,191][root][INFO] - Seed function code: import numpy as np def heuristics_v2(distance_matrix: np.ndarray) -> np.ndarray: return 1 / distance_matrix [2024-05-27 11:03:38,191][root][INFO] - Iteration 0: Running Code 0 [2024-05-27 11:03:40,944][root][INFO] - Iteration 0: Code Run 0 successful! [2024-05-27 11:03:49,394][root][INFO] - Iteration 0, response_id 0: Objective value: 6.737054565194424 [2024-05-27 11:03:49,394][root][INFO] - Iteration 0: Elitist: 6.737054565194424 [2024-05-27 11:03:49,394][root][INFO] - Iteration 0 finished... [2024-05-27 11:03:49,396][root][INFO] - Best obj: 6.737054565194424, Best Code Path: problem_iter0_code0.py [2024-05-27 11:03:49,396][root][INFO] - Function Evals: 1 [2024-05-27 11:03:49,396][root][INFO] - Initial Population Prompt: System Prompt: You are an expert in the domain of optimization heuristics. Your task is to design heuristics that can effectively solve optimization problems. Your response outputs Python code and nothing else. Format your code as a Python code string: "python ...". User Prompt: Write a heuristics function for Solving Traveling Salesman Problem (TSP) via stochastic solution sampling following "heuristics". TSP requires finding the shortest path that visits all given nodes and returns to the starting node. The heuristics function takes as input a distance matrix, and returns prior indicators of how promising it is to include each edge in a solution. The return is of the same shape as the input.

def heuristics_v1(distance_matrix: np.ndarray) -> np.ndarray: return 1 / distance_matrix Refer to the format of a trivial design above. Be very creative and give heuristics_v2. Output code only and enclose your code with Python code block: python ....

Furffico commented 5 months ago

This is probably due to a network error. Please check if your connection to OpenAI's API (https://api.openai.com/v1/chat/completions) is valid.

Li-lab98 commented 5 months ago

Thanks, the code is working fine now.