Skip to content

Commit

Permalink
Added comment to mark the Handshake Lemma.
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Dec 22, 2014
1 parent 90648af commit 3bdb537
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions graph_traversal.rb
Expand Up @@ -24,6 +24,7 @@ def vertice_count
@adjacency_list.flatten.uniq.count
end

# Handshake Lemma. The number of edges in a graph is equals to half of the sum of degrees of all vertices.
def edge_count
@adjacency_list.flatten.count / 2
end
Expand Down

0 comments on commit 3bdb537

Please sign in to comment.