Algorithm Selection And Complexity logo

Algorithm Selection And Complexity

Community
peterbamuhigire
algorithm-selection-and-complexity

Use when choosing, reviewing, or explaining an algorithm under explicit correctness, time, space, input-scale, or maintainability constraints; use system-architecture-design for service boundaries and language skills for implementation syntax.

Overview

Publisherpeterbamuhigire
Repositorychwezi-dev-engine
Skill namealgorithm-selection-and-complexity
Stars
29
Forks
6
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by peterbamuhigire on GitHub. Read the source before you install it.

Installation

Install the Algorithm Selection And Complexity AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/algorithm-selection-and-complexity
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/languages/algorithm-selection-and-complexity .claude/skills/algorithm-selection-and-complexity
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Algorithm Selection And Complexity in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Algorithm Selection And Complexity on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Algorithm Selection And Complexity is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Algorithm Selection and Complexity

Choose algorithms by the problem contract and operating constraints, then prove the choice with edge cases and measurements. This skill covers a small, production-relevant catalogue; it does not replace domain, language, or architecture review.

Use When

  • A feature has a non-trivial search, matching, assignment, optimisation, graph, cache, or pathfinding problem.
  • Two correct implementations have different worst-case time, memory, or operational behaviour.
  • A developer needs a plain-language explanation before writing or reviewing code.
  • An early implementation works on examples but its behaviour at scale or at failure boundaries is unknown.

Do Not Use When

  • A standard library operation already satisfies the measured contract; use the language skill and document the chosen primitive.
  • The main decision is service decomposition, data ownership, or deployment; use the applicable architecture or operations skill.
  • The request is an interview-only puzzle with no implementation, correctness, or maintenance decision.

Inputs

InputRequiredPurpose
Problem statement and expected outputyesEstablish correctness and generality
Input shape, scale, and distributionyesBound time and memory behaviour
Failure, freshness, and determinism constraintsconditionalExpose operational risks
Baseline implementation or brute-force comparatorconditionalMeasure whether optimisation earns its complexity

Outputs

  • Algorithm decision record naming the selected algorithm, rejected alternatives, assumptions, and complexity bounds.
  • Edge-case and correctness test matrix.
  • Benchmark evidence on representative and adversarial inputs, or an explicit NOT ASSESSED record.

Evidence Produced

CategoryArtifactFormatExample
CorrectnessDecision recordMarkdown record: selected algorithm and rejected alternatives are traceable to constraintsdocs/algorithms/pathfinding-decision.md
CorrectnessCorrectness matrixMarkdown matrix: edge and failure cases are covered or marked opendocs/algorithms/pathfinding-correctness.md
PerformanceBenchmark recordMarkdown record: inputs, environment, result, and threshold are retaineddocs/algorithms/pathfinding-benchmark.md

Non-negotiables

  • Start with a clear, correct baseline before optimising.
  • Analyse worst-case time and space, not only a favourable example.
  • State what the algorithm assumes about ordering, alphabet, graph weights, cache workload, or input validity.
  • Prefer a simpler correct algorithm when the measured constraint does not require the extra machinery.
  • Do not treat a book example or asymptotic bound as production evidence.

Decision Rules

Problem shape or constraintCandidate routeRequired caution
Stable matching between two preference listsGale-ShapleyDefine proposer-side outcome and incomplete or tied preferences before implementation
Minimum-cost assignment between equal or rectangular setsHungarian algorithmConfirm the cost matrix, forbidden assignments, and padding policy
Many pattern searches or rolling-hash-friendly textRabin-KarpVerify hash hits with exact comparison; collisions are not matches
Pattern search over a stream that cannot be rewoundKnuth-Morris-PrattTest fallback-table construction and repeated-prefix cases
Long static text with a diverse alphabetHorspoolDo not use its skip assumptions blindly on tiny alphabets or short patterns
Bounded value/capacity optimisationKnapsack dynamic programmingState whether the problem is 0/1 or unbounded and bound the table size
Heuristic exploration of combinatorial pathsAnt colony optimisationDefine convergence, reproducibility, and a usable fallback; it is not an exact guarantee
All-pairs shortest paths on a manageable graphFloyd-WarshallReject negative cycles and bound the cubic work before choosing it
Maximum flow through a capacity networkPush-relabelValidate capacities, residual edges, and conservation invariants
Maximal cliques in a graphBron-KerboschExpect output-sensitive growth; constrain graph size and result volume
Lowest-cost path with a useful heuristicA*The heuristic must be admissible for optimality; handle no-path and stale-node cases
Cache with recency and frequency shiftsAdaptive replacement cacheMeasure workload, memory overhead, and eviction stability against a simpler policy

Workflow

  1. Write the problem as input, output, invariants, and failure behaviour.
  2. Implement or retain a transparent baseline and test it on empty, minimum, maximum, duplicate, malformed, and adversarial inputs.
  3. Compare candidate algorithms by correctness risk, worst-case cost, memory, data-shape assumptions, observability, and maintenance burden.
  4. Choose the smallest candidate that satisfies the stated contract. Record the reason, rejected alternative, and any heuristic or probabilistic caveat.
  5. Add proof-oriented tests for invariants and differential tests against the baseline on generated inputs where practical.
  6. Benchmark representative and worst-case distributions. Keep input fixtures, environment, result, and regression threshold with the decision record.
  7. Revisit the choice when data shape, throughput, memory budget, or failure consequences change; do not optimise from an old measurement.

Anti-patterns

  • Choosing an algorithm because its name is fashionable. Fix: start with the problem contract and measured constraint.
  • Reporting average-case speed without naming the input distribution. Fix: include worst-case analysis and a distribution-specific benchmark.
  • Replacing a correct baseline before writing differential tests. Fix: keep the baseline as an oracle for bounded fixtures.
  • Using a probabilistic hash match as proof of equality. Fix: perform exact verification after a candidate hash hit.
  • Applying A* with an overestimating heuristic while claiming optimality. Fix: prove admissibility or label the result heuristic.
  • Introducing a cache policy without measuring hit rate, memory, and eviction churn. Fix: compare it with a documented baseline.

Read next

  • python-modern-standards or the relevant language skill for implementation and tests.
  • system-architecture-design when the algorithm changes a service or data boundary.
  • database-design-engineering when indexes or query plans are the real solution.
  • advanced-testing-strategy for risk-scaled evidence and regression thresholds.

References

Capability Contract

Read and search are required. Execution is preferred for benchmarks and tests. Editing is allowed only within the authorised implementation scope.

Degraded Mode

Without representative inputs or execution, return the decision, assumptions, complexity analysis, and an explicit NOT ASSESSED benchmark requirement.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Algorithm Selection And Complexity AI skill do?

Use when choosing, reviewing, or explaining an algorithm under explicit correctness, time, space, input-scale, or maintainability constraints; use system-architecture-design for service boundaries and language skills for implementation syntax.

Why use Algorithm Selection And Complexity on TypingMind?

Because you install it once and use it with any model. Algorithm Selection And Complexity is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Algorithm Selection And Complexity in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/algorithm-selection-and-complexity. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Algorithm Selection And Complexity?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Algorithm Selection And Complexity?

As many as you like. As long as a model supports skills, you can use Algorithm Selection And Complexity with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Algorithm Selection And Complexity AI skill free?

Yes. It is published on GitHub by peterbamuhigire under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