Class ConceptGraphService

java.lang.Object
edu.ucsb.cs.scaffold.services.ConceptGraphService

@Service public class ConceptGraphService extends Object
Graph algorithms for the prerequisite structure of a course's top-level concepts (subconcepts have no position in this graph). Prerequisite edges only ever connect top-level concepts, so every method here operates on that subgraph.

reset(java.util.List<edu.ucsb.cs.scaffold.entity.Concept>, java.util.List<edu.ucsb.cs.scaffold.entity.ConceptEdge>) is the analysis run by POST /api/course/scaffold/reset: it detects cycles (flagging their edges rather than processing them further), removes edges that are redundant given the graph's transitive structure, ranks concepts by longest path from a root, and lays out each level's x,y position. It is a pure function of its inputs — no repository access — so the controller owns loading input and persisting the result.

  • Field Details

  • Constructor Details

    • ConceptGraphService

      public ConceptGraphService()
  • Method Details