-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct cycle finding for graphs (#2199)
Closes #2198 . Adds a new function `findCycle` for finding directed cycles in graphs via DFS, and updates `failOnCyclicGraph` to use it rather than SCCs for reporting cycles.
- Loading branch information
Showing
2 changed files
with
103 additions
and
14 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
data/scenarios/Testing/_Validation/2198-prerequisite-SCC.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: 1 | ||
name: | | ||
Prerequisite objectives: dependency cycles in a larger SCC | ||
author: Brent Yorgey | ||
description: | | ||
This should be rejected by the parser due to cyclic dependencies. | ||
The dependency graph is strongly connected, but not all four | ||
dependencies are in a single cycle together. | ||
robots: | ||
- name: base | ||
objectives: | ||
- id: a | ||
condition: 'true' | ||
prerequisite: | ||
logic: | ||
and: | ||
- b | ||
- c | ||
- d | ||
- id: b | ||
condition: 'true' | ||
prerequisite: a | ||
- id: c | ||
condition: 'true' | ||
prerequisite: | ||
logic: | ||
and: | ||
- a | ||
- d | ||
- id: d | ||
condition: 'true' | ||
prerequisite: | ||
logic: | ||
and: | ||
- a | ||
- c | ||
world: | ||
dsl: '{stone}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters