role-algorithms:graph-algorithms

Implement graph algorithms for traversal, shortest paths, and network flow.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill role-algorithms-graph-algorithms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: role-algorithms:graph-algorithms
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/roles/role-algorithms/skills/graph-algorithms
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill role-algorithms-graph-algorithms

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive toolkit for solving problems involving interconnected data, optimizing paths, and understanding network structures.

Core Features & Use Cases

  • Pathfinding: Find shortest paths in various scenarios (positive/negative weights, all-pairs).
  • Connectivity: Determine network components, dependencies, and flow capacities.
  • Optimization: Solve problems like task scheduling and resource allocation.
  • Use Case: Use this skill to find the most efficient delivery route for a fleet of vehicles by modeling roads as a graph and applying a shortest path algorithm.

Quick Start

Use the graph-algorithms skill to find the shortest path between node A and node B in a graph with positive edge weights.

Frequently Asked Questions about role-algorithms:graph-algorithms

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

FAQPage Schema
How do I find the shortest path in a graph with negative edge weights?

To find the shortest path with negative edge weights, you can use the Bellman-Ford or Johnson's algorithms. Both handle negative weights, and Johnson's algorithm is particularly effective for computing all-pairs shortest paths in sparse graphs containing negative weight edges.

What is the best way to determine strongly connected components in a directed network?

The best way to find strongly connected components (SCCs) is by using Tarjan's or Kosaraju's algorithms. Both traverse the directed graph to identify maximal subgraphs where every node is reachable from every other node, which is essential for dependency analysis.

How do I solve maximum flow and bipartite matching problems for network optimization?

You solve maximum flow problems using Ford-Fulkerson or Dinic's algorithms, and handle bipartite matching with Hopcroft-Karp or the Hungarian algorithm. These optimize resource allocation and flow capacities across interconnected network structures.

Can I use topological sort for task scheduling and dependency resolution?

Yes, you can use topological sort for task scheduling and dependency resolution. It linearly orders the vertices of a directed acyclic graph so that for every directed edge from node A to node B, node A comes before node B in the ordering.

When should I use Dijkstra vs A* for pathfinding and traversal?

Use Dijkstra for finding the shortest paths from a single source to all other nodes with positive weights. Use A* when you have a specific target node and a heuristic function, making it more efficient for targeted pathfinding and traversal.

How do I find a minimum spanning tree for network connectivity optimization?

You can find a minimum spanning tree using Kruskal's or Prim's algorithms. Both optimize network connectivity by selecting a subset of edges that connects all vertices together without any cycles and with the minimum possible total edge weight.