Graphs are non-linear data structures used to represent connections between pairs of elements called nodes. Nodes represent real-world objects and edges represent the connections between nodes. Graphs can be used to model transportation networks, social networks, and more. There are different types of graphs including directed graphs, undirected graphs, weighted graphs, and more. Common graph algorithms include depth-first search, breadth-first search, topological sorting, minimum spanning trees, and more which have various applications.
Graphs are data structures used to represent connections between pairs of elements called nodes. The connections between nodes are called edges. There are different types of graphs such as weighted graphs where edges have a cost or value. Graphs can be represented using data structures like adjacency matrices and adjacency lists. Common graph algorithms include depth-first search (DFS), breadth-first search (BFS), minimum spanning trees (MST), shortest path algorithms like Dijkstra's algorithm, and topological sorting. Graphs have many real-world applications such as modeling transportation and social networks.
This document defines and explains various graph concepts:
- A graph consists of vertices and edges connecting the vertices. Graphs can be directed or undirected.
- Common graph terminology includes adjacent vertices, paths, complete graphs, weighted graphs, and representations using adjacency matrices and lists.
- Graph searching algorithms like depth-first search (DFS) and breadth-first search (BFS) are used to find paths between vertices.
- Graphs have applications in areas like maps, networks, and computational systems. Other graph topics covered include topological sorting, biconnectivity, cut vertices, Euler circuits, and minimum spanning trees.
Graph in data structure it gives you the information of the graph application. How to represent the Graph and also Graph Travesal is also there many terms are there related to garph
A Graph is a non-linear data structure, which consists of vertices(or nodes) connected by edges(or arcs) where edges may be directed or undirected.
Graphs are a powerful and versatile data structure that easily allow you to represent real life relationships between different types of data (nodes).
Depth first traversal(data structure algorithms)bhuvaneshwariA5
The document discusses depth-first search (DFS) algorithms for graphs. It explains that DFS traverses a graph in a depthward motion using a stack. It explores all adjacent unvisited nodes, marks them as visited, and pushes them onto the stack before backtracking. The document provides pseudocode for DFS and an example of applying it to a graph. It also discusses uses of DFS in finding connected components, biconnectivity, and strongly connected components in graphs.
It includes:
Introduction to Graphs
Applications
Graph representation
Graph terminology
Graph operations
Adding vertex and edge in Adjacency matrix representation using C++ program
Adjacency List implementation in C++
Homework Problems
References
Trees are hierarchical data structures that organize data in a recursive structure. Binary trees have nodes with at most two children. Tree traversal algorithms visit each node exactly once in a defined order, such as depth-first or breadth-first. Threaded binary trees make inorder traversal faster using node pointers instead of recursion. Multiway trees can be represented as binary trees by making the leftmost child the left child of its corresponding binary tree node.
This document discusses graphs and graph data structures. It defines a graph as a pictorial representation of a set of objects connected by links, with the objects represented as vertices and the links as edges. It provides definitions and examples of basic graph terminology like vertices, edges, adjacency, and different types of graphs like directed vs undirected graphs. It also covers graph implementations using adjacency matrices and adjacency lists, as well as common graph algorithms like depth-first search and breadth-first search. Finally, it lists some applications of graphs like social networks, maps, and computer networks.
This document provides an overview of the topics covered in Unit 5, which include graphs, hashing, and collision resolution techniques. It defines graphs and their components such as vertices, edges, directed and undirected graphs. It also discusses different graph representations like adjacency matrix and adjacency list. Elementary graph operations like breadth-first search and depth-first search are explained along with examples. Hashing functions and collision resolution are also introduced.
This document provides definitions and concepts related to graphs. It defines a graph as a data structure consisting of vertices and edges linking vertices, which can represent objects and relationships. Graphs are a generalization of trees that allow any type of relationship between nodes. Common graph representations include adjacency lists and matrices. The document also discusses graph traversal methods, minimum spanning trees, and applications of graphs.
The document defines key concepts related to graphs, including types of graphs (directed, undirected, weighted, unweighted), graph terminology (vertex, edge, path, cycle), representations of graphs (adjacency matrix, adjacency list), and algorithms for traversing graphs (breadth-first search, depth-first search). It also discusses minimum spanning trees, spanning tree properties, and algorithms for finding minimum spanning trees like Kruskal's and Prim's algorithms.
The document discusses graphs and graph algorithms. It defines what a graph is and how they can be represented. It also explains graph traversal algorithms like depth-first search (DFS) and breadth-first search (BFS). Additionally, it covers algorithms for finding the shortest path using Dijkstra's algorithm and calculating minimum spanning trees using Kruskal's algorithm.
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjtepournima055
The document discusses graphs and graph algorithms. It covers basic graph concepts like vertices, edges, paths, cycles. It describes different ways to represent graphs like adjacency matrix, adjacency list and their pros and cons. It also discusses operations on graphs like inserting and deleting vertices and edges. The document explains traversal algorithms like depth-first search and breadth-first search. It covers minimum spanning tree algorithms like Prim's and Kruskal's. It also briefly discusses shortest path algorithms like Dijkstra's and topological sorting.
The document discusses graphs and graph algorithms. It begins by defining what a graph is - a collection of vertices connected by edges. It then lists four learning objectives related to representing graphs, traversing graphs, calculating minimum spanning trees, and finding shortest routes. The document goes on to describe different ways of representing graphs through adjacency matrices and lists. It also explains graph traversal algorithms like depth-first search and breadth-first search. Finally, it discusses algorithms for finding minimum spanning trees and shortest paths in weighted graphs.
Graphs are non-linear data structures containing vertices (nodes) connected by edges. A graph G is represented as G = (V, E) where V is the set of vertices and E is the set of edges. Edges can be directed, undirected, or weighted. Graphs are used to model real-world networks and relationships. Common graph algorithms include traversal (depth-first search and breadth-first search), topological sorting of directed acyclic graphs, and finding single-source shortest paths (Dijkstra's algorithm).
A graph is a non-linear data structure consisting of nodes and edges where the nodes are connected via edges. There are different ways to represent graphs including using an adjacency matrix or adjacency lists. Common graph terminology includes vertices, edges, degree, and traversal algorithms like depth-first search (DFS) and breadth-first search (BFS) which are used to search graphs. DFS uses a stack and explores nodes as deep as possible before backtracking while BFS uses a queue and explores all neighbor nodes at the present depth before moving deeper.
A graph is a data structure consisting of vertices and edges that relate vertices. It can be represented using an adjacency matrix or adjacency list. A graph is defined as G=(V,E) where V is the set of vertices and E is the set of edges. Graphs can be directed or undirected. Depth-first search (DFS) explores paths by going as deep as possible first, while breadth-first search (BFS) explores all neighbors at the current depth before moving deeper.
The document discusses depth-first search (DFS) and breadth-first search (BFS) algorithms for graph traversal. It explains that DFS uses a stack to systematically visit all vertices in a graph by exploring neighboring vertices before moving to the next level, while BFS uses a queue to explore neighboring vertices at the same level before moving to the next. Examples are provided to illustrate how DFS can be used to check for graph connectivity and cyclicity.
A graph is a data structure consisting of vertices and edges. Graphs are used to represent real-world networks like social networks and road maps. There are two main representations of graphs: adjacency matrix and adjacency list. Adjacency matrix uses a 2D array to store edge information while adjacency list uses an array of lists. Graph traversal algorithms like depth-first search and breadth-first search are used to search graphs in a systematic way without loops.
A Graph is a non-linear data structure, which consists of vertices(or nodes) connected by edges(or arcs) where edges may be directed or undirected.
Graphs are a powerful and versatile data structure that easily allow you to represent real life relationships between different types of data (nodes).
Depth first traversal(data structure algorithms)bhuvaneshwariA5
The document discusses depth-first search (DFS) algorithms for graphs. It explains that DFS traverses a graph in a depthward motion using a stack. It explores all adjacent unvisited nodes, marks them as visited, and pushes them onto the stack before backtracking. The document provides pseudocode for DFS and an example of applying it to a graph. It also discusses uses of DFS in finding connected components, biconnectivity, and strongly connected components in graphs.
It includes:
Introduction to Graphs
Applications
Graph representation
Graph terminology
Graph operations
Adding vertex and edge in Adjacency matrix representation using C++ program
Adjacency List implementation in C++
Homework Problems
References
Trees are hierarchical data structures that organize data in a recursive structure. Binary trees have nodes with at most two children. Tree traversal algorithms visit each node exactly once in a defined order, such as depth-first or breadth-first. Threaded binary trees make inorder traversal faster using node pointers instead of recursion. Multiway trees can be represented as binary trees by making the leftmost child the left child of its corresponding binary tree node.
This document discusses graphs and graph data structures. It defines a graph as a pictorial representation of a set of objects connected by links, with the objects represented as vertices and the links as edges. It provides definitions and examples of basic graph terminology like vertices, edges, adjacency, and different types of graphs like directed vs undirected graphs. It also covers graph implementations using adjacency matrices and adjacency lists, as well as common graph algorithms like depth-first search and breadth-first search. Finally, it lists some applications of graphs like social networks, maps, and computer networks.
This document provides an overview of the topics covered in Unit 5, which include graphs, hashing, and collision resolution techniques. It defines graphs and their components such as vertices, edges, directed and undirected graphs. It also discusses different graph representations like adjacency matrix and adjacency list. Elementary graph operations like breadth-first search and depth-first search are explained along with examples. Hashing functions and collision resolution are also introduced.
This document provides definitions and concepts related to graphs. It defines a graph as a data structure consisting of vertices and edges linking vertices, which can represent objects and relationships. Graphs are a generalization of trees that allow any type of relationship between nodes. Common graph representations include adjacency lists and matrices. The document also discusses graph traversal methods, minimum spanning trees, and applications of graphs.
The document defines key concepts related to graphs, including types of graphs (directed, undirected, weighted, unweighted), graph terminology (vertex, edge, path, cycle), representations of graphs (adjacency matrix, adjacency list), and algorithms for traversing graphs (breadth-first search, depth-first search). It also discusses minimum spanning trees, spanning tree properties, and algorithms for finding minimum spanning trees like Kruskal's and Prim's algorithms.
The document discusses graphs and graph algorithms. It defines what a graph is and how they can be represented. It also explains graph traversal algorithms like depth-first search (DFS) and breadth-first search (BFS). Additionally, it covers algorithms for finding the shortest path using Dijkstra's algorithm and calculating minimum spanning trees using Kruskal's algorithm.
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjtepournima055
The document discusses graphs and graph algorithms. It covers basic graph concepts like vertices, edges, paths, cycles. It describes different ways to represent graphs like adjacency matrix, adjacency list and their pros and cons. It also discusses operations on graphs like inserting and deleting vertices and edges. The document explains traversal algorithms like depth-first search and breadth-first search. It covers minimum spanning tree algorithms like Prim's and Kruskal's. It also briefly discusses shortest path algorithms like Dijkstra's and topological sorting.
The document discusses graphs and graph algorithms. It begins by defining what a graph is - a collection of vertices connected by edges. It then lists four learning objectives related to representing graphs, traversing graphs, calculating minimum spanning trees, and finding shortest routes. The document goes on to describe different ways of representing graphs through adjacency matrices and lists. It also explains graph traversal algorithms like depth-first search and breadth-first search. Finally, it discusses algorithms for finding minimum spanning trees and shortest paths in weighted graphs.
Graphs are non-linear data structures containing vertices (nodes) connected by edges. A graph G is represented as G = (V, E) where V is the set of vertices and E is the set of edges. Edges can be directed, undirected, or weighted. Graphs are used to model real-world networks and relationships. Common graph algorithms include traversal (depth-first search and breadth-first search), topological sorting of directed acyclic graphs, and finding single-source shortest paths (Dijkstra's algorithm).
A graph is a non-linear data structure consisting of nodes and edges where the nodes are connected via edges. There are different ways to represent graphs including using an adjacency matrix or adjacency lists. Common graph terminology includes vertices, edges, degree, and traversal algorithms like depth-first search (DFS) and breadth-first search (BFS) which are used to search graphs. DFS uses a stack and explores nodes as deep as possible before backtracking while BFS uses a queue and explores all neighbor nodes at the present depth before moving deeper.
A graph is a data structure consisting of vertices and edges that relate vertices. It can be represented using an adjacency matrix or adjacency list. A graph is defined as G=(V,E) where V is the set of vertices and E is the set of edges. Graphs can be directed or undirected. Depth-first search (DFS) explores paths by going as deep as possible first, while breadth-first search (BFS) explores all neighbors at the current depth before moving deeper.
The document discusses depth-first search (DFS) and breadth-first search (BFS) algorithms for graph traversal. It explains that DFS uses a stack to systematically visit all vertices in a graph by exploring neighboring vertices before moving to the next level, while BFS uses a queue to explore neighboring vertices at the same level before moving to the next. Examples are provided to illustrate how DFS can be used to check for graph connectivity and cyclicity.
A graph is a data structure consisting of vertices and edges. Graphs are used to represent real-world networks like social networks and road maps. There are two main representations of graphs: adjacency matrix and adjacency list. Adjacency matrix uses a 2D array to store edge information while adjacency list uses an array of lists. Graph traversal algorithms like depth-first search and breadth-first search are used to search graphs in a systematic way without loops.
UNIT III Non Linear Data Structures - Trees.pptxVISWANATHAN R V
Tree ADT — Tree Traversals — Binary Tree ADT — Expression Trees — Applications of Trees — Binary Search Tree ADT — AVL Trees — Splay Tree — B—Tree — Heap — Applications of heap.
This document provides an overview of network layer concepts including network layer services, packet switching, performance metrics, addressing, routing, and congestion control. It describes the key responsibilities of the network layer such as packetizing data, routing packets from source to destination, and error control. Metrics like delay, throughput, and packet loss are discussed as well as congestion control mechanisms to improve performance like retransmission policies and congestion notification.
This document discusses application layer protocols. It begins by introducing the application layer and describing its functions of providing services to users and logical connections between application layers. It then discusses standard protocols like HTTP and SMTP and nonstandard protocols. It describes the traditional client-server paradigm and the emerging peer-to-peer paradigm. Specific application layer protocols covered include WWW/HTTP, FTP, and email. It provides details on how these protocols function, including URL structure for WWW, connections and data transfers for FTP, and message exchanges for email.
This document provides an overview of data link layer and media access control. It discusses key concepts such as framing, flow control, error control, addressing, and common data link layer protocols. Specific topics covered include HDLC, PPP, Ethernet, wireless LAN standards, and media access control protocols for shared media like CSMA/CD.
This document provides an overview of the transport layer and transport layer protocols. It discusses the functions of the transport layer including process-to-process communication using port numbers, multiplexing and demultiplexing, and reliable data transfer. It describes two main transport layer protocols: UDP, which provides connectionless and unreliable data transfer, and TCP, which provides connection-oriented and reliable data transfer. The document outlines key aspects of UDP and TCP including packet formats, connection establishment processes, and services provided.
This document discusses computer networks and the physical layer. It covers network types including LAN, WAN, and MAN. It also discusses transmission media such as twisted pair cable, coaxial cable, and fiber optic cable. The physical layer deals with transmission of raw bits over a transmission medium and includes topics such as line configuration, network topology, and transmission modes.
This slide deck presents a detailed overview of the 2025 survey paper titled “A Survey of Personalized Large Language Models” by Liu et al. It explores how foundation models like GPT and LLaMA can be personalized to better reflect user-specific needs, preferences, and behaviors.
The presentation is structured around a 3-level taxonomy introduced in the paper:
Input-Level Personalization (e.g., user-profile prompting, memory retrieval)
Model-Level Personalization (e.g., LoRA, PEFT, adapters)
Objective-Level Personalization (e.g., RLHF, preference alignment)
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...IJCNCJournal
We present efficient algorithms for computing isogenies between hyperelliptic curves, leveraging higher genus curves to enhance cryptographic protocols in the post-quantum context. Our algorithms reduce the computational complexity of isogeny computations from O(g4) to O(g3) operations for genus 2 curves, achieving significant efficiency gains over traditional elliptic curve methods. Detailed pseudocode and comprehensive complexity analyses demonstrate these improvements both theoretically and empirically. Additionally, we provide a thorough security analysis, including proofs of resistance to quantum attacks such as Shor's and Grover's algorithms. Our findings establish hyperelliptic isogeny-based cryptography as a promising candidate for secure and efficient post-quantum cryptographic systems.
In modern aerospace engineering, uncertainty is not an inconvenience — it is a defining feature. Lightweight structures, composite materials, and tight performance margins demand a deeper understanding of how variability in material properties, geometry, and boundary conditions affects dynamic response. This keynote presentation tackles the grand challenge: how can we model, quantify, and interpret uncertainty in structural dynamics while preserving physical insight?
This talk reflects over two decades of research at the intersection of structural mechanics, stochastic modelling, and computational dynamics. Rather than adopting black-box probabilistic methods that obscure interpretation, the approaches outlined here are rooted in engineering-first thinking — anchored in modal analysis, physical realism, and practical implementation within standard finite element frameworks.
The talk is structured around three major pillars:
1. Parametric Uncertainty via Random Eigenvalue Problems
* Analytical and asymptotic methods are introduced to compute statistics of natural frequencies and mode shapes.
* Key insight: eigenvalue sensitivity depends on spectral gaps — a critical factor for systems with clustered modes (e.g., turbine blades, panels).
2. Parametric Uncertainty in Dynamic Response using Modal Projection
* Spectral function-based representations are presented as a frequency-adaptive alternative to classical stochastic expansions.
* Efficient Galerkin projection techniques handle high-dimensional random fields while retaining mode-wise physical meaning.
3. Nonparametric Uncertainty using Random Matrix Theory
* When system parameters are unknown or unmeasurable, Wishart-distributed random matrices offer a principled way to encode uncertainty.
* A reduced-order implementation connects this theory to real-world systems — including experimental validations with vibrating plates and large-scale aerospace structures.
Across all topics, the focus is on reduced computational cost, physical interpretability, and direct applicability to aerospace problems.
The final section outlines current integration with FE tools (e.g., ANSYS, NASTRAN) and ongoing research into nonlinear extensions, digital twin frameworks, and uncertainty-informed design.
Whether you're a researcher, simulation engineer, or design analyst, this presentation offers a cohesive, physics-based roadmap to quantify what we don't know — and to do so responsibly.
Key words
Stochastic Dynamics, Structural Uncertainty, Aerospace Structures, Uncertainty Quantification, Random Matrix Theory, Modal Analysis, Spectral Methods, Engineering Mechanics, Finite Element Uncertainty, Wishart Distribution, Parametric Uncertainty, Nonparametric Modelling, Eigenvalue Problems, Reduced Order Modelling, ASME SSDM2025
Several studies have established that strength development in concrete is not only determined by the water/binder ratio, but it is also affected by the presence of other ingredients. With the increase in the number of concrete ingredients from the conventional four materials by addition of various types of admixtures (agricultural wastes, chemical, mineral and biological) to achieve a desired property, modelling its behavior has become more complex and challenging. Presented in this work is the possibility of adopting the Gene Expression Programming (GEP) algorithm to predict the compressive strength of concrete admixed with Ground Granulated Blast Furnace Slag (GGBFS) as Supplementary Cementitious Materials (SCMs). A set of data with satisfactory experimental results were obtained from literatures for the study. Result from the GEP algorithm was compared with that from stepwise regression analysis in order to appreciate the accuracy of GEP algorithm as compared to other data analysis program. With R-Square value and MSE of -0.94 and 5.15 respectively, The GEP algorithm proves to be more accurate in the modelling of concrete compressive strength.
この資料は、Roy FieldingのREST論文(第5章)を振り返り、現代Webで誤解されがちなRESTの本質を解説しています。特に、ハイパーメディア制御やアプリケーション状態の管理に関する重要なポイントをわかりやすく紹介しています。
This presentation revisits Chapter 5 of Roy Fielding's PhD dissertation on REST, clarifying concepts that are often misunderstood in modern web design—such as hypermedia controls within representations and the role of hypermedia in managing application state.
This research is oriented towards exploring mode-wise corridor level travel-time estimation using Machine learning techniques such as Artificial Neural Network (ANN) and Support Vector Machine (SVM). Authors have considered buses (equipped with in-vehicle GPS) as the probe vehicles and attempted to calculate the travel-time of other modes such as cars along a stretch of arterial roads. The proposed study considers various influential factors that affect travel time such as road geometry, traffic parameters, location information from the GPS receiver and other spatiotemporal parameters that affect the travel-time. The study used a segment modeling method for segregating the data based on identified bus stop locations. A k-fold cross-validation technique was used for determining the optimum model parameters to be used in the ANN and SVM models. The developed models were tested on a study corridor of 59.48 km stretch in Mumbai, India. The data for this study were collected for a period of five days (Monday-Friday) during the morning peak period (from 8.00 am to 11.00 am). Evaluation scores such as MAPE (mean absolute percentage error), MAD (mean absolute deviation) and RMSE (root mean square error) were used for testing the performance of the models. The MAPE values for ANN and SVM models are 11.65 and 10.78 respectively. The developed model is further statistically validated using the Kolmogorov-Smirnov test. The results obtained from these tests proved that the proposed model is statistically valid.
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)ijflsjournal087
Call for Papers..!!!
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
June 21 ~ 22, 2025, Sydney, Australia
Webpage URL : https://inwes2025.org/bmli/index
Here's where you can reach us : [email protected] (or) [email protected]
Paper Submission URL : https://inwes2025.org/submission/index.php
1. KONGUNADU COLLEGE OF ENGINEERING AND
TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY
20CS301 - DATA STRUCTURES
Subject Handled by
Mr.R.V.Viswanathan,AP / IT
KNCET.
3. Unit – IV Graphs
Definitions — Topological Sort — Shortest-Path
Algorithms — Dijkstra's Algorithm Minimum
Spanning Tree — Prim's algorithms — Depth-First
Traversal — Biconnectivity Euler circuits —
Applications of graphs.
4. GRAPHS
Graphs are data structures used to represent "connections"
between pairs of elements.
These elements are called nodes. They represent real-life objects,
persons, or entities.
The connections between nodes are called edges.
5. EXAMPLE APPLICATION
example, we could use graphs to model a transportation network where nodes would
represent facilities that send or receive products and edges would represent roads or
paths that connect them
6. WEIGHTED GRAPHS
A weight graph is a graph whose edges have a "weight" or "cost". The weight of an
edge can represent distance, time, or anything that models the "connection" between
the pair of nodes it connects.
7. INTRODUCTION TO GRAPH
A Graph is a non linear data structure consisting of nodes and edges.
The nodes are sometimes also referred to as vertices and the edges are
lines or arcs that connect any two nodes in the graph.
Generally, a graph G is represented as G=(V,E) where V is set of vertices
and E is set of edges.
In this Graph, the set of vertices
V = {0,1,2,3,4} and the set of edges
E ={01, 12, 23, 34, 04, 14, 13}.
12. APPLICATIONS
Graphs are used to solve many real life problems.
Graphs are used to represent networks.
The networks may include paths in a city or telephone network or circuit
network.
Graphs are also used in social networks like linkedIn , Facebook.
For example, in Facebook, each person is represented with a vertex(or
node).
Each node is a structure and contains information like person id, name,
gender, locale etc.
13. TYPES OF GRAPH
Directed Graph (or) Digraph
•Directed graph is a graph which consists of
directed edges, where each edge in E is
unidirectional.
•It is also referred as Digraph. If (v,w) is a
directed edge then (v,w) # (w,v)
Undirected Graph
•An undirected graph is a graph, which consists
of undirected edges. If (v,w) is an undirected
edge, then (v,w)=(w,v)
14. GRAPH TERMINOLOGIES
•A path is a sequence of vertices such that
there is an edge from each vertex to its
successor
•A path is simple if each vertex is distinct/A
path with no repeated vertices is called a
simple path
•A circuit is a path in which the terminal
vertex coincides with the initial vertex.
(Vertices may repeat but edges are not
allowed to repeat)
15. GRAPH TERMINOLOGIES
•Cycle: A circuit that doesn't repeat vertices is
called a Cycle. (Neither vertices except
possibly the starting and ending vertices) are
allowed to repeat, Nor edges are allowed to
repeat
•Self loop: If there is an edge whose starting
and end vertices are same, that is, (vi, vj) is
an edge, then it is called a self loop.
•Adjacent Vertices Two vertices are said to be
adjacent if there is an edge (arc) connecting
them.
0-1-2-3-0 - CYCLE
0-1-2-4-2-3- CIRCUIT
16. GRAPH TERMINOLOGIES
•Adjacent edges are edges that share a
common vertex.
•Degree of the Node A degree of a node is
the number of edges that are connected with
that node. A node with degree 0 is called as
isolated node.
In degree: Number of edges entering a node
Out degree: Number of edges leaving a node
Degree = Indegree + Outdegree
17. •Connected and Disconnected
A graph G is said to be connected if there exists a path between every
pair of vertices.
A connected graph is the one in which some path exists between every two
vertices (u, v) in V.
There are no isolated nodes in connected graph.
UNCONNECTED/DisConnected GRAPH: A graph is said as unconnected
graph if there exist any 2 unconnected components.
Example: • H1 and H2 are connected • H3 is disconnected
18. Weighted Graph
•A graph is said to be weighted graph if every edge in the graph is assigned a weight or
value. It can be directed or undirected graph.
Complete Graph
•A complete graph is a graph in which there is an direct edge between every pair of vertices.
•A complete graph with n vertices will have n(n-1)/2 edges.
•There is a path from every vertex to every other vertex.
•All complete graphs are connected graphs, but not all connected graphs are complete
graphs.
•A complete digraph is a strongly connected graph.
19. Weakly Connected Graph:
•If there does not exist a path from one vertex to another vertex then it is
said to be a weakly connected graph.
20. CYCLIC AND ACYCLIC GRPH
Cyclic Graph
A graph with at least one cycle is called a cyclic
graph.
Example
In the above example graph, we have two cycles
a-b-c-d-a and c-f-g-e-c. Hence it is called a
cyclic graph
Acyclic Graph
A graph with no cycles is called an acyclic
graph.
21. GRAPH REPRESENTATION
Graph data structure is represented using following representations...
•Adjacency Matrix
•Incidence Matrix
•Adjacency List
22. ADJACENCY MATRIX
The adjacency matrix A for a graph G = (V,E) with n vertices, is an n* n
matrix of bits ,
•such that A ij = 1 , if there is an edge from vi to vj and
•Aij = 0, if there is no such edge
24. ADJACENCY LIST
•A graph containing m vertices and n edges can be represented using a
linked list, referred to as adjacency list.
•The number of vertices in a graph forms a singly linked list.
•Each vertex have a separate linked list, with nodes equal to the number of
edges connected from the corresponding vertex..
•Each nodes has at least 2 fields: VERTEX and LINK.
•The VERTEX fields contain the indices of the vertices adjacent to vertex i.
26. GRAPH TRAVERSALS
A graph traversal is a systematic way of visiting the nodes in a
specific order.
There are 2 types of graph traversals namely,
Breadth First Search(BFS)
Depth First Search(DFS)
28. DEPTH FIRST SEARCH
•Visit the first node initially, and then find the unvisited node which
is adjacent to the first node, is visited and a DFS is initiated from
the adjacent node (considering it as the first node)
•If all the adjacent nodes have been visited, backtrack to the last
node visited, and find another adjacent node and again initiate the
DFS from adjacent node
•This traversal continues until all nodes have been visited once
29. STEPS TO IMPLEMENT DFS
1. Select the start vertex
2. Visit the vertex ( place 1)
3. Find the adjacent vertices of visited node
Rule 1− Visit any one of the adjacent unvisited vertex. Mark it as
visited. Display it. Push it in a stack.
Rule 2− If no adjacent vertex is found, pop up a vertex from the
stack. (It will pop up all the vertices from the stack, which do not
have adjacent vertices.)
Rule 3− Repeat Rule 1 and Rule 2 until the stack is empty.
30. STEPS TO IMPLEMENT DFS
1. Select the start vertex
2. Visit the vertex ( place 1)
3. Find the adjacent vertices of visited node
Rule 1− Visit any one of the adjacent unvisited vertex. Mark it as
visited. Display it. Push it in a stack.
Rule 2− If no adjacent vertex is found, pop up a vertex from the
stack. (It will pop up all the vertices from the stack, which do not
have adjacent vertices.)
Rule 3− Repeat Rule 1 and Rule 2 until the stack is empty.
40. APPLICATIONS OF DFS
•To check whether the undirected graph is connected or not
•To check if the connected undirected graph is bi-connected or not
•To check whether the directed graph is a-cyclic or not
41. BFS (BREADTH FIRST SEARCH)
•Breadth First Search ( of a graph G starts from an unvisited vertex
u.
•Then all unvisited vertices vi adjacent to u are visited and then all
unvisited vertices wj adjacent to vi are visited and so on
•The traversal terminates when there are no more nodes to visit
•BFS uses a queue data structure to keep track of the order of the
nodes whose adjacent nodes are to be visited
42. STEPS TO IMPLEMENT BFS
1. Select the start vertex and mark it as visited (i.e) place the value 1
2. Enqueue the START vertex.
3. Dequeue the vertex.
4. Find all adjacent unvisited vertices of the dequeued vertex.
5. Mark all unvisited adjacent vertices as visited.
6. Enqueue all adjacent vertices.
7. Repeat from step 3 to step 6 until the queue becomes empty
49. APPLICATIONS OF BFS
1. To find the shortest path from a vertex s to a vertex v in an
unweighted graph
2. To find the length of such a path
3. To find out if a graph contains cycles
4. To construct a BFS tree/forest from a graph
52. TOPOLOGICAL SORTING IN GRAPHS
Graphs are data structures used to represent "connections"
between pairs of elements.
These elements are called nodes. They represent real-life objects,
persons, or entities.
The connections between nodes are called edges.
53. EXAMPLE APPLICATION
we could use graphs to model a transportation network where nodes
would represent facilities that send or receive products and edges
would represent roads or paths that connect them
54. GRAPH
A Graph is a non linear data structure consisting of nodes and
edges.
The nodes are sometimes also referred to as vertices and the
edges are lines or arcs that connect any two nodes in the graph.
Generally, a graph G is represented as G=(V,E) where V is set of
vertices and E is set of edges.
In this Graph, the set of vertices
V = {0,1,2,3,4} and the set of edges
E ={01, 12, 23, 34, 04, 14, 13}.
55. TOPOLOGICAL SORTING
•Topological Sorting is mainly used for scheduling jobs from the given
dependencies among jobs
•The jobs are represented by vertices, and there is an edge from x to y if job
x must be completed before job y can be started
•For example, in constructing a building, the basement must be completed
before the first floor, which must be completed before the second floor and
so on
•A topological sort gives an order in which we should perform the jobs
56. TOPOLOGICAL SORTING
It is a linear ordering of vertices in a directed a-cyclic graph, such that if
there is a path from Vi to Vj, then Vj appears after Vi in the linear ordering.
Topological sort is not possible if the graph has a cycle.
Procedure
1. Find the indegree for every vertex
2. Place the vertices whose indegree is zero on the empty queue
3. Dequeue one vertex at a time from the queue and decrement the
indegree of all its adjacent vertices
4. Enqueue a vertex to the queue if its indegree falls to zero
5. Repeat from step 3 unitl the queue becomes empty
The topological ordering is the order in which the vertices are dequeued.
57. EXAMPLE
Step 1
•Find the Indegree of vertices 1,2,3,4,5,6.
•Indegree of a vertex is the number of edges entering into the vertex.
Indegree of vertex 1 is 0, vertex 2 is 0, vertex 3 is 1, vertex 4 is 3, vertex 5
is 1, vertex 6 is 3.
Step 2
•enqueue() the vertices with Indegree 0. Therefore enqueue() vertices 1 and
2.
63. APPLICATIONS
•In computer science, applications of this type arise in instruction
scheduling, ordering of formula cell evaluation when recomputing formula
values in spreadsheets
•Determining the order of compilation tasks to perform in make files
•Data Serialization
64. MINIMUM SPANNING TREE
A spanning tree is a tree that connects all the vertices of a graph with the
minimum possible number of edges.
Thus, a spanning tree is always connected.
Also, a spanning tree never contains a cycle.
A Minimum Spanning Tree (MST) is a subset of edges of a connected
weighted undirected graph that connects all the vertices together with the
minimum possible total edge weight.
Spanning Tree with minimum cost is called Minimum Spanning Tree
To derive an MST, Prim’s algorithm or Kruskal’s algorithm can be used.
66. PRIM’S ALGORITHM
•Prim’s algorithm is a greedy algorithm (Optimal solution)
•Used to form a minimum spanning tree for a connected weighted undirected
graph.
•Builds a tree that includes every vertex and a subset of the edges in such a
way that the total weight of all the edges in the tree is minimized.
67. ALGORITHM
//Input: A weighted connected graph G = (V, E)
//Output: T , the set of edges composing a minimum spanning tree of G
Step 1: Select a starting vertex
Step 2: Repeat Steps 3 and 4 until there is no unvisited vertices
Step 3: Select an edge e connecting the tree vertex and visit vertex that has
minimum weight
Step 4: Add the selected edge and the vertex to the minimum spanning tree
T
Step 5: EXIT
70. KRUSKAL ALGORITHM
Step-01:
Sort all the edges from low weight to high weight.
Step-02:
Take the edge with the lowest weight and use it to connect the vertices of
graph.
If adding an edge creates a cycle, then reject that edge and go for the
next least weight edge.
Step-03:
Keep adding edges until all the vertices are connected and a Minimum
Spanning Tree (MST) is obtained.
76. SHORTEST PATH ALGORITHM
The shortest path algorithm determines the minimum cost of the
path from source to every other vertex.
Types
The single source shortest path problem
Find the minimum cost from single source vertex to all other
vertices
Dijkstra’s Algorithm
The all pairs shortest path problem
Find the shortest distance from each vertex to all other vertices.
Floyd’s algorithm
77. DIJKSTRA'S ALGORITHM
Find the shortest path from a node (called the "source node") to all other
nodes in the graph, producing a shortest-path tree.
This algorithm is used in GPS devices to find the shortest path between the
current location and the destination
This algorithm was created and published by Dr. Edsger W. Dijkstra, Dutch
computer scientist and software engineer In 1959.
78. ALGORITHM
starts at the node that you choose (the source node) and it analyzes the graph
to find the shortest path between that node and all the other nodes in the
graph.
keeps track of the currently known shortest distance from each node to the
source node and it updates these values if it finds a shorter path.
Once the algorithm has found the shortest path between the source node and
another node, that node is marked as "visited" and added to the path.
The process continues until all the nodes in the graph have been added to the
path. This way, we have a path that connects the source node to all other nodes
following the shortest path possible to reach each node.
Dijkstra's Algorithm can only work with graphs that have positive weights
79. Output: 0 4 12 19 21 11 9 8 14
Explanation: The distance from 0 to 1 = 4.
The minimum distance from 0 to 2 = 12. 0->1->2
The minimum distance from 0 to 3 = 19. 0->1->2->3
The minimum distance from 0 to 4 = 21. 0->7->6->5->4
The minimum distance from 0 to 5 = 11. 0->7->6->5
The minimum distance from 0 to 6 = 9. 0->7->6
The minimum distance from 0 to 7 = 8. 0->7
The minimum distance from 0 to 8 = 14. 0->1->2->8
80. BI-CONNECTIVITY
An undirected graph is called Biconnected if there is a two vertex – disjoint ways
between any two vertices.
In a Biconnected Graph, there is a basic cycle through any two vertices.
It must be connected.
There isn’t an articulation point in it. ( Even if remove any node others are in
connection)
81. Definitions- Separation Edges and Vertices
Let G be a connected graph
A separation edge of G is an edge whose removal disconnects G
A separation vertex of G is a vertex whose removal disconnects G
Applications: Separation edges and vertices represent single points of failure in a
network and are critical to the operation of the network
Example
DFW, LGA and LAX are separation vertices
(DFW,LAX) is a separation edge
82. Equivalent definitions of a biconnected graph G
Graph G has no separation edges and no separation vertices
For any two vertices u and v of G, there are two disjoint simple paths between u and v (i.e., two simple
paths between u and v that share no other vertices or edges)
For any two vertices u and v of G, there is a simple cycle containing u and v
Example
Biconnected Graph
83. BICONNECTED COMPONENTS
Biconnected component of a graph G
A maximal biconnected subgraph of G, or
A subgraph consisting of a separation edge of G and its end vertices
Interaction of biconnected components
An edge belongs to exactly one biconnected component
A nonseparation vertex belongs to exactly one biconnected component
A separation vertex belongs to two or more biconnected components
Example of a graph biconnected components
84. EULER CIRCUIT
Euler path is a path, by which we can visit every edge exactly once. (Eulerian Path)
We can use the same vertices for multiple times.
The starting and ending points need not be the same.
Euler Circuit is a special type of Euler path. (Eulerian Circuit)
When the starting vertex of the Euler path is also connected with the ending vertex of
that path, then it is called the Euler Circuit.
To detect the path and circuit, we have to follow these conditions:
The graph must be connected.
When exactly two vertices have odd degree, it is a Euler Path.
Now when no vertices of an undirected graph have odd degree, then it is a Euler
Circuit.
A graph is said to be eulerian if it has a eulerian cycle.
86. APPLICATIONS OF GRAPHS
Social network graphs
The Facebook graph showing who follows whom or who sends friend invitations to whom
Transportation networks
vertices are intersections in road networks, and edges are the road segments that connect
them
Utility graphs:
The power grid, the Internet, and the water network are graphs with vertices representing
connection points and edges representing the cables or pipes that connect them
Document link graphs
web’s link graph - each web page is a vertex, and a directed edge connects each hyperlink
Finite element meshes
spread of earthquakes through the ground, structural vibrations of a building
87. Robot planning
The edges represent possible transitions between states, whereas the vertices
represent various states for the robot
Network packet traffic graph
Vertices are IP address edges are the packets that flow between them.
Scene graph
Computer games scene graphs represent the logical relationship between
objects in a scene
Neural networks
Vertices represent neurons and edges the synapses between them.
Protein – Protein interactions graphs
Vertices represent proteins and edges represent interactions between them
(biological functions in the cell)