A unified and adaptive real-time graph-theoretic optimization strategy for reconfigurable battery storage systems | Synapse