VertexJaccardSimilarity[g,u,v]
gives the Jaccard similarity between vertices u and v of the graph g.
VertexJaccardSimilarity[{vw,…},…]
uses rules vw to specify the graph g.
VertexJaccardSimilarity
VertexJaccardSimilarity[g,u,v]
gives the Jaccard similarity between vertices u and v of the graph g.
VertexJaccardSimilarity[{vw,…},…]
uses rules vw to specify the graph g.
Details
- The vertex Jaccard similarity is also known as Jaccard index and Jaccard similarity coefficient.
- The vertex Jaccard similarity between u and v is the number of common neighbors of u and v divided by the number of vertices that are neighbors of u or v.
- VertexJaccardSimilarity works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (6)
VertexJaccardSimilarity works with undirected graphs:
VertexJaccardSimilarity[[image], 1, 2]VertexJaccardSimilarity[[image], 1, 2]VertexJaccardSimilarity[[image], 1, 2]VertexJaccardSimilarity[[image], 1, 4]Use rules to specify the graph:
VertexJaccardSimilarity[{1 -> 2, 2 -> 3, 3 -> 1, 3 -> 4}, 1, 2]VertexJaccardSimilarity works with large graphs:
g = ExampleData[{"NetworkGraph", "Internet"}];VertexJaccardSimilarity[g, 1, 26]//N//TimingProperties & Relations (3)
Use JaccardDissimilarity to compute the Jaccard similarity of a graph:
g = [image];m = Normal[AdjacencyMatrix[g]];{1 - JaccardDissimilarity[m[[1]], m[[7]]], VertexJaccardSimilarity[g, 1, 7]}The Jaccard similarity between two vertices is equal to zero if one of them has degree zero:
VertexJaccardSimilarity[[image], 1, 4]The Jaccard similarity between two vertices is equal to 1 if they have the same neighbors:
VertexJaccardSimilarity[[image], 1, 2]Related Guides
Text
Wolfram Research (2012), VertexJaccardSimilarity, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexJaccardSimilarity.html (updated 2015).
CMS
Wolfram Language. 2012. "VertexJaccardSimilarity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/VertexJaccardSimilarity.html.
APA
Wolfram Language. (2012). VertexJaccardSimilarity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexJaccardSimilarity.html
BibTeX
@misc{reference.wolfram_2026_vertexjaccardsimilarity, author="Wolfram Research", title="{VertexJaccardSimilarity}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/VertexJaccardSimilarity.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_vertexjaccardsimilarity, organization={Wolfram Research}, title={VertexJaccardSimilarity}, year={2015}, url={https://reference.wolfram.com/language/ref/VertexJaccardSimilarity.html}, note=[Accessed: 13-June-2026]}