5.7. igraph_maxdegree — Calculate the maximum degree in a graph (or set of vertices).

int igraph_maxdegree(const igraph_t *graph, igraph_integer_t *res,
		     igraph_vs_t vids, igraph_neimode_t mode, 
		     igraph_bool_t loops);

The largest in-, out- or total degree of the specified vertices is calculated.

Arguments: 

graph:

The input graph.

res:

Pointer to an integer (igraph_integer_t), the result will be stored here.

mode:

Defines the type of the degree. IGRAPH_OUT, out-degree, IGRAPH_IN, in-degree, IGRAPH_ALL, total degree (sum of the in- and out-degree). This parameter is ignored for undirected graphs.

loops:

Boolean, gives whether the self-loops should be counted.

Returns: 

Error code: IGRAPH_EINVVID: invalid vertex id. IGRAPH_EINVMODE: invalid mode argument.

Time complexity: O(v) if loops is TRUE, and O(v*d) otherwise. v is the number vertices for which the degree will be calculated, and d is their (average) degree.