SlideShare a Scribd company logo
1 of 30
NADAR SARASWATHI COLLEGE OF ARTS&SCIENCE,THENI
DEPARTMENT OF COMPUTER SCIENCE&INFORMATION
TECHNOLOGY
V.VANMATHY
I-MSC(CS)
NO SQL
TOPIC: Element of Graph, Operation on Graph
GRAPH
GRAPH
DIFFERENT TYPES OF GRAPH
DIFFERENT TYPES OF GRAPH
GRAPH DATABASE
COMPARED TO RELATION DATABASE
COMPARED TO VALUE STORES
COMPARED TO KEY VALUE STORES
ELEMENT OF GRAPH
Elements of Graph
Identify the vertices, edges, and loops of a graph
Identify the degree of a vertex
Identify and draw both a path and a circuit through a
graph
Determine whether a graph is connected or
disconnected
Find the shortest path through a graph using
Dijkstra’s Algorithm
ELEMENT OF GRAPH
 Graphs, Vertices, and Edges
 A graph consists of a set of dots, called vertices,
and a set of edges connecting pairs of vertices.
While we drew our original graph to correspond
with the picture we had, there is nothing particularly
important about the layout when we analyze a graph.
Both of the graphs below are equivalent to the one
drawn above.
GRAPHS VERTICES AND EDGES
VERTEX
Vertex
 A vertex is a dot in the graph that could represent an
intersection of streets, a land mass, or a general
location, like “work” or “school”. Vertices are often
connected by edges. Note that vertices only occur
 when a dot is explicitly placed, not whenever two
edges cross. Imagine a freeway overpass—the
freeway and side street cross, but it is not possible to
change from the side street to the freeway at that
point, so there is no intersection and no vertex would
be placed.
EDGES
Edges
 Edges connect pairs of vertices. An edge can
represent a physical connection between locations,
like a street, or simply that a route connecting the
two locations exists, like an airline flight.
LOOP
Loop
A loop is a special type of edge that connects a vertex
to itself. Loops are not used much in street network
graphs.
DEGREE OF A VERTEX
Degree of a vertex
 The degree of a vertex is the number of edges
meeting at that vertex. It is possible for a vertex to
have a degree of zero or larger.
Degree 4
Degree 3
Degree 2
Degree 1
PATH
Path
A path is a sequence of vertices using the edges.
Usually we are interested in a path between two
vertices. For example, a path from vertex A to vertex
M is shown below. It is one of many possible paths in
this graph.
CIRCUIT
Circuit
A circuit is a path that begins and ends at the same
vertex. A circuit starting and ending at vertex A is
shown below.
CONNECTED
Connected
A graph is connected if there is a path from any
vertex to any other vertex. Every graph drawn so far
has been connected. The graph below is
disconnected; there is no way to get from the
vertices on the left to the vertices on the right.
WEIGHTS
Weights
Depending upon the problem being solved,
sometimes weights are assigned to the edges. The
weights could represent the distance between two
locations, the travel time, or the travel cost. It is
important to note that the distance between vertices
in a graph does not necessarily correspond to the
weight of an edge.
GRAPH OPERATIONS
Graph Operations – Extracting sub graphs
In this section we will discuss about various types of
sub graphs we can extract from a given Graph.
Sub graph
Getting a sub graph out of a graph is an interesting
operation. A sub graph of a graph G(V,E) can be
obtained by the following means:
Removing one or more vertices from the vertex set.
Removing one or more edges from the edge family.
Removing either vertices or edges from the graph.
VERTICES&EDGES
The vertices of sub graphs are subsets of the original
vertices
The edges of sub graphs are subsets of the original
edges
NEIGHBIURHOOD GRAPH
Neighbourhood graph
 The neighbourhood graph of a graph G(V,E) only makes
sense when we mention it with respect to a given vertex
set. For e.g. if V = {1,2,3,4,5} then we can find out the
Neighbourhood graph of G(V,E) for vertex set {1}.
 So, the neighbourhood graphs contains the vertices 1 and
