Package org.graph4j.measures
Class GraphMeasures
java.lang.Object
org.graph4j.measures.GraphMeasures
Various sizes related to graphs.
- Author:
- Cristian Frăsinaru
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublestatic doubleavgIndegree(Digraph digraph) Determines the average indegree of vertices.static doubleavgOutdegree(Digraph digraph) Determines the average outdegree of vertices.static double[]degreeDistribution(Graph graph) The degree distribution is the probability distribution P of the graph degrees over the whole graph.static int[]degreeHistogram(Graph graph) The degree histogram counts how many vertices have a specific degree in the graph.static doublestatic doublestatic int[]indegreeHistogram(Digraph digraph) The indegree histogram counts how many vertices have a specific indegree in the digraph.static intstatic intmaxDegreeVertex(Graph graph) static intmaxIndegree(Digraph digraph) Determines the maximum indegree of the vertices.static intmaxIndegreeVertex(Digraph digraph) Determines a vertex with maximum indegree.static intmaxOutdegree(Digraph digraph) Determines the maximum outdegree of the vertices.static intmaxOutdegreeVertex(Digraph digraph) Determines a vertex with maximum outdegree.static intDetermines the minimum degree of the vertices.static intminDegreeVertex(Graph graph) Determines a vertex with minimum degree.static intminIndegree(Digraph digraph) Determines the minimum indegree of the vertices.static intminIndegreeVertex(Digraph digraph) Determines a vertex with minimum indegree.static intminOutdegree(Digraph digraph) Determines the minimum outdegree of the vertices.static intminOutdegreeVertex(Digraph digraph) Determines a vertex with minimum outdegree.static longnumberOfTriangles(Graph graph) A triangle is formed by three distinct vertices connected all with each other.static longnumberOfTriplets(Graph graph) A triplet is formed by three distinct vertices that are connected by either two (open triplet) or three (closed triplet) undirected edges.static int[]outdegreeHistogram(Digraph digraph) The outdegree histogram counts how many vertices have a specific outdegree in the digraph.
-
Constructor Details
-
GraphMeasures
public GraphMeasures()
-
-
Method Details
-
density
- Parameters:
graph- the input graph.- Returns:
- the density of the graph.
-
minDegree
Determines the minimum degree of the vertices.- Parameters:
graph- the input graph.- Returns:
- the minimum degree of the vertices.
-
minDegreeVertex
Determines a vertex with minimum degree.- Parameters:
graph- the input graph.- Returns:
- a vertex number of minimum degree.
-
maxDegree
- Parameters:
graph- the input graph.- Returns:
- the maximum degree of the vertices.
-
maxDegreeVertex
- Parameters:
graph- the input graph.- Returns:
- a vertex number of maximum degree.
-
avgDegree
- Parameters:
graph- the input graph.- Returns:
- the average degree of the vertices.
-
degreeHistogram
The degree histogram counts how many vertices have a specific degree in the graph. IfdegreeHistogram(g)[i]=kthen there are k vertices having the degree i.- Parameters:
graph- the input graph.- Returns:
- the degree histogram of the graph.
-
degreeDistribution
The degree distribution is the probability distribution P of the graph degrees over the whole graph. If there are n vertices in the graph and nk of them have degree k, we have P(k)=nk/n.- Parameters:
graph- the input graph.- Returns:
- the degree distribution of the graph.
-
numberOfTriangles
A triangle is formed by three distinct vertices connected all with each other.- Parameters:
graph- the input graph.- Returns:
- the number of triangles in the graph.
- See Also:
-
numberOfTriplets
A triplet is formed by three distinct vertices that are connected by either two (open triplet) or three (closed triplet) undirected edges. A triangle graph therefore includes three closed triplets.- Parameters:
graph- the input graph.- Returns:
- the number of triplets in an undirected graph.
-
density
- Parameters:
digraph- the input digraph.- Returns:
- the density of the digraph.
-
minIndegree
Determines the minimum indegree of the vertices.- Parameters:
digraph- the input digraph.- Returns:
- the minimum indegree of the vertices.
-
minIndegreeVertex
Determines a vertex with minimum indegree.- Parameters:
digraph- the input digraph.- Returns:
- a vertex number of minimum indegree.
-
maxIndegree
Determines the maximum indegree of the vertices.- Parameters:
digraph- the input digraph.- Returns:
- the maximum indegree of the vertices.
-
maxIndegreeVertex
Determines a vertex with maximum indegree.- Parameters:
digraph- the input digraph.- Returns:
- a vertex number of maximum indegree.
-
avgIndegree
Determines the average indegree of vertices.- Parameters:
digraph- the input digraph.- Returns:
- the average indegree of the vertices.
-
indegreeHistogram
The indegree histogram counts how many vertices have a specific indegree in the digraph. IfindegreeHistogram(g)[i]=kthen there are k vertices having the indegree i.- Parameters:
digraph- the input digraph.- Returns:
- the indegree histogram of the digraph.
-
minOutdegree
Determines the minimum outdegree of the vertices.- Parameters:
digraph- the input digraph.- Returns:
- the minimum outdegree of the vertices.
-
minOutdegreeVertex
Determines a vertex with minimum outdegree.- Parameters:
digraph- the input digraph.- Returns:
- a vertex number of minimum outdegree.
-
maxOutdegree
Determines the maximum outdegree of the vertices.- Parameters:
digraph- the input digraph.- Returns:
- the maximum outdegree of the vertices.
-
maxOutdegreeVertex
Determines a vertex with maximum outdegree.- Parameters:
digraph- the input digraph.- Returns:
- a vertex number of maximum outdegree.
-
avgOutdegree
Determines the average outdegree of vertices.- Parameters:
digraph- the input digraph.- Returns:
- the average outdegree of the vertices.
-
outdegreeHistogram
The outdegree histogram counts how many vertices have a specific outdegree in the digraph. IfoutdegreeHistogram(g)[i]=kthen there are k vertices having the outdegree i.- Parameters:
digraph- the input digraph.- Returns:
- the outdegree histogram of the digraph.
-