Skip to content

Build Graph, find cycle, topological sort, Depth First Search Algorithm

Notifications You must be signed in to change notification settings

jayswamicodes/graph_1

Repository files navigation

graph_1

This is an assignment where Graph.h / Graph.cpp & GraphTest.cpp were given by professor:

  • Build the Graph: undirected/ undirected weighted / directed / directed weighted
  • Build a dot file for pictorial representation of this graph
  • Traverse the graph using DFS, to find the topological graph & detect cycle if present

Following are the files I have added or edited:

  • GraphBuilder.h & GraphBuilder.cpp : This will create nodes & edges to build a graph
  • GraphDot.h & GraphDot.cpp : This will write the edges into a dot file that can be later converted to pdf file to display the graph
  • GraphDfs.h & GraphDfs.cpp : Depth First Search(DFS), to find the topological order and any loops if present
  • Added few function to util.h & util.cpp

Refer the pdf files to see the output of Graphs & DFS (the dot files once generated need to be converted to pdf files using the command)

Releases

No releases published

Packages

No packages published

Languages