$0.005
per call · USD Coin on Base
0/1 knapsack solver — exact work-bounded capacity planning and portfolio selection for maximum value, with deterministic ties and reproducible DP evidence.
Endpoint
POST https://decision-solver.use.x402atlas.com/knapsack3
Calls / 30d
2
Unique payers / 30d
Sep 1
Last called
exact
Payment scheme
Call this service
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay("https://decision-solver.use.x402atlas.com/knapsack", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"capacity": 7,
"items": [
{
"id": "camera",
"value": 4,
"weight": 3
},
{
"id": "battery",
"value": 5,
"weight": 4
},
{
"id": "tripod",
"value": 6,
"weight": 5
}
]
}),
});
const data = await res.json();curl -X POST \
"https://decision-solver.use.x402atlas.com/knapsack" \
-H "Content-Type: application/json" \
-d '{"capacity":7,"items":[{"id":"camera","value":4,"weight":3},{"id":"battery","value":5,"weight":4},{"id":"tripod","value":6,"weight":5}]}' \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"algorithm_version": "knapsack-01-dp-v1",
"evidence": {
"dp_capacity": 7,
"dp_items": 3,
"optimality_proof": false,
"transcript_encoding": "dpValue[0..capacity] as signed int64 two's-complement, 8-byte big-endian, no prefix",
"transcript_sha256": "ec9c54475ee83fff14d13c4bc4728d2d22b27125fcf88ed76782a0425e758ecf",
"verification": "recompute the bounded dynamic program; the digest detects transcript drift but is not an optimality proof"
},
"objective": "maximum_total_value",
"objective_value": 9,
"operation": "knapsack",
"optimal": true,
"solution": {
"remaining_capacity": 0,
"selected": [
{
"id": "camera",
"original_index": 0,
"value": 4,
"weight": 3
},
{
"id": "battery",
"original_index": 1,
"value": 5,
"weight": 4
}
],
"used_capacity": 7
},
"warnings": [],
"work_units": 24
}Payment details
0x8c128f1ee62bb5e47867cfbae2ad89be325df1b2USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913Is this your API?
Pin it to the top of Search & Web and the homepage with a featured placement.
More from Bounded Decision Solver & similar services
Bounded Decision Solver · Interval Schedule
decision-solver.use.x402atlas.com
Weighted interval scheduling solver — exact maximum-weight compatible job scheduling with half-open intervals and a complete dynamic-programming certificate.
Bounded Decision Solver · BIN Pack
decision-solver.use.x402atlas.com
Bin-packing heuristic — deterministic best-fit-decreasing capacity planning for placing items into bins, with feasibility evidence and an honest volume bound.
Bounded Decision Solver · Assignment
decision-solver.use.x402atlas.com
Assignment solver — exact minimum-cost worker-to-task matching for resource allocation, with deterministic choices and a primal/dual optimality certificate.