graph-algorithms

Execute DFS, BFS, Dijkstra, and Union-Find on user-provided graphs.

3|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-data-structures-algorithms --skill graph-algorithms-pluginagentmarketplace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graph-algorithms
Source: https://github.com/pluginagentmarketplace/custom-plugin-data-structures-algorithms/tree/main/skills/graphs
Command: npx skills add https://github.com/pluginagentmarketplace/custom-plugin-data-structures-algorithms --skill graph-algorithms-pluginagentmarketplace

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Implement production-ready graph algorithms including DFS, BFS, Dijkstra shortest path, and Union-Find to solve common graph problems in codebases and analytics workflows.

Core Features & Use Cases

  • Traversal: DFS and BFS traversals on directed and undirected graphs to explore connectivity.
  • Pathfinding: Dijkstra's algorithm for shortest paths in weighted graphs, with path reconstruction.
  • Connected Components: Union-Find for rapid component detection and cycle testing.
  • Topological Sorting: Kahn's algorithm for DAG orderings and dependency resolution.
  • Use Case: Build a network analyzer to identify bottlenecks, compute shortest routes, and validate dependencies in a project graph.

Quick Start

Run the graph-algorithms skill to compute shortest paths and traversals on a sample graph to validate implementations.

Frequently Asked Questions about graph-algorithms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute the shortest path in a weighted graph using Dijkstra's algorithm?

Dijkstra's algorithm computes the shortest path in weighted graphs with full path reconstruction. You provide the graph structure and source node, and it returns the optimal route and total cost for network routing tasks.

What is the best way to detect cycles and connected components in a graph?

Union-Find detects connected components and tests for cycles rapidly in directed and undirected graphs. It handles connectivity checks by tracking disjoint sets, allowing you to validate graph structure and identify isolated subgraphs efficiently.

How do I resolve dependencies using topological sorting in a DAG?

Topological sorting uses Kahn's algorithm to produce valid orderings for directed acyclic graphs. It resolves dependencies by processing nodes with zero in-degree first, outputting a linear sequence that respects all prerequisite constraints.

Can I perform both BFS and DFS traversals on directed and undirected graphs?

BFS and DFS traversals work on both directed and undirected graphs to explore connectivity. You supply the adjacency structure, and the traversal returns visited nodes in order, revealing reachability and component membership.

Does this graph algorithms skill require any external dependencies to run?

No external dependencies are required. The skill operates independently with robust input handling and clear interfaces, allowing you to execute traversal, pathfinding, and connectivity algorithms directly on your provided graph data.