area_flows
AreaFlows
Bases: NodeFlows
radius = 10
instance-attribute
__init__(graph)
filter_area_paths(node_source, area_nodes)
Filter area nodes that have no in-area connection to the source node. i.e. all area nodes for which the source node has no connection into said area node are removed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_source |
int
|
the graph nodes for which we want to filter connections |
required |
area_nodes |
ndarray
|
all nodes within its area |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: filtered area nodes |
run()
Calculate the in-, out- and contained degree of each node to an area within radius.
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray, ndarray]
|
tuple[np.ndarray]: in-, out- and contained degree |
set_radius(radius)
NodeFlows
Bases: NKAlgorithm
The In other words, the in- and out- degree for each node.
run()
Calculates the in- and out flow for each node in the graph.
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
tuple[np.ndarray, np.ndarray]: in and out degree for each node. |