Package it.univr.wordautomata.backend
Class GraphStatistics
java.lang.Object
it.univr.wordautomata.backend.GraphStatistics
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Computes the statistics for the given word.void
computeStats
(String word) Computes statistics for a given word in the graph.int
Returns the number of edges searched.int
Returns the length of the longest path in the graph.int
Returns the number of possible paths in the graph.int
Returns the shortest path value.int
Returns the number of vertices 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 theComponents
class, retrieving the word from the bottom bar and passing it as a parameter. -
computeStats
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
-