dp-optimizer

Apply advanced DP optimizations automatically

509 stars

Best use case

dp-optimizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Apply advanced DP optimizations automatically

Teams using dp-optimizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dp-optimizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/algorithms-optimization/skills/dp-optimizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dp-optimizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dp-optimizer Compares

Feature / Agentdp-optimizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Apply advanced DP optimizations automatically

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# DP Optimizer Skill

## Purpose

Apply advanced dynamic programming optimizations to improve time and space complexity of DP solutions.

## Capabilities

- Convex hull trick detection and application
- Divide and conquer optimization
- Knuth optimization
- Monotonic queue/deque optimization
- Alien's trick / WQS binary search
- Rolling array optimization
- Bitmask compression

## Target Processes

- dp-state-optimization
- advanced-dp-techniques
- complexity-optimization

## Optimization Techniques

### Time Optimizations
1. **Convex Hull Trick**: O(n^2) -> O(n log n) for certain recurrences
2. **Divide & Conquer**: O(n^2 k) -> O(n k log n) when optimal j is monotonic
3. **Knuth Optimization**: O(n^3) -> O(n^2) for certain interval DP
4. **Monotonic Queue**: O(n*k) -> O(n) for sliding window DP

### Space Optimizations
1. **Rolling Array**: O(n*m) -> O(m) when only previous row needed
2. **Bitmask Compression**: Reduce state space with bit manipulation

## Input Schema

```json
{
  "type": "object",
  "properties": {
    "dpCode": { "type": "string" },
    "stateDefinition": { "type": "string" },
    "transitions": { "type": "string" },
    "currentComplexity": { "type": "string" },
    "targetComplexity": { "type": "string" },
    "optimizationType": {
      "type": "string",
      "enum": ["auto", "convexHull", "divideConquer", "knuth", "monotonic", "space"]
    }
  },
  "required": ["dpCode", "optimizationType"]
}
```

## Output Schema

```json
{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "optimizedCode": { "type": "string" },
    "optimizationApplied": { "type": "string" },
    "newComplexity": { "type": "string" },
    "explanation": { "type": "string" }
  },
  "required": ["success"]
}
```

Related Skills

svg-optimizer

509
from a5c-ai/babysitter

Optimize SVG assets, generate sprites, and convert to React components

doe-optimizer

509
from a5c-ai/babysitter

Skill for optimizing experimental designs using DOE principles

circuit-optimizer

509
from a5c-ai/babysitter

Quantum circuit optimization skill for gate reduction, depth minimization, and hardware-aware compilation

nanoparticle-synthesis-optimizer

509
from a5c-ai/babysitter

Synthesis parameter optimization skill for metal, semiconductor, and oxide nanoparticle production with automated protocol generation and reproducibility validation

drug-encapsulation-optimizer

509
from a5c-ai/babysitter

Drug delivery formulation skill for optimizing drug loading, encapsulation efficiency, and release kinetics

warehouse-slotting-optimizer

509
from a5c-ai/babysitter

Warehouse slotting and layout optimization skill for pick path minimization and space utilization.

network-optimizer

509
from a5c-ai/babysitter

Network optimization skill for transportation, assignment, and flow problems on graph structures.

facility-layout-optimizer

509
from a5c-ai/babysitter

Facility layout optimization skill for material flow minimization and space utilization.

signal-timing-optimizer

509
from a5c-ai/babysitter

Traffic signal timing optimization skill for cycle length, phasing, and coordination

scaffold-design-optimizer

509
from a5c-ai/babysitter

Tissue engineering scaffold design optimization skill for pore size, porosity, and mechanical properties

prosthetics-design-optimizer

509
from a5c-ai/babysitter

Prosthetics and orthotics design optimization skill integrating biomechanical requirements with manufacturing constraints

inventory-optimizer

509
from a5c-ai/babysitter

Inventory management optimization skill with safety stock calculation, reorder point determination, and ABC analysis