Vertex degrees#
Degree functions#
There are multiple ways of defining the degrees for vertices depending on the type of network at hand. All network types have the following degree types defined:
In-degree referes to the number of edges where the vertex is a member of their out-incident set of vertices, i.e., the cardinality of the set of edges that are incoming to that vertex.
Out-degree referes to the number of edges where the vertex is a member of their in-incident set of vertices, i.e., the cardinality of the set of edges that are outgoing from that vertex.
Incident-degree referes to the number of edges where the vertex is a member of their incident set of vertices, i.e., the set of edges that are incoming to or outgoing from that vertex. This should be the sum of in- and out-degree of that vertex.
- in_degree(network, vertex) -> int
- out_degree(network, vertex) -> int
- incident_degree(network, vertex) -> int
-
template<network_edge EdgeT>
std::size_t in_degree(const network<EdgeT> &net, const typename EdgeT::VertexType &vert)#
-
template<network_edge EdgeT>
std::size_t out_degree(const network<EdgeT> &net, const typename EdgeT::VertexType &vert)#
-
template<network_edge EdgeT>
std::size_t incident_degree(const network<EdgeT> &net, const typename EdgeT::VertexType &vert)#
For undirected networks, degree of a vertex referes to the incident-degree of that vertex. For directed networks, the word degree on its own is vaguely-defined.
- degree(undirected_network, vertex) -> int
-
template<undirected_network_edge EdgeT>
std::size_t degree(const network<EdgeT> &net, const typename EdgeT::VertexType &vert)#
Degree sequences#
Degree sequence functions return the set of (in-, out- or incident-) degee of
vertices in the same order as that of network.vertices()
. In- and
out-degree pair sequence is a sequence of tuples of in- and out-degrees of
vertices.
- in_degree_sequence(network) -> List[int]
- out_degree_sequence(network) -> List[int]
- incident_degree_sequence(network) -> List[int]
- in_out_degree_pair_sequence(network) -> List[Tuple[int, int]]
-
template<network_edge EdgeT>
std::vector<std::size_t> in_degree_sequence(const network<EdgeT> &net)#
-
template<network_edge EdgeT>
std::vector<std::size_t> out_degree_sequence(const network<EdgeT> &net)#
-
template<network_edge EdgeT>
std::vector<std::size_t> incident_degree_sequence(const network<EdgeT> &net)#
-
template<network_edge EdgeT>
std::vector<std::pair<std::size_t, std::size_t>> in_out_degree_pair_sequence(const network<EdgeT> &net)#
Similar to degree()
, degree sequence without a prefix is only defined
for undirected networks.
- degree_sequence(undirected_network) -> List[int]
-
template<undirected_network_edge EdgeT>
std::vector<std::size_t> degree_sequence(const network<EdgeT> &net)#