pylibhipgraph.jaccard_coefficients

Contents

pylibhipgraph.jaccard_coefficients#

2025-05-20

2 min read time

Applies to Linux

jaccard_coefficients (ResourceHandle resource_handle, _GPUGraph graph, first, second, bool_t use_weight, bool_t do_expensive_check)

Compute the Jaccard coefficients for the specified vertex_pairs.

Note

Jaccard similarity must run on a symmetric graph.

Parameters#

resource_handleResourceHandle

Handle to the underlying device resources needed for referencing data and running algorithms.

graphSGGraph or MGGraph

The input graph, for either Single or Multi-GPU operations.

first :

Source of the vertex pair.

second :

Destination of the vertex pair.

use_weightbool, optional

If set to True, compute the weighted jaccard_coefficients (the input graph must be weighted in that case). Otherwise, compute the un-weighted jaccard_coefficients.

do_expensive_checkbool

If True, performs more extensive tests on the inputs to ensure validity, at the expense of increased run time.

Returns#

A tuple of device arrays containing the vertex pairs with their corresponding Jaccard coefficient scores.