Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Implement Topological Sort using DFS and Indegree visualization #537

Open
3 tasks done
TejasSaraf opened this issue Nov 3, 2024 · 1 comment
Open
3 tasks done

Comments

@TejasSaraf
Copy link
Contributor

Feature Summary

In a Directed Acyclic Graph (DAG), topological sorting is the process of linearly ranking vertices so that, for each directed edge u-v, vertex u appears before v in the ordering.

Description

DFS-based Approach

  • Uses a recursive depth-first search
  • Typically implemented using a stack
  • Detects cycles during traversal

Indegree-based Approach (Kahn's Algorithm)

  • Uses a queue to process nodes
  • Iteratively removes nodes with zero in-degree
  • Naturally detects cycles if not all nodes are processed

Problems It Solves

  1. Dependency Resolution: Topological sort is crucial for solving dependency-related problems in various domains, such as:
  • Build systems and package managers
  • Task scheduling
  • Course prerequisites in academic planning
  1. Cycle Detection: Both implementations can detect cycles in a graph, which is essential for identifying circular dependencies.

By implementing and visualizing both approaches, users gain a comprehensive understanding of topological sorting, its applications, and the trade-offs between different algorithms. This feature enhances problem-solving skills and provides practical insights into graph theory and algorithm design.

Proposed Solution

No response

Alternatives Considered

No response

Screenshots/Logs

No response

Additional Information

  • I have searched for existing feature requests
  • I am willing to help implement this feature
  • I can provide more details or clarification if needed
@sakeel-103
Copy link
Owner

@TejasSaraf
Just a reminder msg,
To complete your implementation as soon as you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants