🎯 ILP Portfolio Rebalancing Solver

Mathematical optimization for minimal cash remainder & target allocation

📐 Mathematical Formulation (ILP)

Decision Variables: x[i] = number of shares to buy of asset i ∈ {0, 1, 2, 3, ...} Objective Function: Minimize: cash_remainder + α × deviation_penalty Where: cash_remainder = budget - Σ(x[i] × price[i]) deviation_penalty = Σ|actual_percentage[i] - target_percentage[i]| α = penalty weight for allocation deviation Constraints: 1. Budget constraint: Σ(x[i] × price[i]) ≤ budget 2. Integer constraint: x[i] ∈ {0, 1, 2, 3, ...} for all i 3. Non-negativity: x[i] ≥ 0 for all i Solution Method: Complete enumeration for small problems or branch-and-bound for larger ones

💼 Current Portfolio

Asset Current Shares Price (€) Current Value (€) Target %
€520.00 %
€250.00 %

💰 Investment Parameters

Higher = prioritize target allocation