@@ -88,9 +88,9 @@ arma::imat Graph::alltopologicalSort(long long int& sort_count, double save_frac
8888
8989// ' Precompute All Topological Sorts
9090// '
91- // ' This function precomputes all topological sorts for a given preference matrix and
92- // ' saves them to a specified output directory. It ensures the output directory exists
93- // ' and creates it if it does not .
91+ // ' This function precomputes all topological sorts for a given preference matrix.
92+ // ' Topological sorts are consistent orderings of items that respect the given
93+ // ' pairwise preference constraints .
9494// '
9595// ' @param prefs A matrix representing the preference relations. This matrix
9696// ' must have two columns, the first of which represents the preferred item
@@ -100,9 +100,15 @@ arma::imat Graph::alltopologicalSort(long long int& sort_count, double save_frac
100100// '
101101// ' @details
102102// ' The function generates all possible topological sorts for the provided preference matrix
103- // ' and saves approximately ` save_frac` of the sorts in a matrix which is returned.
103+ // ' and saves approximately \code{ save_frac} of the sorts in a matrix which is returned.
104104// '
105- // ' @return This function returns the number of topological sorts.
105+ // ' @return A list with two elements:
106+ // ' \describe{
107+ // ' \item{sort_count}{An integer giving the total number of topological sorts.}
108+ // ' \item{sort_matrix}{A matrix where each column represents one topological sort.
109+ // ' The number of columns is approximately \code{save_frac} times \code{sort_count}.
110+ // ' If \code{save_frac = 0}, this is an empty matrix with dimensions \code{c(0, 0)}.}
111+ // ' }
106112// '
107113// ' @export
108114// ' @examples
0 commit comments