Skip to content
Skills Library
Programming · Building & coding

role-algorithms:graph-algorithms

/role-algorithms:graph-algorithms

Implements graph algorithms — BFS/DFS traversal, shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Johnson's), minimum spanning trees (Kruskal, Prim), topological sort, strongly connected components (Tarjan, Kosaraju), maximum flow (Ford-Fulkerson, Dinic), and bipartite matching (Hopcroft-Karp, Hungarian). Use when solving traversal, shortest path, network flow, connectivity, or scheduling problems.

Licence
MIT
Last repository change
24.07.2026

Assessment and security

80/ 100Class: good
Format15 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Implements graph algorithms — BFS/DFS traversal, shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Johnson's), minimum spanning trees (Kruskal, Prim), topological sort, strongly connected components (Tarjan, Kosaraju), maximum flow (Ford-Fulkerson, Dinic), and bipartite matching (Hopcroft-Karp, Hungarian). Use when solving traversal, shortest path, network flow, connectivity, or scheduling problems.

Original author description

Implements graph algorithms — BFS/DFS traversal, shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Johnson's), minimum spanning trees (Kruskal, Prim), topological sort, strongly connected components (Tarjan, Kosaraju), maximum flow (Ford-Fulkerson, Dinic), and bipartite matching (Hopcroft-Karp, Hungarian). Use when solving traversal, shortest path, network flow, connectivity, or scheduling problems.

How it works

  1. When to use
  2. Core principles
  3. Reference Files
Original SKILL.md headings · 24 lines, 250 words
SKILL.md preview
---
name: role-algorithms:graph-algorithms
description: Implements graph algorithms — BFS/DFS traversal, shortest paths (Dijkstra, Bellman-Ford, Floyd-Warshall, A*, Johnson's), minimum spanning trees (Kruskal, Prim), topological sort, strongly connected components (Tarjan, Kosaraju), maximum flow (Ford-Fulkerson, Dinic), and bipartite matching (Hopcroft-Karp, Hungarian). Use when solving traversal, shortest path, network flow, connectivity, or scheduling problems.
allowed-tools: Read, Grep, Glob, Bash
---

# Graph Algorithms

## When to use
- Modeling a problem as a graph and selecting the right traversal or optimization algorithm
- Finding shortest paths with positive weights (Dijkstra), negative weights (Bellman-Ford), or all pairs (Floyd-Warshall)
- Building minimum spanning trees for network design problems
- Resolving task dependency order via topological sort
- Finding strongly connected components for 2-SAT or condensation graphs
- Computing max flow / min cut or bipartite matching for allocation problems
- Pathfinding in grids or maps with a heuristic (A*)

## Core principles
1. **Representation determines complexity** — adjacency list for sparse, matrix for dense; wrong choice costs orders of magnitude
2. **Negative weights break Dijkstra** — if any edge weight is negative, use Bellman-Ford; don't assume inputs are clean
3. **Max-flow = min-cut** — network flow problems often hide as cut problems; recognize the dual
4. **Topological sort = DP on a DAG** — if you can sort topologically, you can compute DP in one pass
5. **Kruskal needs Union-Find; Prim needs a heap** — pick based on graph density, not familiarity

## Reference Files
- `references/representations-and-traversal.md` — adjacency list/matrix/edge list selection criteria, BFS (unweighted shortest path, bipartite check), DFS (cycle detection, articulation points), DFS edge classification
- `references/shortest-paths-and-mst.md` — Dijkstra, Bellman-Ford, Floyd-Warshall, A* (admissible heuristics), Johnson's algorithm, algorithm selection table, Kruskal and Prim with cut/cycle properties
- `references/advanced-graph.md` — topological sort (Kahn's BFS + DFS post-order), SCCs (Tarjan and Kosaraju), Dinic's max flow, bipartite matching (Hopcroft-Karp, Hungarian, Kuhn's), flow application patterns
Files in this package (4)
  • SKILL.md 2 KB
  • references/advanced-graph.md 3 KB
  • references/representations-and-traversal.md 2 KB
  • references/shortest-paths-and-mst.md 2 KB

Versions

The database has no other skills named role-algorithms:graph-algorithms.

Database snapshot: 13.11.2026 · package version cd1d849e10b3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100graph-algorithms
    Use when working with graph problems including traversal, shortest paths, minimum spanning trees, topological sorting, and connectivity analysis. Covers BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, Prim, Kruskal, Tarjan, Kosaraju, A*, and Union-Find. Based on Knuth's TAOCP.…
  • 100graph-algorithms
    Reference patterns for graph algorithm problems including BFS, DFS, Dijkstra, topological sort, union-find, MST, Bellman-Ford, and bipartite checking. Provides recognition signals, Python templates, edge cases, and common mistakes for each technique. Use when solving problems…
  • 95shortest-path
    Shortest path algorithms (Dijkstra, Floyd-Warshall, Bellman-Ford, A*) for network optimization in MCM/ICM. Use for transportation networks, logistics, routing, supply chain optimization, network flow, social network analysis, or any problem requiring optimal path finding in weighted graphs.
  • 100graph-algorithms-interviewer
    A mid-level software engineering interviewer specializing in graph algorithms. Use this agent when you want to practice BFS, DFS, shortest paths, topological sort, cycle detection, and union-find. It provides progressive hints, ASCII graph visualizations, and structured feedback…
  • 100dsa-graphs-bfs-dfs-topological-sort
    Use this skill when traversing network graphs, finding shortest paths in unweighted graphs, detecting cycles, or determining build orders.
  • 95effect-graph
    Build and analyze immutable graphs with Effect's Graph module — directed/undirected construction, scoped mutation (mutate/addNode/addEdge), node/edge queries, lazy DFS/BFS/topo walkers, algorithms (isAcyclic, stronglyConnectedComponents,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.