Skip to content

Cycle Detection and Analysis #4

@JohnnyWan1123

Description

@JohnnyWan1123

Description

Implement algorithms to detect cycles, find all cycles, detect negative cycles, and compute graph girth (shortest cycle length).

Tasks

  • Implement basic cycle detection using DFS
  • Implement negative cycle detection (Bellman-Ford)
  • Implement shortest cycle finder (girth)
  • Add option to find all cycles (with size limits)
  • Handle directed and undirected graphs
  • Write unit tests for various cycle scenarios
  • Add performance optimizations for large graphs

Acceptance Criteria

  • Cycle detection works for both directed and undirected graphs
  • Negative cycles are correctly identified in weighted graphs
  • Girth computation works for graphs with cycles
  • All cycles can be found for small graphs (<15 nodes)
  • Proper handling of acyclic graphs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions