The document introduces various graph concepts including:
- A graph G consists of a set of vertices V and edges E that connect vertices.
- Graphs can be finite or infinite, directed or undirected, simple or allow parallel edges/loops.
- Specific graph types are defined including multigraphs that allow parallel edges and pseudographs that allow loops.
- Common applications of graphs include modeling social, communication, transportation and biological networks.
- Two vertices are adjacent if they are connected by an edge. The neighborhood of a vertex consists of its adjacent vertices.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relationships between objects. A graph consists of vertices and edges that connect the vertices. Graph theory is used in computer science to model problems that can be represented as networks, such as determining routes in a city or designing circuits. It allows analyzing properties of graphs like connectivity and determining the minimum number of resources required. A graph can be represented using an adjacency matrix or adjacency list to store information about its vertices and edges.
Graphs are a data structure composed of nodes connected by edges. There are two main types: directed graphs where edges show a flow between nodes, and undirected graphs where edges simply show a relationship between nodes. Key terminology includes adjacent nodes, paths, cyclic vs acyclic paths, and representations like adjacency matrices and lists. Graphs can model many real-world applications such as social networks, computer networks, road maps, and more.
The document defines and describes various graph concepts and data structures used to represent graphs. It defines a graph as a collection of nodes and edges, and distinguishes between directed and undirected graphs. It then describes common graph terminology like adjacent/incident nodes, subgraphs, paths, cycles, connected/strongly connected components, trees, and degrees. Finally, it discusses two common ways to represent graphs - the adjacency matrix and adjacency list representations, noting their storage requirements and ability to add/remove nodes.
This document discusses graph data structures and algorithms. A graph consists of nodes and edges, where nodes represent entities and edges represent relationships between nodes. There are different types of graphs including undirected, directed, weighted, and cyclic graphs. Graphs can be represented using an adjacency matrix or adjacency list. Graphs are used to model real-world networks and solve problems in areas like social networks, maps, robot path planning, and neural networks.
A graph consists of vertices and edges, where vertices represent entities and edges represent relationships between vertices. Graphs can be represented sequentially using matrices like adjacency and incidence matrices, or linked using data structures like adjacency lists. Adjacency matrices allow fast addition/removal of edges but use more memory, while adjacency lists use less memory but are slower to modify. The best representation depends on whether the graph is dense or sparse.
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
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).
Students can learn about graphs data structures. this PPT covers the following topics in GRAPHS data structures: graph representation, types of graphs, graph traversals like DFS and BFS, Topological Sort, Applications of DFS and BFS.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relationships between objects. A graph consists of vertices and edges that connect the vertices. Graph theory is used in computer science to model problems that can be represented as networks, such as determining routes in a city or designing circuits. It allows analyzing properties of graphs like connectivity and determining the minimum number of resources required. A graph can be represented using an adjacency matrix or adjacency list to store information about its vertices and edges.
Graphs are a data structure composed of nodes connected by edges. There are two main types: directed graphs where edges show a flow between nodes, and undirected graphs where edges simply show a relationship between nodes. Key terminology includes adjacent nodes, paths, cyclic vs acyclic paths, and representations like adjacency matrices and lists. Graphs can model many real-world applications such as social networks, computer networks, road maps, and more.
The document defines and describes various graph concepts and data structures used to represent graphs. It defines a graph as a collection of nodes and edges, and distinguishes between directed and undirected graphs. It then describes common graph terminology like adjacent/incident nodes, subgraphs, paths, cycles, connected/strongly connected components, trees, and degrees. Finally, it discusses two common ways to represent graphs - the adjacency matrix and adjacency list representations, noting their storage requirements and ability to add/remove nodes.
This document discusses graph data structures and algorithms. A graph consists of nodes and edges, where nodes represent entities and edges represent relationships between nodes. There are different types of graphs including undirected, directed, weighted, and cyclic graphs. Graphs can be represented using an adjacency matrix or adjacency list. Graphs are used to model real-world networks and solve problems in areas like social networks, maps, robot path planning, and neural networks.
A graph consists of vertices and edges, where vertices represent entities and edges represent relationships between vertices. Graphs can be represented sequentially using matrices like adjacency and incidence matrices, or linked using data structures like adjacency lists. Adjacency matrices allow fast addition/removal of edges but use more memory, while adjacency lists use less memory but are slower to modify. The best representation depends on whether the graph is dense or sparse.
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
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).
Students can learn about graphs data structures. this PPT covers the following topics in GRAPHS data structures: graph representation, types of graphs, graph traversals like DFS and BFS, Topological Sort, Applications of DFS and BFS.
A graph G is composed of vertices V connected by edges E. It can be represented using an adjacency matrix or adjacency lists. Graph search algorithms like depth-first search (DFS) and breadth-first search (BFS) are used to traverse the graph and find paths between vertices. DFS recursively explores edges until reaching the end of a branch before backtracking, while BFS explores all neighbors at each level before moving to the next.
A graph G is composed of a set of vertices V connected by edges E. It can be represented using an adjacency matrix, with a 1 or 0 in position (i,j) indicating whether vertices i and j are connected, or an adjacency list storing the neighbors of each vertex. Graph search algorithms like depth-first search (DFS) and breadth-first search (BFS) are used to traverse the graph and find paths between vertices, with DFS prioritizing depth and BFS prioritizing breadth of exploration. DFS uses recursion to implicitly store paths while BFS uses queues and must store paths separately.
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
This document defines and provides examples of different types of graphs and digraphs. It defines a graph as an ordered pair of vertices and edges, and defines a digraph as a graph where edges have a direction from one vertex to another. It provides examples of simple, symmetric, asymmetric, complete, and balanced digraphs. It also defines in-degree, out-degree, and total degree of vertices in digraphs.
A graph G consists of a set of vertices V connected by edges E. An edge e is represented as an ordered pair of vertices (u,v). Graphs can be directed or undirected. The degree of a vertex is the number of edges incident to it. A path is a sequence of adjacent vertices, while a cycle is a path where the first and last vertices are the same. Graphs can be represented using an adjacency matrix where a 1 indicates an edge and 0 no edge between two vertices.
This document defines and provides examples of graphs and their representations. It discusses:
- Graphs are data structures consisting of nodes and edges connecting nodes.
- Examples of directed and undirected graphs are given.
- Graphs can be represented using adjacency matrices or adjacency lists. Adjacency matrices store connections in a grid and adjacency lists store connections as linked lists.
- Key graph terms are defined such as vertices, edges, paths, and degrees. Properties like connectivity and completeness are also discussed.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. The document discusses topics covered in the first unit of a graph theory course, including directed and undirected graphs, complete graphs, bipartite graphs, regular graphs, walks, trials, circuits, paths, cycles, connected and disconnected graphs, and Euler circuits and trials. The second unit topics include planar and non-planar graphs, Euler's formula, detection of planarity, graph coloring, chromatic polynomials, and map coloring. Planar graphs can be drawn in a plane such that edges meet only at vertices, while non-planar graphs cannot. Examples of non-planar graphs are given.
The document discusses graphs and their applications. It defines graphs as consisting of vertices and edges. Graphs can be undirected or directed. It also defines concepts like paths, cycles, and connectivity in graphs. Common applications of graphs mentioned are maps, computer networks, and CAD designs. The document then discusses different ways to represent graphs using adjacency matrices and adjacency lists. It also discusses using graphs to model and solve problems like traffic light timing by coloring the vertices.
The document provides an overview of graph concepts including definitions of a graph as a pair of vertices and edges, different types of graphs such as directed/undirected graphs and cyclic/acyclic graphs. It also discusses graph coloring, adjacency matrices/lists for representing graphs, and algorithms for traversing graphs including depth-first search and breadth-first search. Examples are given for each concept to illustrate key differences and properties.
A graph is a data structure consisting of vertices and edges connecting the vertices. Graphs can be directed or undirected. Depth-first search (DFS) and breadth-first search (BFS) are algorithms for traversing graphs by exploring neighboring vertices. DFS uses a stack and explores as far as possible along each branch before backtracking, while BFS uses a queue and explores all neighbors at each depth level first before moving to the next level.
This document provides an overview of representing graphs and Dijkstra's algorithm in Prolog. It discusses different ways to represent graphs in Prolog, including using edge clauses, a graph term, and an adjacency list. It then explains Dijkstra's algorithm for finding the shortest path between nodes in a graph and provides pseudocode for implementing it in Prolog using rules for operations like finding the minimum value and merging lists.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. Key concepts include:
- A graph contains vertices connected by edges or arcs. It can be simple (no loops or multiple edges) or directed (edges have orientations).
- Adjacency matrices and lists are common ways to represent a graph structure and connections between vertices.
- Examples demonstrate simple graphs, directed graphs, complete graphs, and representing graphs using matrices and lists.
Graphs are a non-linear data structure consisting of nodes (vertices) connected by links (edges). There are two main types: undirected graphs where edges are not ordered, and directed graphs where edges have direction from one node to another. Common graph terminology includes adjacent nodes, degrees, isolated nodes, sources, and different graph properties like being connected, complete, or having loops. Graph traversal algorithms like breadth-first search and depth-first search are used to systematically explore the structure of a graph.
Skiena algorithm 2007 lecture10 graph data strctureszukun
This document summarizes different types of graph data structures and representations. It discusses graphs as consisting of vertices and edges, and describes properties like directed vs undirected, weighted vs unweighted, sparse vs dense. It also covers different representations like adjacency matrices and lists, and provides code examples for initializing, reading, and inserting edges into a graph represented using an adjacency list.
This document discusses three types of graphs: directed graphs, undirected graphs, and weighted graphs. It provides examples and definitions of basic graph terminology like vertices, edges, and paths. It also describes two common ways to represent graphs in computer memory: sequential representation using adjacency lists and linked representation using linked lists. Finally, it outlines high-level processes for creating a graph and searching or deleting elements from a graph.
The document discusses various topics related to graphs:
- It defines directed and undirected graphs, paths, connected graphs, trees, degree, isomorphic graphs, cut sets, and labeled graphs.
- Key aspects include paths being sequences of vertices with edges connecting them, connected graphs having paths between all vertex pairs, trees being connected and acyclic graphs, and isomorphic graphs having the same structure.
- It also covers graph concepts such as degrees measuring incident edges, cut sets separating graphs, and labeling providing additional data to graphs' vertices or edges.
1. A graph is a collection of objects called vertices that are connected by links called edges. Graphs can be represented as a pair of sets (V,E) where V is the set of vertices and E is the set of edges.
2. There are several important terms used to describe graphs including adjacent nodes, degree of a node, regular graphs, paths, cycles, connected graphs, and complete graphs. Graphs can be represented using adjacency matrices or adjacency lists.
3. There are two main techniques for traversing graphs - depth-first search (DFS) and breadth-first search (BFS). DFS uses a stack and traverses graphs in a depth-wise manner while BFS uses a
The document discusses different graph data structures including adjacency matrices and adjacency lists for representing graphs, and describes key graph terminology such as vertices, edges, paths, connected components, and directed vs undirected graphs. It also explains Dijkstra's algorithm for finding the shortest path between a starting node and all other nodes in a graph.
A graph G is composed of vertices V connected by edges E. It can be represented using an adjacency matrix or adjacency lists. Graph search algorithms like depth-first search (DFS) and breadth-first search (BFS) are used to traverse the graph and find paths between vertices. DFS recursively explores edges until reaching the end of a branch before backtracking, while BFS explores all neighbors at each level before moving to the next.
A graph G is composed of a set of vertices V connected by edges E. It can be represented using an adjacency matrix, with a 1 or 0 in position (i,j) indicating whether vertices i and j are connected, or an adjacency list storing the neighbors of each vertex. Graph search algorithms like depth-first search (DFS) and breadth-first search (BFS) are used to traverse the graph and find paths between vertices, with DFS prioritizing depth and BFS prioritizing breadth of exploration. DFS uses recursion to implicitly store paths while BFS uses queues and must store paths separately.
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
This document defines and provides examples of different types of graphs and digraphs. It defines a graph as an ordered pair of vertices and edges, and defines a digraph as a graph where edges have a direction from one vertex to another. It provides examples of simple, symmetric, asymmetric, complete, and balanced digraphs. It also defines in-degree, out-degree, and total degree of vertices in digraphs.
A graph G consists of a set of vertices V connected by edges E. An edge e is represented as an ordered pair of vertices (u,v). Graphs can be directed or undirected. The degree of a vertex is the number of edges incident to it. A path is a sequence of adjacent vertices, while a cycle is a path where the first and last vertices are the same. Graphs can be represented using an adjacency matrix where a 1 indicates an edge and 0 no edge between two vertices.
This document defines and provides examples of graphs and their representations. It discusses:
- Graphs are data structures consisting of nodes and edges connecting nodes.
- Examples of directed and undirected graphs are given.
- Graphs can be represented using adjacency matrices or adjacency lists. Adjacency matrices store connections in a grid and adjacency lists store connections as linked lists.
- Key graph terms are defined such as vertices, edges, paths, and degrees. Properties like connectivity and completeness are also discussed.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. The document discusses topics covered in the first unit of a graph theory course, including directed and undirected graphs, complete graphs, bipartite graphs, regular graphs, walks, trials, circuits, paths, cycles, connected and disconnected graphs, and Euler circuits and trials. The second unit topics include planar and non-planar graphs, Euler's formula, detection of planarity, graph coloring, chromatic polynomials, and map coloring. Planar graphs can be drawn in a plane such that edges meet only at vertices, while non-planar graphs cannot. Examples of non-planar graphs are given.
The document discusses graphs and their applications. It defines graphs as consisting of vertices and edges. Graphs can be undirected or directed. It also defines concepts like paths, cycles, and connectivity in graphs. Common applications of graphs mentioned are maps, computer networks, and CAD designs. The document then discusses different ways to represent graphs using adjacency matrices and adjacency lists. It also discusses using graphs to model and solve problems like traffic light timing by coloring the vertices.
The document provides an overview of graph concepts including definitions of a graph as a pair of vertices and edges, different types of graphs such as directed/undirected graphs and cyclic/acyclic graphs. It also discusses graph coloring, adjacency matrices/lists for representing graphs, and algorithms for traversing graphs including depth-first search and breadth-first search. Examples are given for each concept to illustrate key differences and properties.
A graph is a data structure consisting of vertices and edges connecting the vertices. Graphs can be directed or undirected. Depth-first search (DFS) and breadth-first search (BFS) are algorithms for traversing graphs by exploring neighboring vertices. DFS uses a stack and explores as far as possible along each branch before backtracking, while BFS uses a queue and explores all neighbors at each depth level first before moving to the next level.
This document provides an overview of representing graphs and Dijkstra's algorithm in Prolog. It discusses different ways to represent graphs in Prolog, including using edge clauses, a graph term, and an adjacency list. It then explains Dijkstra's algorithm for finding the shortest path between nodes in a graph and provides pseudocode for implementing it in Prolog using rules for operations like finding the minimum value and merging lists.
Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. Key concepts include:
- A graph contains vertices connected by edges or arcs. It can be simple (no loops or multiple edges) or directed (edges have orientations).
- Adjacency matrices and lists are common ways to represent a graph structure and connections between vertices.
- Examples demonstrate simple graphs, directed graphs, complete graphs, and representing graphs using matrices and lists.
Graphs are a non-linear data structure consisting of nodes (vertices) connected by links (edges). There are two main types: undirected graphs where edges are not ordered, and directed graphs where edges have direction from one node to another. Common graph terminology includes adjacent nodes, degrees, isolated nodes, sources, and different graph properties like being connected, complete, or having loops. Graph traversal algorithms like breadth-first search and depth-first search are used to systematically explore the structure of a graph.
Skiena algorithm 2007 lecture10 graph data strctureszukun
This document summarizes different types of graph data structures and representations. It discusses graphs as consisting of vertices and edges, and describes properties like directed vs undirected, weighted vs unweighted, sparse vs dense. It also covers different representations like adjacency matrices and lists, and provides code examples for initializing, reading, and inserting edges into a graph represented using an adjacency list.
This document discusses three types of graphs: directed graphs, undirected graphs, and weighted graphs. It provides examples and definitions of basic graph terminology like vertices, edges, and paths. It also describes two common ways to represent graphs in computer memory: sequential representation using adjacency lists and linked representation using linked lists. Finally, it outlines high-level processes for creating a graph and searching or deleting elements from a graph.
The document discusses various topics related to graphs:
- It defines directed and undirected graphs, paths, connected graphs, trees, degree, isomorphic graphs, cut sets, and labeled graphs.
- Key aspects include paths being sequences of vertices with edges connecting them, connected graphs having paths between all vertex pairs, trees being connected and acyclic graphs, and isomorphic graphs having the same structure.
- It also covers graph concepts such as degrees measuring incident edges, cut sets separating graphs, and labeling providing additional data to graphs' vertices or edges.
1. A graph is a collection of objects called vertices that are connected by links called edges. Graphs can be represented as a pair of sets (V,E) where V is the set of vertices and E is the set of edges.
2. There are several important terms used to describe graphs including adjacent nodes, degree of a node, regular graphs, paths, cycles, connected graphs, and complete graphs. Graphs can be represented using adjacency matrices or adjacency lists.
3. There are two main techniques for traversing graphs - depth-first search (DFS) and breadth-first search (BFS). DFS uses a stack and traverses graphs in a depth-wise manner while BFS uses a
The document discusses different graph data structures including adjacency matrices and adjacency lists for representing graphs, and describes key graph terminology such as vertices, edges, paths, connected components, and directed vs undirected graphs. It also explains Dijkstra's algorithm for finding the shortest path between a starting node and all other nodes in a graph.
This document provides an overview of graphs and graph algorithms. It begins with an introduction to graphs, including definitions of vertices, edges, directed/undirected graphs, and graph representations using adjacency matrices and lists. It then covers graph traversal algorithms like depth-first search and breadth-first search. Minimum spanning trees and algorithms for finding them like Kruskal's algorithm are also discussed. The document provides examples and pseudocode for the algorithms. It analyzes the time complexity of the graph algorithms. Overall, the document provides a comprehensive introduction to fundamental graph concepts and algorithms.
This document provides information about graphs and graph algorithms. It discusses different graph representations including adjacency matrices and adjacency lists. It also describes common graph traversal algorithms like depth-first search and breadth-first search. Finally, it covers minimum spanning trees and algorithms to find them, specifically mentioning Kruskal'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.
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.
The document defines and provides examples of different types of graphs, including simple graphs, multigraphs, pseudographs, directed graphs, and directed multigraphs. It also defines key graph theory concepts such as vertices, edges, paths, degrees of vertices, adjacency matrices, subgraphs, unions of graphs, and connectivity. Examples are provided to illustrate these definitions and concepts, such as examples of graphs, paths, and how to construct the adjacency matrix of a graph.
The document describes graphs and graph algorithms. It defines what a graph is composed of (vertices and edges) and different types of graphs like directed and undirected graphs. It provides terminology used with graphs like vertices, edges, paths, cycles, connectedness. It discusses ways of representing graphs through adjacency matrices and adjacency lists and provides examples. It also describes Dijkstra's algorithm, a graph algorithm to find the shortest path between vertices in a graph.
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 provides an overview of graph algorithms and graph theory concepts. It defines different types of graphs including simple graphs, directed graphs, multi graphs, pseudo graphs, and weighted graphs. It also defines graph concepts such as paths, circuits, cycles, degrees of vertices, adjacency matrices, incidence matrices, and graph traversals. Finally, it provides an explanation of the depth-first search algorithm for traversing graphs.
This section provides an introduction to graphs and graph theory. Key points include:
- Graphs consist of vertices and edges that connect the vertices. They can be directed or undirected.
- Common terminology is introduced, such as adjacent vertices, neighborhoods, degrees of vertices, and handshaking theorem.
- Different types of graphs are discussed, including multigraphs, pseudographs, and directed graphs.
- Examples of graph models are given for computer networks, social networks, information networks, transportation networks, and software design. Graphs can be used to model many real-world systems and applications.
This document discusses graphs and spanning trees. A graph is a data structure containing vertices and edges connecting the vertices. A spanning tree of a graph is a subgraph that connects all vertices without cycles. Spanning trees can be found using graph search algorithms like breadth-first search or depth-first search. Spanning trees have properties like containing no cycles, having the minimum number of edges to connect all vertices, and being uniquely defined up to the choice of starting vertex for the search algorithm.
This document discusses different data structures and algorithms for representing graphs. It begins with definitions of basic graph terminology like vertices, edges, degrees of vertices, paths, cycles, etc. It then covers representations of graphs using adjacency matrices and adjacency lists. Adjacency matrices store whether each pair of vertices is connected in a 2D array while adjacency lists store the neighbors of each vertex using linked lists. The document also discusses algorithms for finding the transitive closure of a directed graph and representing bi-connected graphs.
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 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.
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).
This document provides an overview of graph theory. It defines various graph types including simple graphs, multigraphs, pseudographs, directed graphs, and labeled graphs. It also defines key graph terminology such as vertices, edges, degree, adjacency, connectivity, and planar graphs. Graph theory has many applications in fields like transportation, computer networks, and chemistry for modeling relationships between objects.
This document defines and explains basic graph terminology and representations. It defines simple and directed graphs, and discusses graph models using examples of railway and sports tournament networks. Key graph concepts covered include adjacency, edges, degrees, isolated and pendant vertices, and handshaking theorem. It also explains how to represent graphs using adjacency matrices and incidence matrices.
This presentation introduces graphs and their types. It will discuss graphs, what they are consisting of nodes and edges. It will also cover different types of graphs like bipartite graphs, complete graphs, and cycle graphs. Finally, it will discuss ways that graphs can be represented in computers, including adjacency matrices and adjacency lists.
This document discusses graphs and their representation. It begins by defining what a graph is - a set of vertices connected by edges. Different graph types are described, including directed/undirected graphs and trees. Graphs can be represented using adjacency lists, matrices, or edge lists. Adjacency lists store the neighbors of each vertex in a linked list, matrices use a 2D array to represent edges, and edge lists explicitly store the connections. Weighted and sparse graphs are also discussed.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
3. GRAPH
• A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes) and E, a set of
edges.
• Each edge has either one or two vertices associated with it, called its endpoints.
• An edge is said to connect its endpoints.
Tahsin Aziz 3
4. GRAPH
• Infinite Graph
• The set of vertices V of a graph G may be infinite. A graph with an infinite vertex set or an
infinite number of edges is called an infinite graph.
• Finite Graph
• A graph with a finite vertex set and a finite edge set is called a finite graph.
Tahsin Aziz 4
5. FINITE GRAPH
• Undirected Graph
• Simple Graph
• Multi Graph
• Pseudo Graph
• Directed Graph
• Simple Graph
• Multi Graph
Tahsin Aziz 5
6. UNDIRECTED GRAPH
• An undirected graph (V, E) consists of a nonempty set of vertices V and a set of
undirected edges (or arcs) E.
• An undirected graph is an unordered pair (V, E) in which V is the vertex set and E is a
subset called the edge set of V×V.
• This is not directed that means have no direction point.
• There may have multiple edges and also self loop.
Tahsin Aziz 6
7. SIMPLE GRAPH
• A graph in which each edge connects two different vertices and where no two edges
connect the same pair of vertices is called a simple graph.
• A simple graph G = {V, E} consists of V, a non empty set of vertices and E, a set of
unordered pairs of distinct elements of V called edges.
• There should be no loops, no multiple edges and no direction.
Tahsin Aziz 7
8. SIMPLE GRAPH
• Example
• Let V = {a, b, c, d} and E = { a,b , a,c , b,c , d,c } which are unordered pairs on V×V.
• Then the simple graph will be,
a
c d
b
e2
e4
e1
e3
Tahsin Aziz 8
9. MULTI GRAPH
• Graphs that may have multiple edges connecting the same vertices are called
multigraphs.
• When there are m different edges associated to the same unordered pair of vertices {u,
v}, we also say that {u, v} is an edge of multiplicity m.
• A multigraph G = {V, E} consists of a set V of vertices, a set E of edges and a function f
from E to {{u, v}| u , v ∈ v , u ≠ v}.
• The edges e1 and e2 are called multiple or parallel edges if f(e1) = f(e2).
• There should be no loops and no direction.
Tahsin Aziz 9
10. MULTI GRAPH
• Example
• Let V = {a, b, c, d} and E = { a, b , b, c , a, d , d, c , a, b , a, c , c, a } which are unordered
pairs on V×V.
• Then the multi graph will be,
a
c d
b
e3
e4
e1
e2
e5
e6 e7
Tahsin Aziz 10
11. PSEUDO GRAPH
• Graphs that may include loops, and possibly multiple edges connecting the same pair of
vertices or a vertex to itself, are sometimes called pseudographs.
• A pseudograph G = {V, E} consists of a set V of vertices, a set E of edges and a function f
from E to {{u, v}| u , v ∈ v}.
• An edge is a loop if f(e) = {u, u} = {u} for some u ∈ v
• There should be no direction.
Tahsin Aziz 11
12. PSEUDO GRAPH
• Example
• Let V = {a, b, c, d} and E = { a, b , b, c , a, d , d, c , a, b , a, a , a, c , c, a } which are
unordered pairs on V×V.
• Then the pseudo graph will be,
a
c d
b
e3
e4
e1
e2
e5
e7 e8
e6
Tahsin Aziz 12
13. DIRECTED GRAPH
• A directed graph or digraph (V, E) consists of a nonempty set of vertices V and a set of
directed edges (or arcs) E.
• A directed graph or digraph is an ordered pair (V, E) in which V is the vertex set and E
is a subset called the edge set of V×V.
• An edge (a, b) is an edge from a to b and that there is an edge from a to b if (a, b) ∈ E.
• The vertex a is called the initial vertex of the edge and b is called the terminal vertex.
Tahsin Aziz 13
14. DIRECTED GRAPH
• Example
• Let V = {a, b, c, d} and E = { a, b , b, c , b, b , c, d } which are unordered pairs on V×V.
• Then the directed graph will be,
a
c d
b
e3
e4
e1
e2
Tahsin Aziz 14
15. SIMPLE DIGRAPH
• A digraph in which each edge connects two different vertices and where no two edges
connect the same pair of vertices is called a simple digraph.
• A simple digraph G = {V, E} consists of V, a non empty set of vertices and E, a set of
ordered pairs of distinct elements of V called edges.
• There should be no loops and no multiple edges.
Tahsin Aziz 15
16. SIMPLE DIGRAPH
• Example
• Let V = {a, b, c, d} and E = { a, b , a, c , b, c , d, c } which are ordered pairs on V×V.
• Then the simple digraph will be,
a
c d
b
e2
e4
e1
e3
Tahsin Aziz 16
17. MULTI DIGRAPH
• Digraphs that may have multiple edges connecting the same vertices are called multi
digraphs.
• When there are m different edges associated to the same ordered pair of vertices {u, v},
we also say that {u, v} is an edge of multiplicity m.
• A multi digraph G = {V, E} consists of a set V of vertices, a set E of edges and a function f
from E to {{u, v}| u , v ∈ v , u ≠ v}.
• The edges e1 and e2 are called multiple or parallel edges if f(e1) = f(e2).
Tahsin Aziz 17
18. MULTI DIGRAPH
• Example
• Let V = {a, b, c, d} and E = { a, b , b, c , a, d , d, c , a, b , a, a , a, c , c, a } which are ordered
pairs on V×V.
• Then the multi digraph will be,
a
c d
b
e3
e4
e1
e2
e5
e7 e8
e6
Tahsin Aziz 18
19. MIXED GRAPH
• A graph with both directed and undirected edges is called a mixed graph.
• A mixed graph might be used to model a computer network containing links that
operate in both directions and other links that operate only in one direction.
Tahsin Aziz 19
20. EMPTY GRAPH
• When the vertices have no edge between them then it is known as empty graph.
a b c
Tahsin Aziz 20
21. GRAPH MODELS
• Social networks
• Communication networks
• Information networks
• Software design applications
• Transportation networks
• Biological networks
• Tournaments
Tahsin Aziz 21
22. SOCIAL NETWORKS
• Acquaintanceship and friendship graphs
• A simple graph to represent whether two people know each other, that is, whether they are acquainted, or whether they are friends.
• Each person in a particular group of people is represented by a vertex. An undirected edge is used to connect two people when these people know each other, when we
are concerned only with acquaintanceship, or whether they are friends.
• No multiple edges and usually no loops are used.
• Influence graphs
• A directed graph called an influence graph can be used to model group behavior.
• In group behavior it is observed that certain people can influence the thinking of others. Each person of the group is represented by a vertex. There is a directed edge
from vertex a to vertex b when the person represented by vertex a can influence the person represented by vertex b.
• This graph does not contain loops and it does not contain multiple directed edges.
• Collaboration graphs
• A collaboration graph is used to model social networks where two people are related by working together in a particular way. Collaboration graphs are simple graphs.
• Vertices in these graphs represent people; two people are connected by an undirected edge when the people have collaborated.
• There are no loops nor multiple edges in these graphs.
Tahsin Aziz 22
23. COMMUNICATION NETWORKS
• Call graphs
• Graphs can be used to model telephone calls made in a network, such as a long distance telephone
network.
• In particular, a directed multigraph can be used to model calls where each telephone number is
represented by a vertex and each telephone call is represented by a directed edge.
• The edge representing a call starts at the telephone number from which the call was made and ends
at the telephone number to which the call was made.
• We need directed edges because the direction in which the call is made matters.
• We need multiple directed edges because we want to represent each call made from a particular
telephone number to a second number.
Tahsin Aziz 23
24. INFORMATION NETWORKS
• The web graph
• The World Wide Web can be modeled as a directed graph where each web page is represented by a vertex and
where an edge starts at the web page a and ends at the web page b if there is a link on a pointing to b.
• Because new web pages are created and others removed somewhere on the web almost every second, the web
graph changes on an almost continual basis.
• Citation graphs
• Graphs can be used to represent citations in different types of documents, including academic papers, patents,
and legal opinions.
• In such graphs, each document is represented by a vertex, and there is an edge from one document to a second
document if the first document cites the second in its citation list.
• A citation graph is a directed graph without loops or multiple edges.
Tahsin Aziz 24
25. SOFTWARE DESIGN APPLICATIONS
• Module dependency graphs
• One of the most important tasks in designing software is how to structure a program into different parts, or modules.
• Understanding how the different modules of a program interact is essential not only for program design, but also for testing and
maintenance of the resulting software.
• A module dependency graph provides a useful tool for understanding how different modules of a program interact. In a
program dependency graph, each module is represented by a vertex. There is a directed edge from a module to a second module
if the second module depends on the first.
• Precedence graphs and concurrent processing
• Computer programs can be executed more rapidly by executing certain statements concurrently. It is important not to execute a
statement that requires results of statements not yet executed.
• The dependence of statements on previous statements can be represented by a directed graph. Each statement is represented by a
vertex, and there is an edge from one statement to a second statement if the second statement cannot be executed before the first
statement.
• This resulting graph is called a precedence graph.
Tahsin Aziz 25
26. TRANSPORTATION NETWORKS
• Airline routes
• We can model airline networks by representing each airport by a vertex.
• In particular, we can model all the flights by a particular airline each day using a directed edge to represent each flight, going from the vertex
representing the departure airport to the vertex representing the destination airport.
• The resulting graph will generally be a directed multigraph, as there may be multiple flights from one airport to some other airport during the same day.
• Road networks
• Graphs can be used to model road networks. In such models, vertices represent intersections and edges represent roads.
• When all roads are two-way and there is at most one road connecting two intersections, we can use a simple undirected graph to model the road
network.
• However, we will often want to model road networks when some roads are one-way and when there may be more than one road between two
intersections. To build such models, we use undirected edges to represent two-way roads and we use directed edges to represent one-way roads.
• Multiple undirected edges represent multiple two-way roads connecting the same two intersections. Multiple directed edges represent multiple one-way
roads that start at one intersection and end at a second intersection. Loops represent loop roads.
• Mixed graphs are needed to model road networks that include both one-way and two-way roads.
Tahsin Aziz 26
27. BIOLOGICAL NETWORKS
• Niche overlap graphs in ecology
• Graphs are used in many models involving the interaction of different species of animals. For instance, the competition between species in an ecosystem
can be modeled using a niche overlap graph.
• Each species is represented by a vertex. An undirected edge connects two vertices if the two species represented by these vertices compete that is, some of
the food resources they use are the same.
• A niche overlap graph is a simple graph because no loops or multiple edges are needed in this model.
• Protein interaction graphs
• A protein interaction in a living cell occurs when two or more proteins in that cell bind to perform a biological function. Because protein interactions are
crucial for most biological functions, many scientists work on discovering new proteins and understanding interactions between proteins.
• Protein interactions within a cell can be modeled using a protein interaction graph (also called a protein–protein interaction network), an undirected
graph in which each protein is represented by a vertex, with an edge connecting the vertices representing each pair of proteins that interact.
• It is a challenging problem to determine genuine protein interactions in a cell, as experiments often produce false positives, which conclude that two
proteins interact when they really do not.
• Protein interaction graphs can be used to deduce important biological information, such as by identifying the most important proteins for various
functions and the functionality of newly discovered proteins.
Tahsin Aziz 27
28. TOURNAMENTS
• Round-robin tournaments
• A tournament where each team plays every other team exactly once and no ties are allowed is called a round-robin tournament.
• Such tournaments can be modeled using directed graphs where each team is represented by a vertex. Note that (a, b) is an edge if
team a beats team b.
• This graph is a simple directed graph, containing no loops or multiple directed edges because no two teams play each other more
than once.
• Single-elimination tournaments
• A tournament where each contestant is eliminated after one loss is called a single-elimination tournament.
• Single-elimination tournaments are often used in sports, including tennis championships and the yearly NCAA basketball
championship.
• We can model such a tournament using a vertex to represent each game and a directed edge to connect a game to the next game
the winner of this game played in.
Tahsin Aziz 28
29. ADJACENT VERTICES/ NEIGHBORS
• Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if
{u, v} is an edge of G.
• If e = {u, v}, the edge is called incident with the vertices u and v.
• The edge e is also said to connect u and v.
• The vertices u and v are called endpoints of the edge {u, v}.
Tahsin Aziz 29
30. ADJACENT VERTICES/ NEIGHBORS
• This diagram corresponds to an undirected graph. Here a and b is connected. So a, b
called adjacent vertices and e is called incident with vertices a and b.
a b
e
Tahsin Aziz 30
31. ADJACENT VERTICES/ NEIGHBORS
• The set of all neighbors of a vertex v of G = (V, E), denoted by N(v), is called the
neighborhood of v.
• If A is a subset of V , we denote by N(A) the set of all vertices in G that are adjacent to at
least one vertex in A.
• So, N(A) = ∪v ∈ A N(v).
Tahsin Aziz 31
32. ADJACENT VERTICES/ NEIGHBORS
• If (u, v) is an edge of the graph G with directed edges, u is said to be adjacent to v and v
is said to be adjacent from u.
• The vertex u is called the initial vertex of (u, v), and v is called the terminal or end vertex
of (u, v).
• The initial vertex and terminal vertex of a loop are the same.
Tahsin Aziz 32
33. ADJACENT VERTICES/ NEIGHBORS
• This diagram corresponds to an directed graph. a is said to be adjacent to b and b is said
to be adjacent from a.
• The vertex a is called the initial vertex of (a, b), and b is called the terminal or end vertex
of (a, b).
a b
e
Tahsin Aziz 33
34. ADJACENCY LIST
• To represent a graph with no multiple edges adjacency lists are used.
• Adjacency lists specify the vertices that are adjacent to each vertex of the graph
Tahsin Aziz 34
35. ADJACENCY LIST
An Adjacency List for a Simple Graph
Vertex Adjacent vertices
a b, c, e
b a
c a, d, e
d c, e
e a, c, d
a
b
e d
c
Tahsin Aziz 35
36. ADJACENCY LIST
An Adjacency List for a Directed Graph
Vertex Terminal vertices
a b, c, e
b b
c a, d
d c, d
e c, d
a
b
e d
c
Tahsin Aziz 36
37. ADJACENCY MATRICES
• Suppose that G = (V , E) is a simple graph where |V | = n. Suppose that the vertices of G are listed
arbitrarily as v1, v2,..., vn.
• The adjacency matrix A (or AG) of G, with respect to this listing of the vertices, is the n × n zero–one
matrix with 1 as its (i, j )th entry when vi and vj are adjacent, and 0 as its (i, j)th entry when they are not
adjacent.
• In other words, if its adjacency matrix is A = [aij ], then
aij =
1 if {vi, vj } is an edge of G,
0 otherwise.
• Two types of matrices commonly used to represent graphs will be presented here. One is based on the
adjacency of vertices, and the other is based on incidence of vertices and edges.
Tahsin Aziz 37
38. ADJACENCY MATRICES
• The adjacency matrix of a simple graph is symmetric, that is, aij = aji, because both of these entries are 1
when vi and vj are adjacent, and both are 0 otherwise.
• Furthermore, because a simple graph has no loops, each entry aii, i = 1, 2, 3,...,n is 0.
• Adjacency matrices can also be used to represent undirected graphs with loops and with multiple
edges.
• A loop at the vertex vi is represented by a 1 at the (i, i)th position of the adjacency matrix.
• When multiple edges connecting the same pair of vertices vi and vj , or multiple loops at the same
vertex, are present, the adjacency matrix is no longer a zero–one matrix, because the (i, j)th entry of this
matrix equals the number of edges that are associated to {vi, vj}.
• All undirected graphs, including multigraphs and pseudo graphs, have symmetric adjacency matrices.
Tahsin Aziz 38
39. ADJACENCY MATRICES
• To represent directed graphs zero–one matrices is used. The matrix for a directed graph G = (V , E) has a 1 in its (i, j)th
position if there is an edge from vi to vj , where v1, v2,..., vn is an arbitrary listing of the vertices of the directed graph.
• In other words, if A = [aij ] is the adjacency matrix for the directed graph with respect to this listing of the vertices, then
aij =
1 if (vi, vj ) is an edge of G,
0 otherwise
• The adjacency matrix for a directed graph does not have to be symmetric, because there may not be an edge from vj to vi when
there is an edge from vi to vj .
• Adjacency matrices can also be used to represent directed multigraphs. Again, such matrices are not zero–one matrices when
there are multiple edges in the same direction connecting two vertices. In the adjacency matrix for a directed multigraph, aij
equals the number of edges that are associated to (vi, vj ).
Tahsin Aziz 39
41. INCIDENCE MATRICES
• Incidence matrices are used to represent graphs.
• Let G = (V, E) be an undirected graph. Suppose that v1, v2,..., vn are the vertices and e1,
e2,...,em are the edges of G.
• Then the incidence matrix with respect to this ordering of V and E is the n × m matrix M
= [mij], where
mij =
1 when edge ej is incident with vi,
0 otherwise.
Tahsin Aziz 41
42. INCIDENCE MATRICES
a
e c
b
e1 e2 e3 e4 e5 e6
a 1 1 1 0 0 0
b 0 1 0 1 1 0
c 0 0 0 0 1 1
d 0 0 1 0 0 1
e 1 0 0 1 0 0
d
e2
e1
e3
e4
e6
e5
Tahsin Aziz 42
43. DEGREE OF VERTEX
• The degree of a vertex in an undirected graph is the number of edges incident with it, except
that a loop at a vertex contributes twice to the degree of that vertex.
• The degree of the vertex v is denoted by deg(v).
• Here deg(a) = 3, deg(b) = 3, deg(c) = 5, deg(d) = 1, deg(e) = 2 and deg(g) = 0
b
a e g
dc
Tahsin Aziz 43
44. ISOLATED VERTEX
• A vertex of degree zero is called isolated.
• An isolated vertex is not adjacent to any vertex.
• Vertex g in the undirected graph is isolated. As, deg(g) = 0
b
a e g
dc
Tahsin Aziz 44
45. PENDANT VERTEX
• A vertex is pendant if and only if it has degree one.
• Consequently, a pendant vertex is adjacent to exactly one other vertex.
• Vertex d in the undirected graph is pendant. As, deg(d) = 1
b
a e g
dc
Tahsin Aziz 45
46. DEGREE OF VERTEX
• In a graph with directed edges the in-degree of a vertex v, denoted by deg−(v), is the number of edges
with v as their terminal vertex.
• The out-degree of v, denoted by deg+(v), is the number of edges with v as their initial vertex.
• A loop at a vertex contributes 1 to both the in-degree and the out-degree of this vertex.
• Here in-degree deg−(a) = 2, deg−(b) = 2, deg−(c) = 2, deg−(d) = 0
• Here out-degree deg+ (a) = 2, deg+(b) = 0, deg+(c) = 2, deg+(d) = 2
a
d c
b
Tahsin Aziz 46
47. DEGREE OF VERTEX
• The sum of the in-degrees and the sum of the out-degrees of all vertices in a graph with directed edges are the same.
• Let G = (V , E) be a graph with directed edges.
• Then v ∈V deg
−
(v) = v ∈V deg
+
(v) = |E|
• Here in-degree deg−(a) = 2, deg−(b) = 2, deg−(c) = 2, deg−(d) = 0. Sum of in-degrees is (2 + 2 + 2 + 0 = 6)
• Here out-degree deg+ (a) = 2, deg+(b) = 0, deg+(c) = 2, deg+(d) = 2. Sum of out-degrees is (2 + 0 + 2 + 2 = 6)
• Total number of edges = 6
• Therefore we can say, sum of in-degree = sum of out-degree = total number of edges.
a
d c
b
Tahsin Aziz 47
48. HANDSHAKING THEOREM
• Let G = (V , E) be an undirected graph with m edges.
• Then 2m = v∈V deg(v).
• This applies even if multiple edges and loops are present.
• Handshaking theorem shows that the sum of the degrees of the vertices of an undirected
graph is even.
Tahsin Aziz 48
49. HANDSHAKING THEOREM
• Let G = (V , E) be an undirected graph with m edges.
• Then summation of degree of all vertices, v∈V deg(v) = deg(a) + deg(b) + deg(c) + deg(d) = 3 + 3 + 3 +
3 = 12.
• Total number of edges, m = 6.
• According to handshaking theorem, v∈V deg(v) = 2m = 2 × 6 = 12.
a
c d
b
Tahsin Aziz 49
50. HANDSHAKING THEOREM
• Example
• How many edges are there in a undirected graph with ten vertices each of degree six?
• Solution
• Since, the sum of the degrees of the vertices is 6 × 10 = 60, it follows that 2m = 60 where m is
the number of edges. Therefore, m = 30.
• That means 30 edges are there.
Tahsin Aziz 50
51. THEOREM
• An undirected graph has an even number of vertices of odd degree.
• Let V1 and V2 be the set of vertices of even degree and the set of vertices of odd degree,
respectively, in an undirected graph G = (V , E) with m edges.
• Then 2m = v∈V deg(v) = v∈V1
deg(v) + v∈V2
deg(v).
• Because deg(v) is even for v ∈ V1, the first term in the right-hand side of the last equality is even.
• Furthermore, the sum of the two terms on the right-hand side of the last equality is even, because
this sum is 2m.
• Hence, the second term in the sum is also even.
• Because all the terms in this sum are odd, there must be an even number of such terms. Thus, there
are an even number of vertices of odd degree.
Tahsin Aziz 51
52. SPECIAL SIMPLE GRAPH
• Complete graph
• Cycles
• Wheels
• N-Cubes
• Walk, path, cycle/circuit
Tahsin Aziz 52
53. COMPLETE GRAPH
• A complete graph on n vertices, denoted by Kn, is a simple graph that contains exactly
one edge between each pair of distinct vertices.
• The graphs Kn, for n = 1, 2, 3, 4, 5 are displayed.
• A simple graph for which there is at least one pair of distinct vertex not connected by an
edge is called noncomplete.
K1 K2
K3
K4
K5
Tahsin Aziz 53
54. COMPLETE DIGRAPH
• In a complete diagraph, each node is connected with every other nodes including itself.
• Complete digraph of three vertices {a, b, c}
• Complete digraph of two vertices {a, b}
• Complete digraph of one vertex {a}
a
cb
a b
a
Tahsin Aziz 54
55. CYCLES
• A cycle Cn where n ≥ 3, consists of n vertices v1, v2,….…, Vn and edges {v1, v2}, {v2,
v3},......,{Vn−1, vn}, and {vn, v1}.
• Start and end same vertex, no other vertices are repeated.
• The cycles C3, C4, C5, and C6 are displayed below
C3
C4
C5
C6
Tahsin Aziz 55
56. WHEELS
• Wheel Wn can be obtain by adding an additional vertex to a cycle Cn, for n ≥ 3, and
connect this new vertex to each of the n vertices in Cn, by new edges.
• The wheels W3, W4, W5, and W6 are displayed below
W3 W4
W5
W6
Tahsin Aziz 56
57. N-CUBES
• An n-dimensional hypercube, or n-cube, denoted by Qn, is a graph that has vertices
representing the 2n bit strings of length n.
• Two vertices are adjacent if and only if the bit strings that they represent differ in
exactly one bit position.
• Q1 and Q2 is displayed below .
10
0 1
00 01
11Q1
Q2
Tahsin Aziz 57
58. WALK
• In a walk vertex may repeat but edge is visited only once.
• Two types of walk: open walk and closed walk.
• If beginning and terminal vertices are not same then this type of walk is known as open
walk.
• If beginning and terminal vertices are same then this type of walk is known as closed
walk.
• Closed walk is also known as cycle or circuit if except beginning and terminal vertex no
other vertices are repeated.
Tahsin Aziz 58
59. OPEN WALK
• V1 b V2 e V3 h V3 d V4
• Here vertex V3 is repeated so it is a walk.
• As the beginning vertex V1 and terminal vertex V4 are not same so it is a open walk.
V1 V2
V4 V3 V6
V5
b
ec
a
d h
g
f
Tahsin Aziz 59
60. CLOSED WALK
• V1 b V2 c V4 a V1
• Here vertex V1 is repeated so it is a walk.
• As the beginning vertex V1 and terminal vertex V1 are same so it is a closed walk.
V1 V2
V4 V3 V6
V5
b
ec
a
d h
g
f
Tahsin Aziz 60
61. CIRCUIT / CYCLE
• V1 b V2 c V4 a V1
• Here vertex V1 is repeated so it is a walk. As except beginning and terminal vertex no
other vertices are repeated so it is called a cycle or circuit also.
V1 V2
V4 V3 V6
V5
b
ec
a
d h
g
f
Tahsin Aziz 61
62. PATH
• In a path vertex and edge is visited only once.
• A path may be a open walk.
P2 P3
P4
Tahsin Aziz 62
63. PATH
• V4 c V2 f V5 g V6
• Here no vertex is repeated and also no edges is repeated. So it is a path.
• It is also a open walk as V4 ≠ V6
V1 V2
V4 V3 V6
V5
b
ec
a
d h
g
f
Tahsin Aziz 63
64. APPLICATIONS OF SPECIAL TYPES OF GRAPHS
• Local area networks
• Star, ring and hybrid topologies for local area networks.
• Interconnection networks for parallel computation
• A linear array for multiple processors, a mesh network for multiple processors.
Tahsin Aziz 64
65. CONNECTEDNESS IN UNDIRECTED GRAPHS
• An undirected graph is called connected if there is a path between every pair of distinct
vertices of the graph.
• An undirected graph that is not connected is called disconnected.
• We disconnect a graph when we remove vertices or edges, or both, to produce a
disconnected subgraph.
• There is a simple path between every pair of distinct vertices of a connected undirected
graph.
Tahsin Aziz 65
66. CONNECTED COMPONENTS
• A connected component of a graph G is a connected subgraph of G that is not a proper
subgraph of another connected subgraph of G.
• That is, a connected component of a graph G is a maximal connected subgraph of G.
• A graph G that is not connected has two or more connected components that are disjoint
and have G as their union.
Tahsin Aziz 66
67. CONNECTED COMPONENTS
• Cut Vertex
• Sometimes the removal from a graph of a vertex and all incident edges produces a subgraph with
more connected components. Such vertices are called cut vertices or articulation points. The
removal of a cut vertex from a connected graph produces a subgraph that is not connected.
• Cut Edge
• An edge whose removal produces a graph with more connected components than in the original
graph is called a cut edge or bridge.
• In a graph representing a computer network, a cut vertex and a cut edge represent an
essential router and an essential link that cannot fail for all computers to be able to
communicate.
Tahsin Aziz 67
68. CONNECTEDNESS IN DIRECTED GRAPHS
• A directed graph is strongly connected if there is a path from a to b and from b to a
whenever a and b are vertices in the graph.
• A directed graph is weakly connected if there is a path between every two vertices in the
underlying undirected graph.
Tahsin Aziz 68
69. BIPARTITE GRAPH
• A simple graph G is called bipartite if its vertex set V can be partitioned into two disjoint
sets V1 and V2 such that every edge in the graph connects a vertex in V1 and a vertex in
V2 so that no edge in G connects either two vertices in V1 or two vertices in V2.
• When this condition holds, we call the pair (V1, V2) a bipartition of the vertex set V of G.
Tahsin Aziz 69
70. BIPARTITE GRAPH
• Example
• Subject = {E, G, M, S} and students = {A, B, C}
• There is no connection between the elements of subjects and students.
• This bipartite graph denoted as K3, 4 as the first set contains three elements and the second set contains four elements.
E
G
M
A
S
B
C
Tahsin Aziz 70
71. THEOREM
• A simple graph is bipartite if and only if it is possible to assign one of two different colors to each vertex
of the graph so that no two adjacent vertices are assigned the same color.
• First, suppose that G = (V , E) is a bipartite simple graph. Then V = V1 ∪ V2, where V1 and V2 are disjoint sets and
every edge in E connects a vertex in V1 and a vertex in V2.
• If we assign one color to each vertex in V1 and a second color to each vertex in V2, then no two adjacent vertices
are assigned the same color.
• Now suppose that it is possible to assign colors to the vertices of the graph using just two colors so that no two
adjacent vertices are assigned the same color.
• Let V1 be the set of vertices assigned one color and V2 be the set of vertices assigned the other color. Then, V1 and
V2 are disjoint and V = V1 ∪ V2.
• Furthermore, every edge connects a vertex in V1 and a vertex in V2 because no two adjacent vertices are either
both in V1 or both in V2. Consequently, G is bipartite.
Tahsin Aziz 71
72. COMPLETE BIPARTITE GRAPH
• A complete bipartite graph Km, n is a graph that has its vertex set partitioned into two
subsets of m and n vertices, respectively with an edge between two vertices if and only
if one vertex is in the first subset and the other vertex is in the second subset.
• The complete bipartite graphs K2, 3 is displayed below:
Tahsin Aziz 72
73. APPLICATIONS OF BIPARTITE GRAPHS
• Job assignments
• Suppose that there are m employees in a group and n different jobs that need to be done, where m ≥ n. Each employee is trained
to do one or more of these n jobs. We would like to assign an employee to each job. To help with this task, we can use a graph to
model employee capabilities. We represent each employee by a vertex and each job by a vertex. For each employee, we include an
edge from that employee to all jobs that the employee has been trained to do. Note that the vertex set of this graph can be
partitioned into two disjoint sets, the set of employees and the set of jobs, and each edge connects an employee to a job.
Consequently, this graph is bipartite, where the bipartition is (E, J ) where E is the set of employees and J is the set of jobs.
• Marriages on an island
• Suppose that there are m men and n women on an island. Each person has a list of members of the opposite gender acceptable as
a spouse. We construct a bipartite graph G = (V1, V2) where V1 is the set of men and V2 is the set of women so that there is an edge
between a man and a woman if they find each other acceptable as a spouse. A matching in this graph consists of a set of edges,
where each pair of endpoints of an edge is a husband-wife pair. A maximum matching is a largest possible set of married
couples, and a complete matching of V1 is a set of married couples where every man is married, but possibly not all women.
Tahsin Aziz 73
74. SUBGRAPH
• A subgraph of a graph G = (V, E) is a graph H = (W, F ), where W ⊆ V and F ⊆ E.
• A subgraph H of G is a proper subgraph of G if H = G.
• Let G = (V, E) be a simple graph. The subgraph induced by a subset W of the vertex set
V is the graph (W, F), where the edge set F contains an edge in E if and only if both
endpoints of this edge are in W.
Tahsin Aziz 74
75. SUBGRAPH INDUCED
• Let G = (V, E) be a simple graph.
• The subgraph induced by a subset W of the vertex set V is the graph (W, F), where the
edge set F contains an edge in E if and only if both endpoints of this edge are in W.
Tahsin Aziz 75
76. SUBGRAPH
• Removing or adding edges of a graph
• Edge contractions
• Removing vertices from a graph
• Graph unions
Tahsin Aziz 76
77. PLANAR GRAPH
• A graph is called planar if it can be drawn in the plane without any edges crossing (where a
crossing of edges is the intersection of the lines or arcs representing them at a point other
than their common endpoint). Such a drawing is called a planar representation of the graph.
• A graph may be planar even if it is usually drawn with crossings, because it may be possible
to draw it in a different way without crossings.
• A planar graph is one which can be drawn in the plane with no intersecting or overlapping
edges.
• Complete graphs Kn are not planar if n ≥ 5.
• Complete bipartite graphs Km, n are not planar if m ≥ 3 and n ≥ 3.
Tahsin Aziz 77
81. EULER GRAPH
• If some closed walk in a graph contains all the edges of the graph, then the walk is called an
Euler line and the graph an Euler graph.
• A given connected graph G is an Euler graph if and only if all vertices of G are of even
degree.
• Therefore, when in a graph, all vertices are of even degree and a closed walk exists through
every edge and no edge can be repeated then such a graph is called Euler graph.
• Whenever any edge entries into any vertex, then leaves away from another edge. So for Euler
graph vertex must have even number of degree.
Tahsin Aziz 81
82. EULER GRAPH
• Example
• Each vertex have even degree
• a e1 b e2 c e3 d e4 a so a closed walk exists.
a
d c
b
e1
e4
e3
e2
Tahsin Aziz 82
83. EULER PATHS AND CIRCUITS
• An Euler circuit in a graph G is a simple circuit containing every edge of G. If a
connected graph has an Euler circuit, then every vertex must have even degree.
• An Euler path in G is a simple path containing every edge of G. A connected multigraph
has an Euler path but not an Euler circuit if and only if it has exactly two vertices of odd
degree.
Tahsin Aziz 83
84. APPLICATIONS OF EULER PATHS AND CIRCUITS
• Chinese postman problem
• Layout of circuits
• Network multicasting
• Molecular biology
Tahsin Aziz 84
85. KÖNIGSBERG BRIDGE PROBLEM
• The town of königsberg, prussia (now called kaliningrad and part of the russian republic), was divided into
four sections by the branches of the pregel river.
• These four sections included the two regions on the banks of the pregel, kneiphof island, and the region
between the two branches of the pregel. In the eighteenth century seven bridges connected these regions.
• The townspeople took long walks through town on sundays. They wondered whether it was possible to start
at some location in the town, travel across all the bridges once without crossing any bridge twice, and return
to the starting point.
• The swiss mathematician leonhard euler solved this problem. His solution, published in 1736, may be the first
use of graph theory.
• Euler studied this problem using the multigraph obtained when the four regions are represented by vertices
and the bridges by edges.
Tahsin Aziz 85
86. KÖNIGSBERG BRIDGE PROBLEM
A D
4
C
B
C
D
B
A
The Seven Bridges of Königsberg Multigraph Model of the Town of Königsberg
Tahsin Aziz 86
87. KÖNIGSBERG BRIDGE PROBLEM
• We can now solve the Königsberg bridge problem.
• We know a connected multigraph with at least two vertices has an Euler circuit if and
only if each of its vertices has even degree.
• Because the multigraph representing these bridges, shown in second figure, has four
vertices of odd degree, it does not have an Euler circuit.
• And also there is no closed walk which passes all the edges.
• There is no way to start at a given point, cross each bridge exactly once, and return to
the starting point.
Tahsin Aziz 87
88. HAMILTON PATHS AND CIRCUITS
• A simple path in a graph G that passes through every vertex exactly once is called a
Hamilton path.
• A simple circuit in a graph G that passes through every vertex exactly once is called a
Hamilton circuit.
• Hamilton circuit is a connected graph defined as a closed walk that traverses every
vertex of G exactly once, except of the starting vertex at which the walk terminates.
Tahsin Aziz 88
90. HAMILTON PATHS AND CIRCUITS
• There are no known simple necessary and sufficient criteria for the existence of Hamilton circuits. Many
theorems are known that give sufficient conditions for the existence of Hamilton circuits. Certain properties
can be used to show that a graph has no Hamilton circuit.
• A graph with a vertex of degree one cannot have a Hamilton circuit, because in a Hamilton circuit, each vertex
is incident with two edges in the circuit.
• If a vertex in the graph has degree two, then both edges that are incident with this vertex must be part of any
Hamilton circuit.
• Also, note that when a Hamilton circuit is being constructed and this circuit has passed through a vertex, then
all remaining edges incident with this vertex, other than the two used in the circuit, can be removed from
consideration.
• Furthermore, a Hamilton circuit cannot contain a smaller circuit within it.
Tahsin Aziz 90
91. HAMILTON PATHS AND CIRCUITS
• Dirac’s Theorem
• If G is a simple graph with n vertices with n ≥ 3 such that the degree of every vertex in G is at
least n/2, then G has a Hamilton circuit.
• Ore’s theorem
• If G is a simple graph with n vertices with n ≥ 3 such that deg(u) + deg(v) ≥ n for every pair of
nonadjacent vertices u and v in G, then G has a Hamilton circuit.
Tahsin Aziz 91
92. APPLICATIONS OF HAMILTON CIRCUITS
• Traveling salesperson problem or TSP
• Gray codes
Tahsin Aziz 92
93. EXAMPLE
• Can a simple graph exist with 15 vertices each of degree five?
• So total number of edges = 15 × 5 = 75
• Therefore, 2e = 75, which is not possible.
• We know, if a complete undirected graph has n nodes then it has
𝑛(𝑛−1)
2
edges. So to be
a simple graph some of the vertices can not be odd.
Tahsin Aziz 93
94. EULER’S FORMULA
• All planar graph obey Euler’s formula.
• Let G be a connected planar simple graph with e edges and v vertices.
• Let r be the number of regions in a planar representation of G.
• Then r = e − v + 2.
Tahsin Aziz 94
95. EULER’S FORMULA
• Example
• Suppose that a connected planar simple graph has 20 vertices, each of degree 3. Into how
many regions does a representation of this planar graph split the plane?
• Solution
• This graph has 20 vertices, each of degree 3, so v = 20. Because the sum of the degrees of the
vertices, 3v = 3 × 20 = 60, is equal to twice the number of edges, 2e, we have 2e = 60, or e = 30.
• Consequently, from Euler’s formula, the number of regions is r = e − v + 2 = 30 − 20 + 2 = 12.
Tahsin Aziz 95
96. EULER’S FORMULA
• Example • From Euler’s formula we know,
r + v = e +2
3 + 4 = 5 +2
7 = 7
• So it is a planar graph.
A
CB
D
R1
R2
R3
Tahsin Aziz 96
97. EULER’S FORMULA
• Example
• Is K3 complete graph is planar?
• From Euler’s formula we know,
r + v = e +2
2 + 3 = 3 +2
5 = 5
• So it is a planar graph
A
CB
R1
R2
Tahsin Aziz 97
98. COROLLARY
• If G is a connected planar simple graph with e edges and v vertices, where v ≥ 3, then e
≤ 3v − 6.
• If G is a connected planar simple graph, then G has a vertex of degree not exceeding
five.
• If a connected planar simple graph has e edges and v vertices with v ≥ 3 and no circuits
of length three, then e ≤ 2v − 4.
Tahsin Aziz 98
99. KURATOWSKI’S THEOREM
• If a graph is planar, so will be any graph obtained by removing an edge {u, v} and
adding a new vertex w together with edges {u, w} and {w, v}. Such an operation is called
an elementary subdivision.
• The graphs G1 = (V1, E1) and G2 = (V2, E2) are called homeomorphic if they can be
obtained from the same graph by a sequence of elementary subdivisions.
• A graph is nonplanar if and only if it contains a subgraph homeomorphic to K3,3 or K5.
Tahsin Aziz 99
100. ISOMORPHIC GRAPH
• If two graphs have exactly the same form, in the sense that there is a one-to-one
correspondence between their vertex sets that preserves edges.
• In such a case, we say that the two graphs are isomorphic.
• The simple graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there exists a one to-
one and onto function f from V1 to V2 with the property that a and b are adjacent in G1 if
and only if f(a) and f(b) are adjacent in G2, for all a and b in V1. Such a function f is called
an isomorphism.
• Two simple graphs that are not isomorphic are called non isomorphic.
Tahsin Aziz 100
101. APPLICATIONS OF GRAPH ISOMORPHISMS
• Applications of graph theory
• Chemistry
• Design of electronic circuits
• Bioinformatics
• Computer vision.
Tahsin Aziz 101
102. DIJKSTRA’S ALGORITHM
• Use Dijkstra’s algorithm to find the length of a shortest path between the vertices a and
z in the weighted graph displayed in figure.
a
c e
db
z
4
1
2
10
8 2
5
3
6
Tahsin Aziz 102
103. DIJKSTRA’S ALGORITHM
• Step 1:
a
c e
db
z
4
1
2
10
8
5
3
6
0
∞ ∞
∞∞
• Step 1:
a
c e
db
z
4
1
2
10
8 2
5
3
6
0
∞ ∞
∞∞
∞
• Step 2:
a
c e
db
z
4
1
2
10
8 2
5
3
6
0
2(a) ∞
∞4(a)
∞
Tahsin Aziz 103
104. DIJKSTRA’S ALGORITHM
• Step 3:
a
c e
db
z
4
1
2
10
8
5
3
6
0
2(a) 12 a, c
10(a, c)3(a, c)
• Step
a
c e
db
z
4
1
2
10
8 2
5
3
6
0 ∞
• Step 4:
a
c e
db
z
4
1
2
10
8 2
5
3
6
0
2(a) 12(a, c)
8(a, c, b)3(a, c)
∞
Tahsin Aziz 104
105. DIJKSTRA’S ALGORITHM
• Step 5:
a
c e
db
z
4
1
2
10
8
5
3
6
0
2(a) 10 a, c, b, d
8(a, c, b)3(a, c)
• Step
a
c e
db
z
4
1
2
10
8 2
5
3
6
0 14
(a, c, b, d)
• Step 6:
a
c e
db
z
4
1
2
10
8 2
5
3
6
0
2(a) 10(a, c, b, d)
8(a, c, b)3(a, c)
13
(a, c, b, d, e)
Tahsin Aziz 105
106. DIJKSTRA’S ALGORITHM
• Step 7:
a
c e
db
z
4
1
2
10
8
5
3
6
0
2(a) 10 a, c, b, d
8(a, c, b)3(a, c)
• Step
a
c e
db
z
4
1
2
10
8 2
5
3
6
0 13
(a, c, b, d, e)
• So the path will be a – c – b – d – e – z
• The total cost will be 13
Tahsin Aziz 106