v-O_O-v's blog

By v-O_O-v, history, 5 years ago, In English

I recently started learning graph theory and I completed the traversal algorithms. I am having difficulties in implementing the code which are applications of the traversal. So can anyone share their implementation of basic graph questions like

  1. Check whether an undirected graph is acyclic if not print the cycle.
  2. How to get all paths from a source vertex to a destination in a Directed graph.

Thanks!

  • Vote: I like it
  • -3
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

I recommend u to read materials from this link: https://e-maxx.ru/algo/ . It`s on russian, but there is enough on graph theory

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I suggest you to google some questions before asking them here. The chances are that you will already find many answers, especially if the questions are not very complex and related to fundamentals of some topic. For example, if you google "print a cycle in an undirected graph" or "detect a cycle in an undirected graph" you will find a lot of information and the answer to your first question. You may even find a Codeforces blog asking the same or a very similar question(link) !