Data Structure (2130702)

BE | Semester-3   Summer-2017 | 05/31/2017

Q4) (b)

Give definitions

Graph

  • A graph G consist of a non-empty set V called the set of nodes (points, vertices) of the graph, a set E which is the set of edges and a mapping from the set of edges E to a set of pairs of elements of V.
  • It is also convenient to write a graph as G=(V,E).
  • Notice that definition of graph implies that to every edge of a graph G, we can associate a pair of nodes of the graph. If an edge X ? E is thus associated with a pair of nodes (u,v) where u, v ? V then we says that edge x connect u and v.
  • Given image represent a graph

Adjacent Nodes

  • Any two nodes which are connected by an edge in a graph are called adjacent node.
  • In given image node 1 & 2, 2 & 3, 2 & 4, 1 & 3, 3 & 4 are adjacent nodes
Q4_B_OR_AdjacentNodes