Unit Five
Unit Five
Definition and Terminology of Graph:
A graph is a non-linear data structure used to model pairwise relationships between objects.
It consists of a finite set of points (vertices) and a set of lines (edges) connecting them. A graph is defined as a collection of vertices and arcs which connects vertices in the graph. A graph G is represented as G equals V comma E, where V is set of vertices and E is set of edges.
Example: graph G can be defined as G equals V comma E where V equals A comma B comma C comma D comma E and
E equals A comma B, A comma C, A comma D, B comma D, C comma D, B comma E, E comma D. This is a graph with five vertices and seven edges.
Graph Terminology
Graph Terminology
One. Vertex: An individual data element of a graph is called a Vertex. Vertex is also known as node. In above example graph, A, B, C, D and E are known as vertices.
Two. Edge: An edge is a connecting link between two vertices. Edge is also known as Arc. An edge is represented as starting Vertex, ending Vertex.
In above graph, the link between vertices A and B is represented as A comma B.