I understand where you're coming from. But I'm wondering if there are any benefits to running a solver after having a solution given by getblocktemplate; concurrently, we can solve for a better solution while it is running. Hence, the tradeoff is minimal, if you get a better solution from your lp, then use it. Else, just use whatever is provided by getblocktemplate.
Part of my interest is also seeking to narrow the search space. I understand the entire mempool is far too big,
It's not too big. Even a mempool with 100 blocks of backlog will only have on the order of 200k transactions. A standard open source ILP solver will find an optimal solution quite quickly.
Not quick enough for relay/eviction decisions or for the very first template of a new block-- but quickly.
All the information needed is in the getrawmempool true output-- well except for the sigops counts because who the hell knows, but it's a one line patch to add it.
The LP is simple: there is a set of binary inclusion variables, you maximize the sum of the tx fees times their inclusion variables, subject to their weights times the inclusions variables being under the weight limit and their sigops times inclusion being under the sigops limit and subject to the constraints that any transactions inclusion variable is >= that of all its ancestors.
But the result is that except during big sustained backlogs it hardly increases income, and even there it only produces one shot income for being smart enough to take some transactions that are failing to make it in.