all the edges incident on them and the vertices connected
to these edges.
Below is a graph and its neighbourhood graphs as
described above.
NEIGHBIURHOOD GRAPG
SPANNING TREE
Spanning Tree
 A spanning tree of a connected graph G(V,E) is a sub
graph that is also a tree and connects all vertices in V.
For a disconnected graph the spanning tree would be the
spanning tree of each component respectively.
 There is an interesting set of problems related to finding
the minimum spanning tree (which we will be discussing
in upcoming posts). There are many algorithms available
to solve this problem, for e.g.: Kruskal’s, Prim’s etc. Note
that the concept of minimum spanning tree mostly
makes sense in case of weighted graphs. If the graph is
not weighted, we consider all the weights to be one and
any spanning tree becomes the minimum spanning tree.
SPANNING TREE GRAPH
GRAPH OPERATIONS
Graph Operations – Conversions of Graphs
 In this section we discuss about converting one graph into
another graph. Which means all the graphs can be converted
into any of the below forms.
Conversion from Directed Graph to Undirected graph
 This is the simplest conversions possible. A directed graph has
directions represented by arrows, in this conversion we just
remove all the arrows and do not store the direction
information. Below is an example of the conversion.
Please note that the graph remains unchanged in terms of its
structure. However, we can choose to remove edges if there
are multi edges. But it is strictly not required.
GRAPH OPERATIONS
Conversion from Undirected Graph to Directed
graph
This conversion gives a directed graph given an
undirected graph G(V,E). It is the exact reverse of
the above. The trick to achieve this is to add one edge
for each existing edge in the edge family E. Once the
extra edges are added, we just assign opposite
direction to each pair of edges between connecting
vertices.
DIRECTED&UNDIRECTED GRAPH

More Related Content

Similar to VANU no sql ppt.pptx

Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2showslidedump
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashingVictor Palmar
 
Lecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxLecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxking779879
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxRajitha Reddy Alugati
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjtepournima055
 
Graphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ programGraphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ programMuhammad Danish Badar
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabatinabati
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx pptDhruvilSTATUS
 
Graph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxGraph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxsahilpawar2426
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringSaurabh Kaushik
 
Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctureszukun
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structuresSavit Chandra
 

Similar to VANU no sql ppt.pptx (20)

Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
Lecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxLecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptx
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptx
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
 
Graphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ programGraphs and eularian circuit & path with c++ program
Graphs and eularian circuit & path with c++ program
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabati
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx ppt
 
Graphs
GraphsGraphs
Graphs
 
Ch18
Ch18Ch18
Ch18
 
ppt 1.pptx
ppt 1.pptxppt 1.pptx
ppt 1.pptx
 
Graph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptxGraph_data_structure_information_engineering.pptx
Graph_data_structure_information_engineering.pptx
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
 
Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctures
 
Siegel
SiegelSiegel
Siegel
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
Graphs in data structures
Graphs in data structuresGraphs in data structures
Graphs in data structures
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
 
DS team2 ppt new.ppt
DS team2 ppt new.pptDS team2 ppt new.ppt
DS team2 ppt new.ppt
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

