1 #ifndef GL_DEGREE_SEQUENCE_HPP
2 #define GL_DEGREE_SEQUENCE_HPP
4 #include "../structures/Graph.hpp"
16 template <
class SCALAR,
class STORAGE_KIND,
class DIR, GL_ENABLE_IF_UNDIRECTED_T>
20 throw std::logic_error(
"Graph is not undirected.");
23 std::sort(out.begin(), out.end(), std::greater<typename GRAPH::idx_t>());
30 #endif // GL_DEGREE_SEQUENCE_HPP
std::vector< idx_t > idx_list_t
Index List type.
Definition: Graph.hpp:48
Stores and implements a Graph.
Definition: Graph.hpp:39
Graph< SCALAR, STORAGE_KIND, DIR >::idx_list_t degreeSequence(const Graph< SCALAR, STORAGE_KIND, DIR > &graph)
Computes the out-degree of all nodes in an undirected graph. The resulting list is sorted by descendi...
Definition: DegreeSequence.hpp:17
bool isDirected() const
Returns true if the graph is directed, false if not.
Definition: Graph.hpp:426
Graph::idx_list_t degrees(const Graph &graph)
Computes the out-degrees of all nodes in a graph.
Definition: Degrees.hpp:16