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.




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:


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

A= (aij) such that



The adjacency matrix representation of given graph is as follows:


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
Q. Describe what do you understand by the term array? How does an array vary from an ordinary variable? How are the arrays represented in the specific memory?

1. For the ER diagram you created in assignment, the artefact of the conceptual database design, map the ER model into the relational model according to how it was designed in the

An algorithm is a sequence of steps to solve a problem; there may be more than one algorithm to solve a problem. The choice of a particular algorithm depends upon following cons

Q. The two Binary Trees are said to be similar if they are both empty or if they are both non- empty and left and right sub trees are similar. Write down an algorithm to determine

Program will demonstrate deletion of an element from the linear array /* declaration of delete_list function */ voiddelete_list(list *, int); /* definition of delete_list

You are given an undirected graph G = (V, E) in which the edge weights are highly restricted. In particular, each edge has a positive integer weight of either {1,2,...,W}, where W

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. Explain Dijkstra's algorithm for finding the shortest path in the graph given to us.  Ans: The Dijkstra's algorithm: This is a problem which is concerned with finding

Define Prim's Algorithm Prim's  algorithm  is  a  greedy  algorithm  for  constructing  a  minimum  spanning  tree  of  a  weighted linked graph. It works by attaching to a bef

Write a program for reversing the Linked list