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
Painter's Algorithm As the name suggests, the algorithm follows the standard practice of a painter, who  would paint the background (such as a backdrop) first, then the major d

This algorithm inputs 3 numbers, every number goes through successive division by 10 until its value is less than 1. An output is produced which comprise the number input and a val


write a c++ program to find out the area of a curve y=f(x) between x=a and x=b

B Tree Unlike a binary-tree, every node of a B-tree may have a variable number of keys and children. The keys are stored in non-decreasing order. Every key has an associated ch

H o w can you r ot a t e a B i n a r y Tr e e? E x pl a i n r i g h t a n d l eft r ot a tion s by taking an e x a mpl e.   If after

Q. How can we free the memory by using Boundary tag method in the context of Dynamic memory management?

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is called as a   Queue.

A graph with n vertices will absolutely have a parallel edge or self loop if the total number of edges is greater than n-1