Graph Introduction
Graph Introduction
Research, Indore
Lecture No.
:
Topic
: Graph Introduction
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Unit-II Syllabus
● Graphs: Introduction
● Classification of graph: Directed and Undirected graphs, etc
● Graph Representation
● Graph Traversal: Depth First Search (DFS), Breadth First Search
(BFS)
● Graph algorithm: Minimum Spanning Tree (MST)
● Kruskal’s Algorithm
● Prim’s Algorithm
● Dijkstra’s shortest path algorithm
● Comparison between different graph algorithms
● Application of graphs
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Pedagogy Used
Analogy-Based Learning
Socratic Method or Inquiry-Based Learning
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Graph
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Graph Formal Definition
G=(V,E)
Where:
● V is the set of vertices (nodes).
● E is the set of edges, which are pairs of vertices representing the connections
between them.
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Where Graphs are used?
Graphs are used to represent and solve problems where the data consists
of objects and relationships between them, such as:
● Social Networks: Each person is a vertex, and relationships (like
friendships) are the edges. Algorithms can suggest potential friends.
● Maps and Navigation: Locations, like a town or bus stops, are stored
as vertices, and roads are stored as edges. Algorithms can find the
shortest route between two locations when stored as a Graph.
● Internet: Can be represented as a Graph, with web pages as vertices
and hyperlinks as edges.
● Biology: Graphs can model systems like neural networks or the spread
of diseases.
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Types of Graphs
1. Undirected Graph
2. Directed Graph
3. Weighted Graph
4. Unweighted Graph
5. Connected Graph
6. Complete Graph
7. Incomplete Graph
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Directed and Undirected Graph
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Weighted and Unweighted Graph
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Complete and Incomplete Graph
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Bipartite Graphs
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Terminology of Graph
1. Trees: A connected graph with no cycles. Example: A family tree where each person is
connected to their parents.
2. Cycles: A graph with at least one cycle. Example: A bike-sharing graph where the cycles
represent the routes that the bikes take.
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Graph Algorithm
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore
Reference
Text Books (T)
1. AM Tanenbaum, Y Langsam& MJ Augustein, “Data structure using C and C++”, Prentice Hall India.
2. Robert Kruse, Bruse Leung, “Data structures & Program Design in C”, Pearson Education.
Reference Books (R)
3. Aho, Hopcroft, Ullman, “Data Structures and Algorithms”, Pearson Education.
4. N. Wirth, “Algorithms + Data Structure = Programs”, Prentice Hall.
5. Jean – Paul Trembly , Paul Sorenson, “An Introduction to Structure with application”, TMH.
6. Richard, GilbergBehrouz, Forouzan ,“Data structure – A Pseudocode Approach with C”, Thomson
press.
By: Dr. Aradhana Negi, Department of Computer Science & Engineering, PIEMR, Indore