Skip to content

Eulerian and Hamiltonian Path Algorithms #5

@JohnnyWan1123

Description

@JohnnyWan1123

Description

Implement algorithms to check for and find Eulerian paths/circuits and Hamiltonian paths/circuits. Note: Hamiltonian is NP-complete, so focus on small graphs and verification.

Tasks

  • Implement Eulerian path/circuit existence check (degree conditions)
  • Implement Eulerian path/circuit finder (Fleury's or Hierholzer's algorithm)
  • Implement Hamiltonian path/circuit verification (check if given path is valid)
  • Add Hamiltonian existence check with timeout for small graphs
  • Support both directed and undirected graphs for Eulerian
  • Write comprehensive unit tests
  • Add clear feedback for why Eulerian path doesn't exist

Acceptance Criteria

  • Eulerian algorithms work correctly for all graph types
  • Hamiltonian verification works for any graph size
  • Hamiltonian existence check works for graphs up to 10 nodes
  • Clear feedback when paths don't exist
  • Unit tests cover all edge cases

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions