GithubHelp home page GithubHelp logo

abhishekprog0 / dfs_and_applications Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 11 KB

DFS and all its applications in solving problems related to Graphs

License: MIT License

C++ 100.00%
dfs graph cycle-detection connected-components strongly-connected-components topological-sort

dfs_and_applications's Introduction

#Depth Fisrt Search for Graphs

In depth-first search the idea is to travel as deep as possible from neighbour to neighbour before backtracking. What determines how deep is possible is that you must follow edges, and you don't visit any vertex twice. To do this properly we need to keep track of which vertices have already been visited, plus how we got to (the path to) where we currently are, so that we can backtrack. We could keep track of which nodes were visited in a boolean array, and a stack to push nodes onto that we mean to visit. To visualize check out this link : https://www.cs.usfca.edu/~galles/visualization/DFS.html

##DFS can be used to solve a lot of problems such as: ###Finding Connected Components in a Graph ###Detect Cycle in a Graph ###Topological Sorting of a Graph ###Solving Puzzles and Mazes

dfs_and_applications's People

Contributors

abhishekprog0 avatar

Watchers

 avatar  avatar

dfs_and_applications's Issues

directed graph

there some mistake with naming
it should be goto end:
you have given goto end1

but your codes are well written for the beginners they are just fab

Strongly connected components

5 number of nodes
6 number of edges
edges as follows
0 1
1 2
2 3
3 4
3 0
4 2

bro its not working for some graphs you need to check

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.