import fi.uef.cs.tra.DiGraph; import fi.uef.cs.tra.Vertex; import java.util.HashSet; import java.util.Set; public class TRAII_25_X4_skeleton implements TRAII_25_X4 { /** * SELF-EVALUATION HERE: * * * **/ /** * All the vertices that do not have incoming edges. * @param G input graph * @return set of root vertices */ @Override public Set rootVertics(DiGraph G) { Set roots = new HashSet<>(); // TODO, other methods can used return roots; } /** * How many trees there are in the graph? * A tree has no back-, cross- or forward edges. * @param G input graph * @return number of trees */ @Override public int treeCount(DiGraph G) { Set potentiaTreeRoots = rootVertics(G); // it is not obligatory to use the finding of the root, // but is one good starting point // it is anyway one obligatory part of the task X4 // TODO here code that finds out which components are trees // TODO other methods can used return -1; // TODO } }