Skip to content
ddeepak6992 edited this page Nov 21, 2015 · 5 revisions
  • graph.py Contains classes for directed graph(default) and undirected graph(subclass) which has "addEdge" method which uses adjacency list format to store the data. "adjLst" is a list of lists used to represent adjacency list.

  • BFS.py contains Breadth First Search as a function which takes in arguments graph g (instance of class Graph) and a vertex number (int) as a starting vertex.

  • DFS.py contains Depth First Search as a function which takes in arguments graph g (instance of class Graph) and a vertex number (int) as a starting vertex. It also contains a function that takes in pre and post DFS numbers and returns list of back edges.

  • Djikstra.py contains a Dijkstra implementation as a function which takes arguments "S" input vertex number. Additionally one has to provide "N" the number of vertices and "a" the graph in adjacency list format.

  • Topological Sort Returns a list of sorted vertices or returns false if the graph contains a cycle.

  • Detect cycle in a graph using DFS * Returns a bool whether the graph contains a cycle.

  • Detect cycle in a graph using Disjoint Sets * Returns a bool whether the graph contains a cycle.

  • disjointSet Union Find

Clone this wiki locally