Skip to content
All posts
guide8 min read

How OptimalCardSetup Models Your Credit Card Setup

A deep dive into the CP-SAT solver, integer programming, and how we distinguish proven-optimal results from the strongest valid setup found within a time limit.

The Problem

You have 20+ spending categories and a large catalog of credit cards, each with different earn rates, caps, annual fees, and bonus structures. Which combination of 3-5 cards maximizes your annual rewards?

The math is harder than it looks. With dozens of cards and a limit of 5, there are millions of possible combinations. Each combination requires checking how to optimally route every dollar of spend across categories — accounting for spending caps, tiered earn rates, choose-your-category bonuses, and more.

A brute-force approach works for small problems, but as the card database grows, it becomes computationally expensive. More importantly, heuristics like "just pick the highest rate per category" miss interactions between cards — annual fees, transfer partner ecosystems, and spending caps all create dependencies.

Our Approach: Constraint Programming

OptimalCardSetup uses Google OR-Tools CP-SAT, an industrial-strength constraint programming solver.

Instead of enumerating every combination, CP-SAT models the problem as a set of mathematical constraints and searches for the setup with the highest modeled net value:

Decision Variables

  • Card selection: Which cards to include (binary: yes/no for each card)
  • Spend allocation: How many cents per category to route to each card per month
  • Segment allocation: Which earning tier applies for each dollar (base rate, bonus rate, capped rate)

Constraints

  • Total spend per category equals your monthly budget
  • Each card’s bonus rates have spending caps (e.g., Amex Gold 4x on groceries up to $25,000/year)
  • You can select at most N cards (your max cards setting)
  • Choose-your-category cards (like US Bank Cash+) can only pick a limited number of bonus categories
  • Rent can only go to one card (you can’t split rent payments)

Objective

Maximize: total annual rewards value minus total annual fees.

Point valuations are configurable — in travel mode, transferable points are worth more (e.g., Chase UR at 1.7 cents per point) while cash back is always 1 cent per point.

Integer Arithmetic for Precision

A critical detail: CP-SAT only works with integers. All monetary values are stored in cents (not dollars), and point valuations are scaled by 1000 (so 1.7 CPP becomes 1700). This eliminates floating-point rounding errors that could produce incorrect results.

The objective function computes annual value in "scaled units" which are converted to dollars only at the final display step.

What Makes This Different

Most credit card recommendation sites use editorial judgment or simple scoring. They pick "best for dining" or "best for travel" without considering your complete spending profile or the interactions between cards.

OptimalCardSetup is different because:

  1. Proof-aware status: When CP-SAT returns "optimal," it has established that no better valid solution exists within the modeled problem. If the time limit arrives first, we show the strongest valid result found as "Best Found" instead of presenting it as proven optimal.
  2. Handles complexity: Spending caps, tiered rates, choose-your-category bonuses, transfer partner valuations, and annual fees are all modeled simultaneously.
  3. Personalized: Your specific spend in each of 24 categories determines the result. Someone who spends $1,000/mo on groceries gets a different recommendation than someone who spends $100.
  4. Transparent: We show modeled earnings for each card, where to route each category, and the net value after fees. The assumptions are visible.

The Result

When you run an optimization, you get:

  • A recommended set of cards with a clear Proven Optimal or Best Found status
  • A category-by-category routing guide ("Use Card X for dining, Card Y for groceries")
  • The earn rate and annual value for each category assignment
  • Total net annual value (earnings minus fees)

Premium users can also see alternative setups (2nd best, 3rd best) and run what-if scenarios to test how changes in spending affect the recommendation.

Try It

The optimizer is free for up to 2 cards. Start optimizing now to see the strongest setup found for your spending and whether the solver proved it optimal.

Not financial advice. OptimalCardSetup provides mathematical optimization tools for educational and informational purposes only. This does not constitute financial, investment, or credit advice. Card rates, fees, and benefits shown are last checked as of Aug 2, 2026. Terms may change — always verify current details with the card issuer before applying.

Solver examples on this site are bounded by the stated catalog, objective, spending assumptions, redemption values, constraints, and data snapshot. If a run timed out, optimality was not proven; issuer eligibility, approval, terms, and application-channel offers remain controlling.

Ready to model your card setup?

Start optimizing — free