n = 7; % Number of nodes.

% We want to enumerate all possible trees.
% Here we get the first tree. 
[lutree_edges prufer] = get_next_tree(n);


% Iterate through all unrooted trees
for itree = 1:(n^(n-2)-1)
    
    
    % For each unrooted tree, there are n rooted trees.
    for iroot = 1:n
        
        % Here you do what you want with your tree.

    end
    
    % Enumerate the next tree
    [lutree_edges prufer] = get_next_tree(n,prufer);

end
