CP-Coach: CP Coach: The Graph That Turns Competitive Programming Into a Prerequisite Map

An open-source coach that blends knowledge tracing, topic dependencies, and fallback rules to recommend the next problem a programmer is actually ready to solve.

8 to 10 min read • View on GitHub • More from MannPatel1236

A wide editorial scene of a competitive programming curriculum drawn like a railway map, with one learner moving from early topics into branching advanced nodes. The lit path suggests that progress depends on unlocked prerequisites, not a flat list of problems.
CP Coach treats practice as a dependency network. The point is not to find the hardest problem. It is to find the next problem that fits the learner's current map.
Key Takeaways

Why Competitive Programming Needs a Map, Not a Feed

Competitive programming practice usually breaks in one of two ways. You either scroll through problem lists until choice paralysis wins, or you follow a static sheet that ignores where you are stuck. CP Coach takes a harder line: the next problem should be the one that unlocks the next concept, not just the one that matches a rating band.

That is why the project is interesting. It does not treat skill as a flat score. It treats skill as a set of dependencies, where topics become available only after the prerequisites are strong enough.

Stop guessing what to practice. Let AI tell you.

binarymind-dev/cp-coach (GitHub README), Project Documentation · binarymind-dev/cp-coach: AI-powered Codeforces analyzer - GitHub

The repo's own pitch is blunt: "CP Coach analyzes your Codeforces profile and uses Groq AI to detect your weakest topics, then builds a personalized practice roadmap." That is the product story in one sentence. The more interesting story is how the code makes that roadmap feel less like a guess and more like a curriculum.

The Topic Graph Is the Real Product

At the center of the system is a 29-node topic graph. This is the pedagogical backbone of the app. Topics such as implementation, math, number theory, combinatorics, graphs, flows, and dynamic programming are connected as prerequisites, so the model can reason about what should come before what.

The recommendation path is not a single model output. It is a sequence of gates that narrows the search from user history to eligible topics to a final problem recommendation.

This matters because the graph is not decoration. It is the structure the model reasons over. If the graph says one topic depends on another, CP Coach can avoid recommending a problem that is technically matched to the user's rating but pedagogically too early.

A close-up mechanical sorting desk where problem cards enter from the left, pass through a prerequisite gate, then slide into difficulty bands before weakly matched cards fall into a stretch-goal tray. The scene explains how the recommender filters practice instead of simply ranking it.
The recommender behaves like an editor, not a search engine. It filters for readiness first, then difficulty, then fallback coverage.

How Graph-DKT Makes Mastery Student-Aware

The model layer is a graph-augmented version of Deep Knowledge Tracing. Standard DKT tracks how likely a learner is to solve future problems from past attempts. CP Coach adds a graph convolutional layer so the model can spread signals across related topics, which is a better fit for a domain where one weak concept often leaks into another.

The implementation also makes a sharp practical choice. For a small 29-node graph, the project uses a dense GCN path that favors CPU performance over textbook sparse message passing. That is a telling detail. This is not a demo that only works in a notebook. It is tuned like software meant to run reliably for real users.

There is also an internal fix that matters conceptually. A graph only helps if node features differ by student. The code injects per-topic mastery estimates into the node features, so the graph is not just passing around identical embeddings. It becomes student-aware.

What the model is doing

  1. It reads submission history and applies recency weighting so recent performance counts more than old noise.
  2. It estimates mastery per topic instead of collapsing the user into one global score.
  3. It pushes those mastery signals through the prerequisite graph so related concepts can influence one another.
  4. It uses the result to identify weak areas that are ready to be trained, not just weak areas in the abstract.

That is the subtle shift. The model is not asking, "What is this user bad at?" It is asking, "What is this user ready to fix next without wasting time?"

The average competitive programmer plateaus because they repeat what they're already good at. CP Coach forces deliberate practice on your weakest tags.

CP Coach (cpcoach.xyz), Project Website · CP Coach — Practice Smarter. Climb Faster.

The Recommender Does More Than Rank Problems

This is where the project becomes operational. The recommender does not just score problems and hand back the top result. It follows a sequence: weak topic detection, prerequisite gating, difficulty banding, and stretch fallback.

Practice modePersonalizationPrerequisite awarenessFeedback loopFallback behaviorBest use case
Static problem sheetsLowNoneManualNoneStructured self-study when you already know your gaps
Rule-based filtersMediumWeakLimitedBasicFast searching by rating or tag
Generic recommendersMedium to highUsually noneModel-drivenVariesBroad personalization without pedagogy
CP CoachHighStrongModel plus rulesExplicit stretch fallbackDeliberate practice with a safer next step

The difference is not just technical. It is editorial. A normal filter says, "Here are problems that match your tag and rating." CP Coach says, "Here are the problems that are most likely to move your skill forward without dumping you into a concept you have not unlocked yet."

That is why the fallback matters. If the narrow band produces no candidates, the system expands into stretch goals instead of leaving the learner stranded. A good coach does not only find the perfect drill. It always has a next drill.

Why the App Still Works Without the Model

A lot of ML products are brittle in the wrong place. If the weights are missing, the experience collapses. CP Coach takes the opposite approach. The application includes a rule-based recommender path so the system can keep functioning even when the learned model is unavailable.

That is a strong signal of maturity. It means the author is building for continuity, not just for an impressive demo. The model improves the coach, but it is not the only thing holding the app together.

In practice, that gives the product a useful property: graceful degradation. The AI layer can fail, and the user still gets a recommendation path. For a tool built around practice habits, that matters more than a flashy architecture slide.

How It Fits Into the CP Tool Landscape

Compared with static sheets, CP Coach is adaptive. Compared with simple rating filters, it is prerequisite-aware. Compared with generic recommenders, it tries to model learning rather than only preference.

Tool typeStrengthWeaknessWhere CP Coach differs
Static sheetsClear structureNo personalizationCP Coach reorders around your current mastery
Rule-based searchFast and familiarIgnores topic dependenciesCP Coach gates recommendations by prerequisites
Generic AI recommenderFeels personalizedCan be pedagogically shallowCP Coach ties suggestions to a learning graph
Manual progress trackerGood visibilityStill requires user judgmentCP Coach automates the judgment step

That niche is narrow but real. The project is not trying to replace every CP resource. It is trying to solve the part that most tools skip: the transition from knowing your weak spots to choosing the right next problem.

Why This Feels Like Research, Not Just a Hack

The codebase reads like a small research-to-production effort. It includes cross-validation scripts, ablation work, and deployment plumbing. The graph layer was not just bolted on for style. It was tested as a hypothesis.

That is what makes CP Coach compelling. It treats competitive programming as a learning system with structure, dependencies, and failure modes. The result is a coach that is less random, less brittle, and more honest about how skill actually compounds.