Write a programming algorithmic task in the following format: "Title":…
- User
Assistant: User: Write a programming algorithmic task in the following format:
"Title": "[Task title]", "Task Description": "[Brief description of the task, what needs to be done]", "Function Signature": "def function_name -> [return type]:"
Please make sure the task is more complex, unique, and does not resemble common problems from LeetCode. Focus on originality and complexity.
Also, provide a solution for the task in Python code in the following format:
"Solve": "[Solution to the task in Python]"
Please follow this format exactly, without any additional explanations or comments.
Assistant:
- Assistant
"Title": "Graph-based Traffic Flow Analysis", "Task Description": "Given a directed graph representing a city's traffic network where nodes represent intersections and edges represent roads with specific capacities, design an algorithm that determines the maximum traffic flow from a given source intersection to a destination intersection. The algorithm should also return the specific paths used in achieving this maximum flow, including the amount of traffic on each path. Traffic flow through an edge should not exceed its capacity.", "Function Signature": "def calculate_max_flow(graph: dict, source: int, destination: int) -> (int, list):"
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.