graph-algorithms

graph-algorithms is a skill for Claude Code from sequenzia/agent-alchemy. It costs 74 tokens per session (4,545 once invoked), scanned A, original, MIT.

A collection of patterns for solving problems involving connected items and relationships, such as roads between cities or dependencies between tasks. It covers breadth-first search, depth-first search, shortest paths, ordering, and grouping.

In plain words
What is it for?
Use it for graphs, trees, routes, dependency ordering, connectivity checks, minimum connection costs, and two-group coloring problems.
Why use it?
It helps you choose an algorithm based on the kind of relationship, path, or connection the problem describes.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the agent-alchemy-cs-tools plugin — 8 skills, 2 agents shipped together

Good fit Use it for graphs, trees, routes, dependency ordering, connectivity checks, minimum connection costs, and two-group coloring problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sequenzia/agent-alchemy/graph-algorithms
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add sequenzia/agent-alchemy --skill graph-algorithms
Clone the repo
git clone --depth 1 https://github.com/sequenzia/agent-alchemy

Made for: Claude Code.

Or install agent-alchemy-cs-tools, the plugin that ships this one along with the rest of its 8 skills, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for graph-algorithms

README.md
[![agentmods](https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/graph-algorithms/github.svg)](https://agentmods.dev/skills/sequenzia/agent-alchemy/graph-algorithms)
Your own site
<a href="https://agentmods.dev/skills/sequenzia/agent-alchemy/graph-algorithms"><img src="https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/graph-algorithms/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for graph-algorithms

Your own site · 80×15
<a href="https://agentmods.dev/skills/sequenzia/agent-alchemy/graph-algorithms"><img src="https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/graph-algorithms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,545 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.04545
Opus 5.5 $0.00030 $0.01818
Sonnet 5.5 $0.00015 $0.00909
Haiku 4.5 $0.00007 $0.00455

Measured 1mo ago against content hash c895f4a1a784, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

graph-algorithms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude/cs-tools/skills/graph-algorithms/SKILL.md · 479 lines

How it starts

The opening of the file, as written. The whole thing — 479 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Graph Algorithm Patterns

Graph problems appear frequently in competitive programming and technical interviews. The key challenge is recognizing which technique fits the problem structure. This reference covers eight core patterns with recognition heuristics, templates, and pitfall guides.


Pattern Recognition Table

Trigger Signals Technique Typical Complexity
Shortest path, unweighted, fewest steps BFS O(V + E)
Explore all paths, connected components, backtracking DFS O(V + E)
Shortest path, weighted (non-negative) Dijkstra O((V + E) log V)
Dependencies, ordering, DAG Topological Sort O(V + E)
Dynamic connectivity, "are X and Y connected?" Union-Find (DSU) O(alpha(N)) per op
Minimum cost to connect all nodes MST (Kruskal/Prim) O(E log E)
Weighted shortest path with negative edges Bellman-Ford O(V * E)
Two groups, coloring, odd cycle Bipartite Check O(V + E)

Constraint-to-Technique Mapping

Use V (vertices) and E (edges) bounds to narrow viable algorithms:

Constraint Range Viable Techniques Notes
V <= 20 Bitmask DP, brute-force BFS/DFS Exponential OK
V <= 1,000, E <= 10,000 All techniques, Floyd-Warshall for APSP O(V^3) still feasible
V <= 100,000, E <= 200,000 BFS, DFS, Dijkstra, Topo Sort, DSU, MST Standard competitive range
V <= 1,000,000 BFS, DFS, DSU, Kahn's Avoid O(V log V) heaps if possible
Negative weights present Bellman-Ford, SPFA Dijkstra invalid
Dense graph (E ~ V^2) Prim (adj matrix), Floyd-Warshall Adjacency list Dijkstra still works
Edges arrive online Union-Find Incremental connectivity

Individual Patterns

BFS (Breadth-First Search)

Recognition Signals

  • "Shortest path" or "minimum steps" in an unweighted graph or grid
  • "Level-order traversal" or "distance from source"
  • Multiple starting points (multi-source BFS)
  • "Nearest" something in a grid

Core Idea

Read the full file on GitHub · 479 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 479 lines · 74 tokens per session scan A c895f4a1a784

Subscribe to this mod's changes

graph-algorithms is a skill published in the GitHub repository sequenzia/agent-alchemy (45 stars, last pushed 4mo ago), licensed MIT. It adds 74 tokens to every session and 4,545 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

connect

Install the scoped Antigravity permission hook.

greenpolo/cc-multi-cli-plugin · 11 tokens

review-depth

Experimental declared review depth for linked-intent development. Use when a LID project's instruction file declares a review depth in prose (e.g. "Review depth - I review through LLD; below that, consolidate to one review") or the user asks to batch phase reviews, consolidate stops, or let go below a phase depth.…

jszmajda/lid · 93 tokens

hook-template

Generate hook script from template. Use when adding a new hook, wiring a PreToolUse/PostToolUse/Stop/Notification hook, or scaffolding hook config for settings.json.

claude-world/director-mode-lite · 39 tokens

brainstorm

Explores a codebase, researches the problem space, and produces an approved design specification before any code is written. Use when the user wants to create a new feature, add significant functionality, redesign a subsystem, or build something that touches multiple parts of the project.

greglas75/zuvo · 56 tokens

a11y-audit

Dedicated WCAG 2.2 AA/AAA accessibility audit across 10 dimensions (A1-A10) covering semantic HTML, keyboard navigation, ARIA patterns, color contrast, forms, images/media, responsive/zoom, motion/animation, reading/content, and legal compliance. Goes far beyond surface-level design-review checks with deep…

greglas75/zuvo · 147 tokens

api-audit

API and endpoint integrity audit across 10 dimensions (D1-D10) plus optional contract stability (D11) and optional OWASP API Security Top 10 (D12: BOLA/BOPLA/BFLA, mass assignment, JWT alg-confusion, GraphQL introspection). Covers validation, payloads, pagination, errors, caching, HTTP semantics, waterfalls, rate…

greglas75/zuvo · 135 tokens