The Problem
You have 20+ spending categories and 30+ 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 34 cards and a limit of 5, there are over 278,000 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 used by Google, Amazon, and logistics companies worldwide.
Instead of trying every combination, CP-SAT models the problem as a set of mathematical constraints and finds the provably optimal solution:
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:
- Provably optimal: CP-SAT doesn't just find a good solution — it proves no better solution exists. When the solver returns "optimal," it means every other combination of cards was evaluated and found to be worse.
- Handles complexity: Spending caps, tiered rates, choose-your-category bonuses, transfer partner valuations, and annual fees are all modeled simultaneously.
- Personalized: Your specific spend in each of 20 categories determines the result. Someone who spends $1,000/mo on groceries gets a different recommendation than someone who spends $100.
- Transparent: We show exactly how much each card earns, where to route each category, and the net value after fees. No hidden assumptions.
- The optimal set of cards with annual earnings and fees for each
- 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)
The Result
When you run an optimization, you get:
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 3 cards. Start optimizing now and see the mathematically proven best setup for your spending.