geeksforgeeks
search icon
  • Courses
    Sale
  • Tutorials
  • Interview Prep
    Videos
    January 10, 2025 |20.0K Views

    Applications of Depth First Search

    Graph, graph, DFS
     Save  Share  2 Likes
    Description
    Discussion

    Depth-first search (DFS) is an algorithm (or technique) for traversing a graph.

    Following are the problems that use DFS as a building block.  

    1) Detecting cycle in a graph 
    A graph has cycle if and only if we see a back edge during DFS. So we can run DFS for the graph and check for back edges. (See this for details)

    Applications of Depth First Search: https://www.geeksforgeeks.org/applications-of-depth-first-search/

     

    Recommendations
    Video Thumbnail
    22:26
    Video Thumbnail
    86.3K Views | 09/01/2025...
    Kosaraju's Algorithm - Strongly Connected Components
    Video Thumbnail
    03:30
    Video Thumbnail
    17.2K Views | 09/01/2025...
    Applications of Breadth First Traversal
    Video Thumbnail
    10:14
    Video Thumbnail
    72.5K Views | 08/01/2025...
    Detect Cycle in a Directed graph using colors
    Video Thumbnail
    19:14
    Video Thumbnail
    287.9K Views | 22/10/2024...
    Kruskal’s Algorithm for Minimum Spanning Tree
    Video Thumbnail
    17:41
    Video Thumbnail
    22.8K Views | 22/10/2024...
    Implementation of Prims Algorithm
    Video Thumbnail
    05:37
    Video Thumbnail
    45.3K Views | 24/09/2024...
    What is Bipartite Graph?
    Video Thumbnail
    07:23
    Video Thumbnail
    980 Views | 16/07/2024...
    Sum of dependencies in a graph
    Video Thumbnail
    32:01
    Video Thumbnail
    12.1K Views | 01/04/2024...
    Graph Practice Problems | Graph Data Structure | DSA Course
    Video Thumbnail
    05:02
    Video Thumbnail
    300 Views | 04/07/2022...
    Remove all outgoing edges except edge with minimum weight
    Video Thumbnail
    13:58
    Video Thumbnail
    32.2K Views | 28/06/2022...
    Stable Marriage Problem
    GeeksforGeeks
    location
    Corporate & Communications Address:
    A-143, 6th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
    location
    Registered Address:
    K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
    GFG App on Play StoreGFG App on App Store
    • Company
    • About Us
    • Legal
    • Privacy Policy
    • Contact Us
    • Advertise with us
    • GFG Corporate Solution
    • Campus Training Program
    • Explore
    • POTD
    • Job-A-Thon
    • Blogs
    • Nation Skill Up
    • Tutorials
    • Programming Languages
    • DSA
    • Web Technology
    • AI, ML & Data Science
    • DevOps
    • CS Core Subjects
    • Interview Preparation
    • Software and Tools
    • Courses
    • ML and Data Science
    • DSA and Placements
    • Web Development
    • Programming Languages
    • DevOps & Cloud
    • GATE
    • Trending Technologies
    • Videos
    • DSA
    • Python
    • Java
    • C++
    • Web Development
    • Data Science
    • CS Subjects
    • Preparation Corner
    • Interview Corner
    • Aptitude
    • Puzzles
    • GfG 160
    • System Design
    @GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved