| 1111 | |
| 1112 | /** @internal */ |
| 1113 | const invalidateCycleFlagOnAddition = <N, E, T extends Kind = "directed">( |
| 1114 | mutable: MutableGraph<N, E, T> |
| 1115 | ): void => { |
| 1116 | // Only invalidate if the graph was acyclic (adding edges cannot remove cycles from cyclic graphs) |
| 1117 | // If already unknown (null) or cyclic (false), no need to change |
| 1118 | if (Option.isSome(mutable.isAcyclic) && mutable.isAcyclic.value === true) { |
| 1119 | mutable.isAcyclic = Option.none() |
| 1120 | } |
| 1121 | } |
| 1122 | |
| 1123 | // ============================================================================= |
| 1124 | // Edge Operations |