# Knowledge Graph and Personalized Answer Sequences for Programming Knowledge Tracing
## 3 Method
### Knowledge Graph to Represent Exercise Vectors  
#### 3.3.1 Constructing Knowledge Graph  
Many kinds of programming exercises exist where the predecessor and successor relationships between KCs are obvious, and these relationships can be reflected by the knowledge graph, as shown in the left part of Figure 2. By using graph embedding methods, embedding vector representations that contain rich semantic and topological information are obtained from the graph. A knowledge graph suitable for the field of programming exercises is constructed in three steps: knowledge acquisition, graph design, and storage.  
* **Knowledge concept acquisition**: We gather information about KCs from the OI-Wiki website. Specifically, hierarchical and relational information about programming concepts, such as \"Dynamic Programming\" and its associated subtopics, like \"Depth First Search\" and \"Recurrence\", is extracted. To ensure the completeness and correctness of these concepts, the obtained KCs are categorized and organized with the help of information from CSDN and Wikipedia. Additionally, three authoritative textbooks, _Data Structure Programming Practice, Introduction to Competitive Programming (2 nd Edition)_, and _Introduction to Algorithms_, are used for validation. This process results in a knowledge graph with 11 topics and 204 KCs.
* **Knowledge graph design**: Introductory KCs in the field of programming are first identified based on various knowledge sources. For instance, under the \"Fundamentals\" category, concepts such as \"Divide and Conquer\" and \"Function\" are categorized as basic KCs. Next, predecessor-successor relationships are established, linking more advanced KCs like \"Dynamic Programming\" to foundational concepts. These relationships are labeled with references to content from _Data Structure Programming Practice_ and OI-Wiki. Further validation of the initial knowledge graph is carried out using _Introduction to Competitive Programming (2 nd Edition)_ and _Introduction to Algorithms_ to minimize potential subjective biases. The graph is then optimized by  
Figure 2: The overall architecture of the GPPKT model, which consists of four functional modules: Knowledge Graph, Learning Ability, Answer Sequence, and LSTM Framework.  
retrieving additional hierarchical relationships for KCs from Wikipedia, ensuring a more comprehensive coverage.
* **Knowledge storage:** After KC acquisition and knowledge graph design, we obtain the nodes and relationships required for the knowledge graph and finally use Neo4j for knowledge storage.  
We extract a portion of the constructed knowledge graph, as shown in Figure 3; the knowledge graph represents different KCs and their interrelationships. For instance, under the category \"Dynamic Programming\", concepts such as \"Depth First Search\" and \"Recurrence\" are connected, reflecting their related nature. Nodes with the same color are assigned to the same knowledge category, indicating their thematic connections. The lighter, dashed edges are used to illustrate connections between different categories, emphasizing the interconnectedness of programming concepts across various topics.