Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

In an undirected graph, the degreed(u) of a vertex u is the number of neighbours u is the number of neighbors u has, or equivalently, the number of edges incident upon it. In a directed graph, we distinguish between the indegreedin(u), which is the number of edges into u, and the outdegreedout(u), the number of the edges leaving u.

(a) Show that in an undirected graph, role="math" localid="1658908755010" uevd(u)=2|E|

(b) Use part (a) to show that in an undirected graph, there must be an even number of vertices whose degree is odd.

(c) Does a similar statement hold for the number of vertices with odd indegree in a directed graph?

Short Answer

Expert verified

(a) It can be proved that in an undirected graph,uevd(u)=2|E|.

(b) Using part (a). it has been shown that in an undirected graph, there must be an even number of vertices whose degree is odd.

(c) No, a similar statement does not hold for the number of vertices with odd indegree in a directed graph.

Step by step solution

01

Explain the undirected graph and the degree

Consider the graph, that has edges without arrows that point in no direction. The degree is the number that represents the number of incoming edges of the

02

Show that in an undirected graph,∑uev d(u)=2|E|

(a)

For any edge (u,v), it contributes a degree to vertexu and vertexv at the same time. So, the edges correspond to two degrees, so the degree of the vertices is as follows.

uevd(u)=2|E|

Therefore, it is shown that in an undirected graph,uevd(u)=2|E|.

03

Show that in an undirected graph,∑uev d(u)=2|E|

(b)

The sum of the edges of the each vertex is an even number, it can be seen that the number of vertices with an odd degree must be an even number.

Consider the solution of the part(a),uevd(u)=2|E|,that shows that the sum of the vertices equal the even number of edges.

Therefore, Using part (a). it has been shown that in an undirected graph, there must be an even number of vertices whose degree is odd.

04

Show that in an undirected graph,∑uev d(u)=2|E|  

(c)

Consider the directed graph that has the indegrees dinand outdegrees dout. The indegree represents the number of incoming edges and the out degree represents the number of the outgoing edges from the vertex.

In the directed graph,

role="math" localid="1658912427821" uevd(u)+dout=2|E|, but the parity of the sum of indegrees cannot be determined.

Therefore a similar statement does not hold for the number of vertices with odd indegree in a directed graph.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

The chapter suggests an alternative algorithm for linearization (topological sorting), which repeatedly removes source nodes from the graph (page 101). Show that this algorithm can be implemented in linear time.

Let S be a finite set. A binary relation on S is simply a collection R of ordered pairs(x,y)S×S. . For instance, S might be a set of people, and each such pair (x,y)R might mean “ x knows y ”.

An equivalence relationis a binary relation which satisfies three properties:

  • Reflexivity: localid="1659006645990" (x,y)R for all XS
  • Symmetry: If (x,y)R then (y,x)R
  • Transitivity: if (x,y)R and (y,z)R then localid="1659006784500" (x,Z)R

For instance, the binary relation “has the same birthday as” is an equivalence relation, whereas “is the father of” is not, since it violates all three properties.

Show that an equivalence relation partition set S into disjoint groups S1,S2,,Sk (in other words, S=S1S2SkandSiSj=ϕforallij ) such that:

  • Any two members of a group are related, that is, (x,y)R for any localid="1659006702579" (x,y)Si, for any i .
  • Members of different groups are not related, that is, for all ij, for all localid="1659006762355" xSi andySi, we have (x,Z)R.

(Hint: Represent an equivalence relation by an undirected graph.)

Perform a depth-first search on the following graph; whenever there’s a choice of vertices, pick the one that is alphabetically first. Classify each edge as a tree edge or back edge, and give the pre and post number of each vertex.

Design a linear-time algorithm which, given an undirected graph G and a particular edge ein it, determines whetherGhas a cycle containing.

Give a linear-time algorithm to find an odd-length cycle in a directed graph. (Hint: First solve this problem under the assumption that the graph is strongly connected.)

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free