vichitr / HacktoberfestForBeginners

New to open-source? Contribute here!!!
MIT License
102 stars 361 forks source link

Implement Topological Sorting for Directed Acyclic Graph (DAG) #590

Open Srishti2703 opened 1 year ago

Srishti2703 commented 1 year ago

This issue is dedicated to implementing the topological sorting algorithm for directed acyclic graphs (DAGs) in our Python project. Topological sorting is a fundamental graph algorithm that has practical applications in tasks like scheduling, dependency resolution, and determining the order of tasks or events.

The proposed changes for this issue include:

Implementing a Python function, say topological_sort, that performs topological sorting on a given DAG. Ensuring that the function correctly orders the vertices in a way that respects the graph's directed edges and represents a valid topological order.

The benefits of implementing this feature are as follows:

Enhanced scheduling capabilities: Users can apply topological sorting to schedule tasks or processes with dependencies efficiently. Improved codebase: The addition of this graph algorithm enhances the project's versatility for solving real-world problems.