Different ways for representing s graph, Data Structure & Algorithms

Assignment Help:

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


Related Discussions:- Different ways for representing s graph

Explain in detail about the ruby arrays, Explain in detail about the Ruby a...

Explain in detail about the Ruby arrays Ruby arrays have many interesting and powerful methods. Besides indexing operations which go well beyond those discussed above, arrays h

Arrays, Data array A has data series from 1,000,000 to 1 with step size 1, ...

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Queue be represented by circular linked list, Q. Can a Queue be represented...

Q. Can a Queue be represented by circular linked list with only one pointer pointing to the tail of the queue? Substantiate your answer using an example. A n s . Yes a

Exact analysis of insertion sort, Exact analysis of insertion sort: Let...

Exact analysis of insertion sort: Let us assume the following pseudocode to analyse the exact runtime complexity of insertion sort. T j   is the time taken to execute the s

Draw a flowchart to input start time and end time of vehicle, Speed cameras...

Speed cameras read the time a vehicle passes a point (A) on road and then reads time it passes a second point (B) on the same road (points A and B are 100 metres apart). Speed of t

Analysis of algorithms, A common person's faith is that a computer can do a...

A common person's faith is that a computer can do anything. It is far from truth. In realism computer can carry out only definite predefined instructions. The formal illustration o

Postfix expression algorithm, Write an algorithm to calculate a postfix exp...

Write an algorithm to calculate a postfix expression.  Execute your algorithm using the given postfix expression as your input : a b + c d +*f ↑ . T o evaluate a postfix expr

What is assertions, What is Assertions Introduction At every point...

What is Assertions Introduction At every point in a program, there are generally constraints on the computational state that should hold for program to be correct. For ins

Process of decision making under uncertainty, (a) Describe the steps involv...

(a) Describe the steps involved in the process of decision making under uncertainty. (b) Explain the following principles of decision making: (i) Laplace, (ii) Hurwicz. (c

A Booth''s, Draw a flowchart of a Booth''s multiplication algorithm and exp...

Draw a flowchart of a Booth''s multiplication algorithm and explain it.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd