Class GraphStatistics

java.lang.Object
it.univr.wordautomata.backend.GraphStatistics

public class GraphStatistics extends Object
The GraphStatistics class represents the statistics of a graph in a word automaton. It provides methods to compute various statistics such as the longest path, shortest path, possible paths, vertices searched, and edges searched.
  • Constructor Details

    • GraphStatistics

      public GraphStatistics()
      Initializes the statistics with default values.
  • Method Details

    • computeStats

      public void computeStats()
      Computes the statistics for the given word. This method delegates the computation to the Components class, retrieving the word from the bottom bar and passing it as a parameter.
    • computeStats

      public void computeStats(String word)
      Computes statistics for a given word in the graph.
      Parameters:
      word - the word for which to compute statistics
    • getPossiblePaths

      public int getPossiblePaths()
      Returns the number of possible paths in the graph.
      Returns:
      the number of possible paths
    • getVerticesSearched

      public int getVerticesSearched()
      Returns the number of vertices searched.
      Returns:
      the number of vertices searched
    • getEdgesSearched

      public int getEdgesSearched()
      Returns the number of edges searched.
      Returns:
      the number of edges searched
    • getLongestPath

      public int getLongestPath()
      Returns the length of the longest path in the graph.
      Returns:
      the length of the longest path
    • getShortestPath

      public int getShortestPath()
      Returns the shortest path value.
      Returns:
      the shortest path value