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
In the present scenario of global warming, the computer hard ware and software are also contributing for the increase in the temperature in the environment and contributing for the

Question: (a) Discuss the importance of game theory to decisions. (b) Explain the following: (i) saddle point, (ii) two-person zero-sum game. (c) Two leading ?rms, ABC Ltd a

What data structure would you mostly likely see in a nonrecursive execution of a recursive algorithm? Stack

Construct G for α, n, and W given as command line parameters. Throw away edges that have an asymmetric relation between nodes. That is, if A is connected to B, but B is not connect

Q. Write down the algorithm which does depth first search through an un-weighted connected graph. In an un-weighted graph, would breadth first search or depth first search or neith

Given the following search tree, state the order in which the nodes will be searched for breadth first, depth first, hill climbing and best first search, until a solution is reache

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

Q. Execute your algorithm to convert the infix expression to the post fix expression with the given infix expression as input Q = [(A + B)/(C + D) ↑ (E / F)]+ (G + H)/ I

Explain Backtracking The  principal idea is to construct solutions single component  at a time  and evaluate such  partially constructed candidates as follows. If a partiall

A full binary tree with n leaves have:- 2n -1 nodes.