I broadcasted a low fee (11sat/vbyte) transaction last week, just at the time when they fees went up.
I knew that the fee was low and that the transaction would take a few days to confirm (according to
https://twitter.com/CoreFeeHelper , it would take around 3 days) but it's been a week and my transaction is still in the mempool. Sometimes my wallet (electrum) shows it with a blue "unbroadcasted" icon and I have to rebroadcast it again. I also sometimes use "free" tx accelerator services which basically rebroadcast the transaction everywhere.
My question is what is the algorithm that a miner picks a transaction from the mempool to include it to a block?
Is it a greedy algorithm which just picks the ones with highest fees? Is the "age" of a transaction in the mempool also a factor? Or is it just a combination of fee and a random choice?
Yes obviously it's this also only which gives them highest reward or basically which has highest sat/ byte fees. I won't call the algorithm greedy rather I'll say it rational. If you see in a real world this is only the case. You'll always pick up highest paying person when you are given an option to do just a small task for someone. Can't blame miners when they do this.
Talking about rebroadcast. So rebroadcast does nothing but brings your transaction in the top of the pool again for miners to choose. But eventually if the fees is low and the current rate is still higher there are very less chances any miner will still pick it. If you really want to do the transaction your best bet will be to make it to redo the transaction with the higher fees the old one will get declined automatic.