JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

Showing posts with label Graph-Representation. Show all posts
Showing posts with label Graph-Representation. Show all posts

Graph Representation

11:02 PM
Graph Representation By Graph representation, we simply mean the technique which is to be used in order to store some graph into the computer's memory. There are two ways to store Graph into the computer's memory. In this part of this tutorial, we discuss each one of them in detail. 1. Sequential Representation In sequential representation, we use adjacency matrix to store the mapping represented by vertices and edges. In adjacency matrix, the rows and columns are represented by the graph vertices. A graph having n vertices, will have a dimension  n x n . An entry M ij  in the adjacency matrix representation of an undirected graph G will be 1 if there exists an edge between V i  and V j . An undirected graph and its adjacency matrix representation is shown in the following figure.   in the above figure, we can see the mapping among the vertices (A, B, C, D, E) is represented by using the adjacency matrix which is also shown in the figure. There exists differe

.