Please generate a unique JSON object suitable for automating the…
- User
Assistant: User: Please generate a unique JSON object suitable for automating the programming task testing platform, strictly in the following format: { "Title": "Task Name", "Task Description": "Description of the task.", "Function Signature": "def function_name(parameters) -> return_type:", "Solve": "", "Input": "Description of the input parameters.", "Output": "Description of the expected output.", "Examples": [ { "input": "Example input here", "output": "Expected output here" }, { "input": "Another example input here", "output": "Another expected output here" } ] } Ensure that:
- The task includes graph traversal algorithms.
- The JSON follows this exact structure and does not include any additional text or variations.
- The task should be complex and unique, avoiding direct copying from common platforms like LeetCode or similar sources.
- The solution must not use any imports in the code (i.e., no import statements).
- The 'Solve' section must remain empty.
- Ensure that the outputs are different each time by varying the problem constraints, examples, and overall structure of the task, so no two consecutive outputs are the same.
- Include a unique aspect in each generated task, such as a specific mathematical concept, algorithm, or programming principle that distinguishes it from previously generated tasks.
- The 'Function Signature' should strictly follow the format: 'def function_name(parameters) -> return_type:', but the 'Solve' section must remain empty. Ensure that the input description corresponds to the expected parameters in the signature.
Ensure that the solution must not be any of the following titles:
- Sum of Nested Integer Lists
- Priority-Based Job Sorting
- Balanced Brackets in Nested Arrays
- Reverse and XOR of Unique Characters
- Nested Dictionary Merger
- Maximize Array Partition Sum
- Nested Tree Depth Calculation Assistant:
- Assistant
{ "Title": "Graph Shortest Path with Constraints", "Task Description": "Given an undirected, weighted graph represented as an adjacency list and a constraint on paths that must not exceed a specific weight, find the shortest path from a start node to an end node that respects the weight constraint. The graph does not contain negative weights.", "Function Signature": "def constrained_shortest_path(graph: dict, start: int, end: int, max_weight: int) -> list:", "Solve": "", "Input": "The input consists of a dictionary 'graph' where keys are node identifiers (integers) and values are lists of tuples, each tuple containing a neighbor and the weight of the edge to that neighbor. The 'start' and 'end' are the node identifiers for the start and end nodes in the graph. 'max_weight' is the maximum allowable weight for the path.", "Output": "A list of node identifiers representing the shortest path from the start to the end node that does not exceed the specified maximum weight, or an empty list if no such path exists.", "Examples": [ { "input": "{\"0\": [(1, 4), (2, 3)], \"1\": [(0, 4), (2, 5), (3, 10)], \"2\": [(0, 3), (1, 5), (3, 3)], \"3\": [(1, 10), (2, 3)]}, 0, 3, 8", "output": "[0, 2, 3]" }, { "input": "{\"0\": [(1, 3), (4, 7)], \"1\": [(0, 3), (2, 2), (3, 5)], \"2\": [(1, 2), (3, 1)], \"3\": [(1, 5), (2, 1), (4, 1)], \"4\": [(0, 7), (3, 1)]}, 0, 3, 10", "output": "[0, 1, 2, 3]" } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.