Class TournamentSupport

java.lang.Object
org.graph4j.DirectedGraphAlgorithm
org.graph4j.support.TournamentSupport

public class TournamentSupport extends DirectedGraphAlgorithm
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:
  • Constructor Details

    • TournamentSupport

      public TournamentSupport(Digraph graph)
  • Method Details

    • isTournament

      public boolean isTournament()
      Determines if the graph represents a tournament.
      Returns:
      true if the digraph is a tournament, false otherwise.
    • getHamiltonianPath

      public Path 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.