VANU no sql ppt.pptx

  • 1. NADAR SARASWATHI COLLEGE OF ARTS&SCIENCE,THENI DEPARTMENT OF COMPUTER SCIENCE&INFORMATION TECHNOLOGY V.VANMATHY I-MSC(CS)
  • 2. NO SQL TOPIC: Element of Graph, Operation on Graph
  • 10. COMPARED TO KEY VALUE STORES
  • 11. ELEMENT OF GRAPH Elements of Graph Identify the vertices, edges, and loops of a graph Identify the degree of a vertex Identify and draw both a path and a circuit through a graph Determine whether a graph is connected or disconnected Find the shortest path through a graph using Dijkstra’s Algorithm
  • 13.  Graphs, Vertices, and Edges  A graph consists of a set of dots, called vertices, and a set of edges connecting pairs of vertices. While we drew our original graph to correspond with the picture we had, there is nothing particularly important about the layout when we analyze a graph. Both of the graphs below are equivalent to the one drawn above. GRAPHS VERTICES AND EDGES
  • 14. VERTEX Vertex  A vertex is a dot in the graph that could represent an intersection of streets, a land mass, or a general location, like “work” or “school”. Vertices are often connected by edges. Note that vertices only occur  when a dot is explicitly placed, not whenever two edges cross. Imagine a freeway overpass—the freeway and side street cross, but it is not possible to change from the side street to the freeway at that point, so there is no intersection and no vertex would be placed.
  • 15. EDGES Edges  Edges connect pairs of vertices. An edge can represent a physical connection between locations, like a street, or simply that a route connecting the two locations exists, like an airline flight.
  • 16. LOOP Loop A loop is a special type of edge that connects a vertex to itself. Loops are not used much in street network graphs.
  • 17. DEGREE OF A VERTEX Degree of a vertex  The degree of a vertex is the number of edges meeting at that vertex. It is possible for a vertex to have a degree of zero or larger. Degree 4 Degree 3 Degree 2 Degree 1
  • 18. PATH Path A path is a sequence of vertices using the edges. Usually we are interested in a path between two vertices. For example, a path from vertex A to vertex M is shown below. It is one of many possible paths in this graph.
  • 19. CIRCUIT Circuit A circuit is a path that begins and ends at the same vertex. A circuit starting and ending at vertex A is shown below.
  • 20. CONNECTED Connected A graph is connected if there is a path from any vertex to any other vertex. Every graph drawn so far has been connected. The graph below is disconnected; there is no way to get from the vertices on the left to the vertices on the right.
  • 21. WEIGHTS Weights Depending upon the problem being solved, sometimes weights are assigned to the edges. The weights could represent the distance between two locations, the travel time, or the travel cost. It is important to note that the distance between vertices in a graph does not necessarily correspond to the weight of an edge.
  • 22. GRAPH OPERATIONS Graph Operations – Extracting sub graphs In this section we will discuss about various types of sub graphs we can extract from a given Graph. Sub graph Getting a sub graph out of a graph is an interesting operation. A sub graph of a graph G(V,E) can be obtained by the following means: Removing one or more vertices from the vertex set. Removing one or more edges from the edge family. Removing either vertices or edges from the graph.
  • 23. VERTICES&EDGES The vertices of sub graphs are subsets of the original vertices The edges of sub graphs are subsets of the original edges
  • 24. NEIGHBIURHOOD GRAPH Neighbourhood graph  The neighbourhood graph of a graph G(V,E) only makes sense when we mention it with respect to a given vertex set. For e.g. if V = {1,2,3,4,5} then we can find out the Neighbourhood graph of G(V,E) for vertex set {1}.  So, the neighbourhood graphs contains the vertices 1 and all the edges incident on them and the vertices connected to these edges. Below is a graph and its neighbourhood graphs as described above.
  • 26. SPANNING TREE Spanning Tree  A spanning tree of a connected graph G(V,E) is a sub graph that is also a tree and connects all vertices in V. For a disconnected graph the spanning tree would be the spanning tree of each component respectively.  There is an interesting set of problems related to finding the minimum spanning tree (which we will be discussing in upcoming posts). There are many algorithms available to solve this problem, for e.g.: Kruskal’s, Prim’s etc. Note that the concept of minimum spanning tree mostly makes sense in case of weighted graphs. If the graph is not weighted, we consider all the weights to be one and any spanning tree becomes the minimum spanning tree.
  • 28. GRAPH OPERATIONS Graph Operations – Conversions of Graphs  In this section we discuss about converting one graph into another graph. Which means all the graphs can be converted into any of the below forms. Conversion from Directed Graph to Undirected graph  This is the simplest conversions possible. A directed graph has directions represented by arrows, in this conversion we just remove all the arrows and do not store the direction information. Below is an example of the conversion. Please note that the graph remains unchanged in terms of its structure. However, we can choose to remove edges if there are multi edges. But it is strictly not required.
  • 29. GRAPH OPERATIONS Conversion from Undirected Graph to Directed graph This conversion gives a directed graph given an undirected graph G(V,E). It is the exact reverse of the above. The trick to achieve this is to add one edge for each existing edge in the edge family E. Once the extra edges are added, we just assign opposite direction to each pair of edges between connecting vertices.