Package org.graph4j.support
Class TournamentSupport
java.lang.Object
org.graph4j.DirectedGraphAlgorithm
org.graph4j.support.TournamentSupport
Support class for tournament graphs. A tournament
is a directed graph obtained by assigning a direction for each edge in an
undirected complete graph. That is, it is an orientation of a complete graph.
Every tournament has a Hamiltonian path.
- Author:
- Cristian Frăsinaru
- See Also:
-
Field Summary
Fields inherited from class org.graph4j.DirectedGraphAlgorithm
graph, stronglyConnected -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetermines a Hamiltonian path in the tournament.booleanDetermines if the graph represents a tournament.Methods inherited from class org.graph4j.DirectedGraphAlgorithm
isStronglyConnected
-
Constructor Details
-
TournamentSupport
-
-
Method Details
-
isTournament
public boolean isTournament()Determines if the graph represents a tournament.- Returns:
trueif the digraph is a tournament,falseotherwise.
-
getHamiltonianPath
Determines a Hamiltonian path in the tournament.- Returns:
- a Hamiltonian path in the tournament.
- Throws:
IllegalArgumentException- if the input graph is not a tournament.
-