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
Book to refer: Introduction to Algorithms, 3rd Ed, by Clifford Stein, Thomas H. Cormen, Ronald Rivest, Charles E. Leiserson Question: Tic Tac Toe game -Design a GUI and implement


Enumerate the Types in Ruby Ruby is a pure object-oriented language, meaning that all types in Ruby are classes, and each value in a Ruby program is an instance of a class. Thi

For the following graph find the adjacency matrix and adjacency list representation of the graph.

Explain in detail the algorithmic implementation of multiple stacks.

Graphs are data structures which consist of a set of vertices & a set of edges which connect the vertices. A graph where the edges are directed is called directed graph. Or else, i

For the Oscillating sort to be applied, it is necessary for the tapes to be readable in both directions and able to be quickly reversed. The oscillating sort is superior to the po

What is bubble sort? Bubble Sort: The basic idea in bubble sort is to scan the array to be sorted sequentially various times. Every pass puts the largest element in its corr

how to do a merge sorting

2. Write a note on i) devising ii) validating and iii) testing of algorithms.