Different ways for representing s graph, Data Structure & Algorithms

What are the different ways by which we can represent graph?  Represent the graph drawn below using those ways.

 

1351_graph_theory.png

 

The different ways by which we can representgraph are:

Adjacency list representation: This representation of graph comprises of an array Adj of |V| lists, one for each vertex in V. For each uεV, the adjacency list Adj[u] comprises of all the vertices v such that there is an edge (u,v E that is Adj[u] comprises of all the vertices adjacent to u in G. The vertices in each adjacency list are stored out in an arbitrary order. The adjacency list representation of given graph is depicted in the figure drawn below:

1735_graph_theory_1.png

Adjacency Matrix representation: This representation consists of the |V|*|V| matrix

A= (aij) such that

 

1681_Adjency_matrix.png

The adjacency matrix representation of given graph is as follows:

2024_graphs.png

Posted Date: 7/10/2012 1:22:56 AM | Location : United States







Related Discussions:- Different ways for representing s graph, Assignment Help, Ask Question on Different ways for representing s graph, Get Answer, Expert's Help, Different ways for representing s graph Discussions

Write discussion on Different ways for representing s graph
Your posts are moderated
Related Questions
b) The user will roll two (six-sided) dices and the user will lose the game if (s)he gets a value 1 on either any of the two dices & wins otherwise. Display a message to the user w

Q.1 Write procedures/ Algorithm to insert and delete an element in to array. Q.2. Write an algorithm for binary search. What are the conditions under which sequential search of


One of the best known methods for external sorting on tapes is the polyphase sort. Principle: The basic strategy of this sort is to distribute ordered initial runs of predetermi

Question 1 Explain how the shuttle sort algorithm works by making use of the following list of integers:11, 4, 2, 8, 5, 33, 7, 3, 1, 6. Show all the steps. Question 2


B-trees are special m-ary balanced trees utilized in databases since their structure allows records to be added, deleted & retrieved with guaranteed worst case performance. A B-

Efficiency of Linear Search How much number of comparisons is there in this search in searching for a particular element? The number of comparisons based upon where the reco

Q. Illustrate the steps for converting the infix expression into the postfix expression   for the given expression  (a + b)∗ (c + d)/(e + f ) ↑ g .

Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer? O (1)