HPR Solver
/install hpr-solver
HPR Solver
Solve Linear Programming problems using HPR solver.
Trigger
When user wants to solve an LP problem (MPS file or natural language description).
Usage
For MPS Files
User provides path to .mps file. Confirm parameters first:
⚠️ Please confirm parameters:
1. stoptol (default 1e-6): ?
2. time_limit (default 3600s): ?
3. device_number (0=GPU, -1=CPU): ?
4. Need variable values? (Yes/No)
After confirmation, run:
~/julia/julia-1.10.4/bin/julia --project ~/.openclaw/workspace/HPR-LP \
~/.openclaw/workspace/HPR-LP/hprlp_solve.jl \x3Cmps_file> \x3Ctime_limit> \x3Cstoptol> \x3Cdevice>
For Natural Language
- Parse problem, output mathematical model for confirmation:
📐 Mathematical Model:
```max
[objective function]
[constraint 1]
[constraint 2]
[constraint 3]
Variables:
- x₁ = [description]
- x₂ = [description]
2. After user confirms, ask parameters (same as MPS)
3. Model in Julia/JuMP:
```julia
using JuMP
using HPRLP
model = Model(HPRLP.Optimizer)
set_optimizer_attribute(model, "stoptol", \x3Cvalue>)
set_optimizer_attribute(model, "time_limit", \x3Cvalue>)
set_optimizer_attribute(model, "device_number", \x3Cvalue>)
set_optimizer_attribute(model, "verbose", true)
@variable(model, x1 >= 0)
@variable(model, x2 >= 0)
@constraint(model, c1, \x3Cconstraint 1>)
@constraint(model, c2, \x3Cconstraint 2>)
@objective(model, Max, \x3Cobjective>)
optimize!(model)
- Output Solution Summary:
📊 HPR-LP Results
=== Solution Summary ===
Status: [OPTIMAL/INFEASIBLE/...]
Iterations: \x3Ccount>
Solve Time: \x3Cseconds>
Primal Objective: \x3Cvalue>
Dual Objective: \x3Cvalue>
KKT Error: \x3Cerror>
=== Variables ===
x₁ = \x3Cvalue>
x₂ = \x3Cvalue>
Parameters
| Parameter | Default | Description |
|---|---|---|
| stoptol | 1e-6 | Stopping tolerance |
| time_limit | 3600 | Time limit (seconds) |
| device_number | 0 | GPU device (-1 for CPU) |
Non-LP Problems
If problem is NOT linear (has integer vars, x², products, etc.), respond:
⚠️ HPR only supports Linear Programming (LP).
This appears to be:
- Integer/MILP (use GLPK, CBC, HiGHS)
- Non-linear (use Ipopt)
- Quadratic (use Gurob, CPLEX)
Requirements
- Julia 1.10.4
- HPR-LP
- Linux/macOS/Windows
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install hpr-solver - After installation, invoke the skill by name or use
/hpr-solver - Provide required inputs per the skill's parameter spec and get structured output
What is HPR Solver?
Solve optimization & planning problems using natural language. Just describe what you need — fast, accurate, and built for AI agents. It is an AI Agent Skill for Claude Code / OpenClaw, with 309 downloads so far.
How do I install HPR Solver?
Run "/install hpr-solver" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is HPR Solver free?
Yes, HPR Solver is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does HPR Solver support?
HPR Solver is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created HPR Solver?
It is built and maintained by jiawei_polyu (@ljw2024polyu); the current version is v0.0.9.