8.4.6 Computing Similar Graphlets for a Given Graphlet

You can fetch the k most similar graphlets for a given graphlet as described in the following code:

opg4j> var similars = model.computeSimilars(52, 10)
PgxFrame similars = model.computeSimilars(52, 10);
similars = model.compute_similars(52, 10) 
Searching for similar vertices for graphlet with ID = 52 using the trained model and printing it with similars.print(), will result in the following output:
+----------------------------------+
| dstGraphlet | similarity         |
+----------------------------------+
| 52          | 1.0                |
| 10          | 0.8748674392700195 |
| 23          | 0.8551455140113831 |
| 26          | 0.8493421673774719 |
| 47          | 0.8411962985992432 |
| 25          | 0.8281504511833191 |
| 43          | 0.8202780485153198 |
| 24          | 0.8179885745048523 |
| 8           | 0.796689510345459  |
| 9           | 0.7947834134101868 |
+----------------------------------+

The following depicts the visualization of two similar graphlets (top: ID = 52 and bottom: ID = 10):