Undirected graph and adjacency matrix, Data Structure & Algorithms


Q. Consider the specification written below of a graph G

V(G ) = {1,2,3,4}

E(G ) = {(1,2), (1,3), (3,3), (3,4), (4,1)}

(i)        Draw the undirected graph.

(ii)       Also draw its adjacency matrix.                                           

 

Ans:

V(G) = {1,2,3,4}

E(G) = {(1,2),(1,3),(3,3,),(3,4),(4,1)}

(i). The undirected graph is shown as follows:-

 

 

909_Undirected graph.png

 

 

(ii) The adjacency matrix is written as follows:-

 

 

942_Adjacency matrix2.png

Posted Date: 7/10/2012 6:08:55 AM | Location : United States







Related Discussions:- Undirected graph and adjacency matrix, Assignment Help, Ask Question on Undirected graph and adjacency matrix, Get Answer, Expert's Help, Undirected graph and adjacency matrix Discussions

Write discussion on Undirected graph and adjacency matrix
Your posts are moderated
Related Questions
What is a linear array? An array is a way to reference a series of memory locations using the similar name. Every memory location is shown by an array element. An  array elemen

Define Big Theta notation Big Theta notation (θ) : The upper and lower bound for the function 'f' is given by the big oh notation (θ). Considering 'g' to be a function from t

What are the Objectives of visual realism applications After studying this unit, you should be able to know specific needs of realism, add realism to pictures by el

Chaining In this method, instead of hashing function value as location we use it as an index into an array of pointers. Every pointer access a chain that holds the element havi

how to design a cache simulator with 4-way set associative cache

You are supposed to do the following: Write a parallel implementation of the raytracer using pthreads. Measure and compare the execution times for (i) the sequential ver

The searching technique that takes O (1) time to find a data is    Hashing is used to find a data

Area Subdivision Method In this method, the viewport is examined for clear decisions on the polygons situated in it, in regard to their overlap and visibility to the viewer. Fo

Evaluate the frequency counts for all statements in the following given program segment. for (i=1; i ≤ n; i ++) for (j = 1; j ≤ i; j++) for (k =1; k ≤ j; k++) y ++;

Symbols of ADT oeprations All Symbol ADT operations are implemented in Symbol class, except toSymbol(), which is implemented in classes (like String) which can generate a Symb