# Change Nickname

Current Nickname:

• Ultipa Graph V4

Standalone

The MAC address of the server you want to deploy.

Cancel
Apply
 ID Product Status Cores Applied Validity Period(days) Effective Date Excpired Date Mac Address Apply Comment Review Comment
Close
Profile
• Full Name:
• Phone:
• Company:
• Company Email:
• Country:
• Language:
Apply

You have no license application record.

Apply
Certificate Issued at Valid until Serial No. File
Serial No. Valid until

Not having one? Apply now! >>>

Product Created On ID Amount (USD) Invoice
Product Created On ID Amount (USD) Invoice

No Invoice

✓ File Writeback ✕ Property Writeback ✓ Direct Return ✓ Stream Return ✕ Stats

## Overview

The Adamic-Adar Index (AA Index) is a node similarity metric named after its creators Lada Adamic and Eytan Adar. This index measures the potential connection strength between two nodes based on the shared neighbors they have in the graph.

The underlying idea of the AA Index is that common neighbors with low degree provide more valuable information about the similarity between two nodes than common neighbors with high degrees. It is computed using the following formula:

where N(u) is the set of nodes adjacent to u. For each common neighbor u of the two nodes, the AA Index first calculates the reciprocal of the logarithm of its degree |N(u)|, then sums up these reciprocal values for all common neighbors.

Higher AA Index scores indicate greater similarity between nodes, while a score of 0 indicates no similarity between two nodes.

In this example, N(D) ∩ N(E) = {B, F}, where $\frac{1}{\mathrm{log|N\left(B\right)|}}$ = $\frac{1}{\mathrm{log4}}$ = 1.6610, $\frac{1}{\mathrm{log|N\left(F\right)|}}$ = $\frac{1}{\mathrm{log3}}$ = 2.0959, thus AA(D,E) = 1.6610 + 2.0959 = 3.7569.

## Considerations

• The AA Index algorithm ignores the direction of edges but calculates them as undirected edges.

## Syntax

• Command: `algo(topological_link_prediction)`
• Parameters:
Name
Type
Spec
Default
Optional
Description
ids / uuids []`_id` / []`_uuid` / / No ID/UUID of the first set of nodes to calculate; each node in `ids`/`uuids` will be paired with each node in `ids2`/`uuids2`
ids2 / uuids2 []`_id` / []`_uuid` / / No ID/UUID of the second set of nodes to calculate; each node in `ids`/`uuids` will be paired with each node in `ids2`/`uuids2`
type string `Adamic_Adar` `Adamic_Adar` Yes Type of similarity; for AA Index, keep it as `Adamic_Adar`
limit int >=-1 `-1` Yes Number of results to return, `-1` to return all results

## Example

The example graph is as follows:

### File Writeback

Spec Content
filename `node1`,`node2`,`num`
``````algo(topological_link_prediction).params({
uuids: [3],
uuids2: [1,5,7]
}).write({
file:{
filename: 'aa'
}
})
``````

Results: File aa

``````C,A,1.660964
C,E,3.321928
C,G,2.095903
``````

### Direct Return

Alias Ordinal Type
Description
Columns
0 []perNodePair Node pair and its similarity `node1`, `node2`, `num`
``````algo(topological_link_prediction).params({
ids: 'C',
ids2: ['A','C','E','G'],
}) as aa
return aa
``````

Results: aa

node1 node2 num
3 1 1.66096404744368
3 5 3.32192809488736
3 7 2.09590327428938

### Stream Return

Alias Ordinal Type
Description
Columns
0 []perNodePair Node pair and its similarity `node1`, `node2`, `num`
``````find().nodes() as n
with collect(n._id) as nID
ids: 'C',
ids2: nID
}).stream() as aa
where aa.num >= 2
return aa
``````

Results: aa

node1 node2 num
3 4 3.75686732173307
3 5 3.32192809488736
3 7 2.09590327428938