Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FEATURE REQUEST] <title> Add Hierholzer’s Algorithm for Eulerian Path/Circuit #6690

Open
@boom2831

Description

What would you like to Propose?

Description

Currently, the repository includes several advanced graph algorithms such as Edmonds-Karp, Hopcroft-Karp, constrained shortest path, and more. However, it does not contain an implementation for finding an Eulerian Path or Circuit, which is a classical graph problem.

Hierholzer’s Algorithm is an efficient and easy-to-understand approach for finding Eulerian paths and circuits in undirected or directed graphs. This addition would help users find a trail that visits every edge exactly once, and would be a valuable resource for those learning or applying graph theory.

Proposed Solution:

Implement Hierholzer’s Algorithm in Java under src/main/java/com/thealgorithms/graph.
Provide clear documentation and example usage.
Add relevant test cases to verify correctness.

References:

https://en.wikipedia.org/wiki/Eulerian_path#Hierholzer's_algorithm

Benefits:

Completes the set of classical graph traversal algorithms in the repository.
Useful for problems in circuit design, networking, and route planning.
Simple to implement and understand, suitable for beginners and intermediate contributors.

Issue details

Proposal:

Implement Hierholzer’s Algorithm to find an Eulerian path or circuit in a directed or undirected graph.

Problem Statement:

An Eulerian path is a trail in a graph that visits every edge exactly once. An Eulerian circuit is an Eulerian path that starts and ends at the same vertex. Hierholzer’s Algorithm efficiently finds such paths/circuits when they exist, which is useful in applications like circuit design, DNA sequencing, and route planning. Currently, this algorithm is not implemented in the repository.

Issue Details:

Implement Hierholzer’s Algorithm in Java, under src/main/java/com/thealgorithms/graph.
Accept both directed and undirected graphs as input.
Provide methods to check existence of Eulerian path/circuit.
Return the actual path/circuit as output.
Include clear documentation and examples.
Add relevant test cases to verify functionality.

Additional Information:

Reference: https://en.wikipedia.org/wiki/Eulerian_path#Hierholzer's_algorithm

This addition will complement existing classical graph algorithms and help users learn and apply Eulerian graph concepts.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /