Skip to content

Commit

Permalink
doc: clarify the effect of loop edges in Graph.similarity_inverse_log…
Browse files Browse the repository at this point in the history
…_weighted()
  • Loading branch information
ntamas committed Dec 13, 2023
1 parent 7f78f46 commit 0564388
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/_igraph/graphobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -15790,6 +15790,15 @@ struct PyMethodDef igraphmodule_Graph_methods[] = {
"Each vertex is assigned a weight which is 1 / log(degree). The\n"
"log-weighted similarity of two vertices is the sum of the weights\n"
"of their common neighbors.\n\n"
"Note that the presence of loop edges may yield counter-intuitive\n"
"results. A node with a loop edge is considered to be a neighbor of itself\n"
"I{twice} (because there are two edge stems incident on the node). Adding a\n"
"loop edge to a node may decrease its similarity to other nodes, but it may\n"
"also I{increase} it. For instance, if nodes A and B are connected but share\n"
"no common neighbors, their similarity is zero. However, if a loop edge is\n"
"added to B, then B itself becomes a common neighbor of A and B and thus the\n"
"similarity of A and B will be increased. Consider removing loop edges\n"
"explicitly before invoking this function using L{Graph.simplify()}.\n\n"
"@param vertices: the vertices to be analysed. If C{None}, all vertices\n"
" will be considered.\n"
"@param mode: which neighbors should be considered for directed graphs.\n"
Expand Down

0 comments on commit 0564388

Please sign in to comment.