Package org.graph4j.realization
Interface BipartiteRealizationAlgorithm
- All Known Implementing Classes:
HavelHakimiBipartiteRealization
public interface BipartiteRealizationAlgorithm
The bipartite graph realization problem is to determine whether
there exists a bipartite graph having a specified sequence of degrees for
vertices in each partition set.
- Author:
- Cristian Frăsinaru
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckGaleRyserCondition(int[] leftDegrees, int[] rightDegrees) Checks if the degree sequence is valid, using the Gale–Ryser theorem.getGraph()Creates a bipartite graph with the specified degree sequence.getInstance(int[] leftDegrees, int[] rightDegrees) Returns the default implementation of the algorithm.booleanChecks if the degree sequence is valid (bigraphic).
-
Method Details
-
getGraph
Graph getGraph()Creates a bipartite graph with the specified degree sequence.- Returns:
- a bipartite graph with the specified degree sequence.
- Throws:
IllegalArgumentException- if the sequence is not valid (bigraphic).
-
isBigraphic
boolean isBigraphic()Checks if the degree sequence is valid (bigraphic).- Returns:
trueif the sequence is bigraphic,falseotherwise.
-
checkGaleRyserCondition
static boolean checkGaleRyserCondition(int[] leftDegrees, int[] rightDegrees) Checks if the degree sequence is valid, using the Gale–Ryser theorem.- Parameters:
leftDegrees- the degrees of the vertices on the left side.rightDegrees- the degrees of the vertices on the left side.- Returns:
trueif the sequence is digraphic,falseotherwise.
-
getInstance
Returns the default implementation of the algorithm.- Parameters:
leftDegrees- the degrees of the vertices on the left side.rightDegrees- the degrees of the vertices on the right side.- Returns:
- the default implementation of the algorithm.
-