Degrees
degrees(graph)
Calculate the degrees for each node in a graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
IbisGraph
|
A graph for which to calculate degrees. |
required |
Returns:
Type | Description |
---|---|
Table
|
A table with columns 'node_id' and 'degree', representing the |
Table
|
number of edges for each node. |
Source code in ibisgraph/centrality/degrees.py
in_degrees(graph)
Calculate the in-degrees for each node in a directed graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
IbisGraph
|
A directed graph for which to calculate in-degrees. |
required |
Returns:
Type | Description |
---|---|
Table
|
A table with columns 'node_id' and 'in_degree', representing the |
Table
|
number of incoming edges for each node. |
Raises:
Type | Description |
---|---|
ValueError
|
If the graph is undirected, as in-degrees are only meaningful for directed graphs. |
Source code in ibisgraph/centrality/degrees.py
out_degrees(graph)
Calculate the out-degrees for each node in a directed graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
IbisGraph
|
A directed graph for which to calculate out-degrees. |
required |
Returns:
Type | Description |
---|---|
Table
|
A table with columns 'node_id' and 'out_degree', representing the |
Table
|
number of outgoing edges for each node. |
Raises:
Type | Description |
---|---|
ValueError
|
If the graph is undirected, as out-degrees are only meaningful for directed graphs. |