Graph Algorithms Summarized

theskilledcoder's tweet image. Graph Algorithms Summarized

Skilled, your summary sounds good, but graph algorithms are actually quite complex, no? Still, a great starting point!


*Note: in context of G: traversing / ordering(sorting) / searching essentially fall under same topic. *Detecting cycle is just special case of this heading - where you detect that there exists a cycle. *Well implemented toposort returns -1(false) for a cyclic graph input.

never4g8's tweet image. *Note: in context of G: traversing / ordering(sorting) / searching essentially fall under same topic.  
*Detecting cycle is just special case of this heading - where you detect that there exists a cycle. 
*Well implemented toposort returns -1(false) for a cyclic graph input.

- all traversal algo can be summarised using single algo. - The design of bag dictatces order of traversal - if bag = stack : DFS - if bag = queue : BFS bag can be a priority queue

never4g8's tweet image. - all traversal algo can be summarised using single algo.  
- The design of bag dictatces order of traversal
- if bag = stack : DFS
- if bag = queue : BFS
bag can be a priority queue

Most of these algorithms arent needed for basic dev and if you really need some of these advanced algorithms then you will not have sufficient knowledge with only some of them. There are also no Flow algorithms which are very useful


Network Flows & Cut Algo missing...

never4g8's tweet image. Network Flows & Cut Algo missing...

All I remember is one queue, add parent node and keeping adding node until queue is empty


Great summary! Very helpful for quick reference.


Graph algorithms can be tricky for sure. They're foundational but require depth to master. Always good to have summaries though.


United States Trends
Loading...

Something went wrong.


Something went wrong.