What is the degree of a vertex in a graph?
+
The degree of a vertex in a graph is the number of edges connected to it. In an undirected graph, it is the count of all edges incident to the vertex, while in a directed graph, it can be split into in-degree and out-degree.
How do you find the degree of a vertex in an undirected graph?
+
To find the degree of a vertex in an undirected graph, count the total number of edges connected to that vertex.
How do you calculate the in-degree and out-degree of a vertex in a directed graph?
+
In a directed graph, the in-degree of a vertex is the number of edges coming into the vertex, and the out-degree is the number of edges going out from the vertex. To find them, count incoming edges for in-degree and outgoing edges for out-degree.
Can the degree of a vertex be zero? What does that signify?
+
Yes, a vertex can have a degree of zero, meaning it has no edges connected to it. Such a vertex is called an isolated vertex in the graph.
How does a self-loop affect the degree of a vertex in a graph?
+
In an undirected graph, a self-loop adds 2 to the degree of the vertex because it contributes two incidences. In a directed graph, a self-loop contributes 1 to both the in-degree and out-degree of the vertex.
Is there a formula to find the sum of degrees of all vertices in a graph?
+
Yes, in an undirected graph, the sum of the degrees of all vertices is twice the number of edges (Sum of degrees = 2 × number of edges). This is known as the Handshaking Lemma.