Undirected graph and adjacency matrix, Data Structure & Algorithms

Assignment Help:


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


Related Discussions:- Undirected graph and adjacency matrix

If, 1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=2...

1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=216.65 5. else if h T=216.65+(h*0.001) 6. else if h T=228.65+(h*0.0028) 7. else if h T=270.65 8.

Give the example of bubble sort algorithm, Give the example of bubble sort ...

Give the example of bubble sort algorithm For example List: - 7 4 5 3 1. 7 and 4 are compared 2. Since 4 3. The content of 7 is now stored in the variable which was h

#input restricted DEQUE, #why all the 4 operations i.e. insertion n del...

#why all the 4 operations i.e. insertion n deletion from rear end and front end is valid in input restricted DEQUE

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

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

Write the algorithm of the quick sort, Ans. An algorithm for the quick...

Ans. An algorithm for the quick sort is as follows: void quicksort ( int a[ ], int lower, int upper ) { int i ; if ( upper > lower ) { i = split ( a, lower, up

Algorithm, Ask question #MWhich of the following is not a characteristic of...

Ask question #MWhich of the following is not a characteristic of good algorithm? inimum 100 words accepted#

Abstract data type-stack, Conceptually, the stack abstract data type mimics...

Conceptually, the stack abstract data type mimics the information kept into a pile on a desk. Informally, first we consider a material on a desk, where we might keep separate stack

Write an algorithm inputs speed of cars using pseudocode, Write an algorith...

Write an algorithm by using pseudocode which: Inputs top speeds of 5000 cars Outputs fastest speed and the slowest speed Outputs average speed of all the 5000 cars

Write functions for both addition and subtraction, You will write functions...

You will write functions for both addition and subtraction of two numbers encoded in your data structure. These functions should not be hard to write. Remember how you add and subt

Data Structure, Ask consider the file name cars.text each line in the file ...

Ask consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is repr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd