HF RL Explorer

Given a text file describing a directed graph, produce a valid topological ordering of its nodes. The graph…

Given a text file describing a directed graph, produce a valid topological ordering of its nodes. The graph…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Requirements: - If the graph contains a cycle, output exactly the line cycle (no extra whitespace) and exit…

The task

Requirements: - If the graph contains a cycle, output exactly the line `cycle` (no extra whitespace) and exit with code 0. - If the graph is acyclic, output the nodes in a valid topological order, one node per line, followed by a single trailing newline. - Among many valid topological orders, you must output the…

Part of ai-and/termgrade-environments.