-2

Please answer me that question

A degree of a vertex is the number of other vertices connected to it. Show that the the sum of the graph vertex degrees is always even.

it is related to graphs in C++

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
ViRus-B0y
  • 13
  • 2

1 Answers1

1

First link in a Google search brings us to ... math.stackexchange

The sum of all the degrees is equal to twice the number of edges. Since the sum of the degrees is even and the sum of the degrees of vertices with even degree is even, the sum of the degrees of vertices with odd degree must be even. If the sum of the degrees of vertices with odd degree is even, there must be an even number of those vertices.

By the way this has nothing to do with "C++ graphs". It is a general property of graphs as per their mathematical definition

Edit :

This statement is only valid for undirected graphs, and is called the Handshaking lemma.

Community
  • 1
  • 1
quantdev
  • 23,517
  • 5
  • 55
  • 88
  • Thanks , i saw that before but i didn't know that graphs we have studied in C++ is already a math object , i thought that something else , Thanks Karim – ViRus-B0y May 31 '14 at 15:47
  • @ViRus-B0y _'... in C++ is already a math object ...'_ Uhmm, what please? Did you panic accept? What's a _c++ math object_ after all, could you elaborate on your enlightenment/understanding now? – πάντα ῥεῖ May 31 '14 at 15:56
  • @πάντα ῥεῖ do u have a problem with me ?!! – ViRus-B0y Jun 01 '14 at 11:27
  • @ViRus-B0y _'do u have a problem with me'_ Certainly not, I just can't understand what you're talking about. Are you learning _C++ by buzzwords_?? – πάντα ῥεῖ Jun 01 '14 at 11:29
  • For clarity, you should include that this only holds for undirected graphs, as it says in the link. Also, I'm fairly sure you confused @ViRus-B0y by using the term "mathematical object" since C++ is object-oriented. It would have been better worded as something like "as per the mathematical definition".×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes×Comments may only be edited for 5 minutes – Nuclearman Jun 02 '14 at 18:13
  • Sure. Edited for clarity, for future readers. – quantdev Jun 02 '14 at 18:16