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
Tree is a widely used data structure employed for representing several problems. We studied tree like a special case of acyclic graph. Though, rooted trees are most prominent of al

Write an algorithm for searching a key from a sorted list using binary search technique 1.   if (low > high) 2.     return (-1) 3.    mid = (low +high)/2; 4    .if ( X

explain implementation of circular queue insert,delete operations

A depth-first traversal of a tree visits a nodefirst and then recursively visits the subtrees of that node. Similarly, depth-first traversal of a graph visits a vertex and then rec

Explain binary search with an example

The objective analysis of an algorithm is to determine its efficiency. Efficiency is based on the resources which are used by the algorithm. For instance, CPU utilization (Ti

Q. Reverse the order of the elements on a stack S    (i) by using two additional stacks (ii) by using one additional queue. Ans :      L e t S be the stac

Define Minimum Spanning Tree A minimum spanning tree of a weighted linked graph is its spanning tree of the smallest weight, where the weight of a tree is explained as the sum

This is a unit of which targeted on the emerging data structures. Red- Black trees, Splay trees, AA-trees & Treaps are introduced. The learner must explore the possibilities of app

Write an algorithm to count number of nodes in the circular linked list.                            Ans. Counting No of Nodes in Circular List Let list be a circular h