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
Even when the fee was high, there are some that make use of some features like RBF to pump their transaction ad make it faster, they would have also reduce their transactions fee rate by using the lowest priority, while using bitcoin mining pool that has the best offers in confirming their transactions with yours when the next block get confirmed.
My question is what is the algorithm that a miner picks a transaction from the mempool to include it to a block?
Those transactions with the higher fees get confirmed first with higher priority over those with lower transaction fee, but for the benefit of those that uses a mining pool to boost their transactions, their transactions is being added to their own block transaction to get confirmed altogether.
Is it a greedy algorithm which just picks the ones with highest fees?
They aren't greedy, just that the miners get higher opportunities in this for making more profits than before and when the whole blocks had being completely mined, they still have to depend on the transaction fee to earn their income