avatar_url

Sandesh Rana | Python

I'm a developer from Himalayas, with a passion for crafting efficient and elegant code, with creativity and precision.

Topological Sorting

21 Aug 2024 » programming, datastructure, graph

Topological Sorting: Easy to Hard Problems

Easy

  1. Course Schedule (Basic topological sort problem for detecting cycles and finding course order)
  2. Course Schedule II (Finds an order to complete courses, leveraging topological sort)
  3. Find the Order of Characters in Alien Dictionary (Determines the order of characters based on sorting constraints)
  4. Minimum Height Trees (Finds the root nodes of a tree that minimizes height, related to topological sorting)
  5. Reconstruct Itinerary (Finds the order of flights, related to topological sort)

Medium

  1. Task Scheduler (Schedules tasks with cooldowns, related to ordering constraints)
  2. All Paths From Source to Target (Finds all paths in a DAG, often solved using topological sort)
  3. Graph Valid Tree (Validates if a graph can be a tree, involves topological sorting)
  4. Build Order (Determines the build order of projects based on dependencies)
  5. Longest Path in a Directed Acyclic Graph (DAG) (Finds the longest path in a DAG, solved with topological sort)

Hard

  1. Topological Sorting with Multiple Graphs (Advanced topological sorting involving multiple graphs)
  2. Minimum Number of Operations to Make a Valid Sequence (Advanced problem with topological sort and sequence operations)
  3. Task Scheduling with Dependencies (Complex task scheduling involving topological sorting)
  4. Topological Sorting in Directed Graphs with Large Constraints (Handles large graphs with topological sorting)
  5. Critical Connections in a Network (Involves advanced graph algorithms and topological sorting to find critical connections)