get_unique_edge_indices
¶
Computes the indices of the edges in edge_index_1 that are NOT present in edge_index_2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge_index_1
|
array
|
The first edge index array. |
required |
edge_index_2
|
array
|
The second edge index array. |
required |
Returns:
| Type | Description |
|---|---|
array
|
The indices of the edges in edge_index_1 that are not present in edge_index_2 |
Example:
edge_index_1 = mx.array(
[
[0, 1, 1, 2],
[1, 0, 2, 1],
]
)
edge_index_2 = mx.array(
[
[1, 2, 2],
[2, 1, 2],
]
)
x = get_unique_edge_indices(edge_index_1, edge_index_2)
# [0, 1]
Source code in mlx_graphs/utils/transformations.py
from mlx_graphs.utils.transformations import get_unique_edge_indices · mlx_graphs/utils/transformations.py